You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Knoblauch <kn...@gmail.com> on 2013/02/21 14:11:10 UTC

Find out which sessions are connected to a specific Tomcat in a HA/Failover setup

Hi,

 this is more of a principal question. We operate the following
HA/Failover Setup:

Frontend: Apache 2.2.21 + mod_jk 1.2.32
Backend: 6 x Tomcat 7.0.32

We have two types of clients. First there are interactive clients that
connect via a browser. Second we have batch clients that are run via a
queuing system (SGE) on a cluster of Linux servers. Those batch jobs
do the "dirty work" like transferring mass data and other long running
stuff that we do not want to run on the backends themselves.

Now sometimes the clients get into trouble and we need to find out
what is going on. First step is to look into the tomcat log files. For
that of course we need to know which of the instances is serving the
client (we do session persistence, so the clients stay on their
servers unless there is a failover). For the interactive clients this
is usually easy. We can have the users look at the jvmroute part of
the session cookie.

The problem arises on the batch clients. How to ask them? :-) So, the
question is whether there is a way of finding out from the outside
which tomcat a client-session is talking to? The connections are of
course all through the Apache frontend, which does not make it easier.

Any insight (or pointer to the right manual) would be highly appreciated.

Ah yes, modifying the application to just log the cookie is of course
possible, but for reasons, not to be discussable here, political
difficult.

Thanks in advance
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Find out which sessions are connected to a specific Tomcat in a HA/Failover setup

Posted by Martin Knoblauch <kn...@gmail.com>.
On Fri, Feb 22, 2013 at 10:10 AM, Mark Thomas <ma...@apache.org> wrote:
> On 22/02/2013 08:59, Martin Knoblauch wrote:
>>
>>   Same not to be discussed here political problem :-( The whole
>> application (server and clients) is closed commercial code.
>
>
> Can you modify anything?
>
> For example, you could add client IP and session ID to the access log for
> httpd. If your batch clients have unique IPs that will give you the jvm
> route that an IP is using. While this might not be exactly what you need
> some variation of it might work given that you can log pretty much anything
> from an HTTP header.
>
Hi Mark,

 OK. I will try looking at extending the access log. Sounds promising.

Thanks
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Find out which sessions are connected to a specific Tomcat in a HA/Failover setup

Posted by Mark Thomas <ma...@apache.org>.
On 22/02/2013 08:59, Martin Knoblauch wrote:
>   Same not to be discussed here political problem :-( The whole
> application (server and clients) is closed commercial code.

Can you modify anything?

For example, you could add client IP and session ID to the access log 
for httpd. If your batch clients have unique IPs that will give you the 
jvm route that an IP is using. While this might not be exactly what you 
need some variation of it might work given that you can log pretty much 
anything from an HTTP header.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Find out which sessions are connected to a specific Tomcat in a HA/Failover setup

Posted by Martin Knoblauch <kn...@gmail.com>.
On Thu, Feb 21, 2013 at 8:16 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Martin,
>
> On 2/21/13 8:11 AM, Martin Knoblauch wrote:
>> this is more of a principal question. We operate the following
>> HA/Failover Setup:
>>
>> Frontend: Apache 2.2.21 + mod_jk 1.2.32 Backend: 6 x Tomcat 7.0.32
>
> Sticky sessions or not?

 Sticky. Thought I had written it below.

>
>> We can have the users look at the jvmroute part of the session
>> cookie.
>>
>> The problem arises on the batch clients. How to ask them? :-) So,
>> the question is whether there is a way of finding out from the
>> outside which tomcat a client-session is talking to? The
>> connections are of course all through the Apache frontend, which
>> does not make it easier.
>
> How can you identify a client in general? Do they maintain sessions?
> If so, how do they maintain them (e.g. cookie-based, URL-based, or no
> session state)? Obviously, if there is no session state, then there is
> no "backend serving them" because they'll just use whatever backend
> they get for their individual requests.
>

 Lots of session state, cookie based. Due to the stickiness, we can
assume that the client/server relationship is stable once the session
is established (not counting failover here, but that is not an big
issue).

>> Any insight (or pointer to the right manual) would be highly
>> appreciated.
>>
>> Ah yes, modifying the application to just log the cookie is of
>> course possible, but for reasons, not to be discussable here,
>> political difficult.
>
> How about modifying the clients?
>

 Same not to be discussed here political problem :-( The whole
application (server and clients) is closed commercial code.

Thanks
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Find out which sessions are connected to a specific Tomcat in a HA/Failover setup

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Martin,

On 2/21/13 8:11 AM, Martin Knoblauch wrote:
> this is more of a principal question. We operate the following 
> HA/Failover Setup:
> 
> Frontend: Apache 2.2.21 + mod_jk 1.2.32 Backend: 6 x Tomcat 7.0.32

Sticky sessions or not?

> We can have the users look at the jvmroute part of the session 
> cookie.
> 
> The problem arises on the batch clients. How to ask them? :-) So,
> the question is whether there is a way of finding out from the
> outside which tomcat a client-session is talking to? The
> connections are of course all through the Apache frontend, which
> does not make it easier.

How can you identify a client in general? Do they maintain sessions?
If so, how do they maintain them (e.g. cookie-based, URL-based, or no
session state)? Obviously, if there is no session state, then there is
no "backend serving them" because they'll just use whatever backend
they get for their individual requests.

> Any insight (or pointer to the right manual) would be highly
> appreciated.
> 
> Ah yes, modifying the application to just log the cookie is of
> course possible, but for reasons, not to be discussable here,
> political difficult.

How about modifying the clients?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEmcpsACgkQ9CaO5/Lv0PCIJACfZq8Q79yiIeu8dN01ApTM/ciq
KD0AnikzRUHmaMv4n/38dqHnjIsbc+Dt
=QB9S
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org