tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lataxes, Karl" <>
Subject RE: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8
Date Fri, 12 Aug 2011 13:30:33 GMT
The jvmRoute's for both server.xmls are properly set to the worker names and are not commented
out.  This was the first thing I verified.

    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat7A">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat7C"> 

Here are the settings in (worker tomcat7A identical to tomcat7C except
for port, since both are running on the same server for testing.  In production, we will probably
install them on separate boxes):


Here are the JkMount settings in mod_jk.conf:

JkMount /jkmanager/* jkstatus
JkMount / servlet/* loadbalancer

Load balancing is working, but subsequent requests from a single client are being routed to
the other Tomcat instance despite sticky_session being set to 1.

-----Original Message-----
From: Rainer Jung [] 
Sent: Friday, August 12, 2011 4:17 AM
Subject: Re: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

On 11.08.2011 15:32, Lataxes, Karl wrote:
> OK, I'm getting close.  On the server side, I'm adding a "Set-Cookie" header containing
the session id I want to use.  The client emulator I am using has similarly been modified
to add a "Cookie" header with the session id sent by the server, but sticky sessions are still
not working.  In the mod_jk log, there is a "searching worker for partial sessionid" reference
that contains the correct session id, but ".<worker>" was not appended.  In my
file, "sticky_session" is set to 1.  The "jvmRoute" parameters in my respective Tomcat server.xml
files are set to the workers identified in the file as well.   What do
I have to do to append ".<worker>" to the outgoing session id?

When Tomcat sets a session cookie, and you correctly set the jvmRoute in server.xml, it automatically
adds the value of jvmRoute to the end of the session id, separated with a dot.

Make sure you did not set the jvmRoute in some line in server.xml that is cmmented out.

To make stickyness with mod_jk happen, the jvmRoute used for Tomcat should be equal to the
name of the worker pointing to the Tomcat instance. Finally you add all those workers to a
load balancer worker in mod_jk and JkMount the URLs to the load balancer worker.



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message