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 workers.properties (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):

worker.list=loadbalancer,jkstatus
worker.tomcat7C.type=ajp13
worker.tomcat7C.host=<host_name>
worker.tomcat7C.port=4931
worker.tomcat7C.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=tomcat7A,tomcat7C
worker.loadbalancer.sticky_session=1
worker.jkstatus.type=status

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 [mailto:rainer.j...@kippdata.de] 
Sent: Friday, August 12, 2011 4:17 AM
To: users@tomcat.apache.org
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 
> workers.properties 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 workers.properties 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.

Regards,

Rainer


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


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

Reply via email to