On 13/07/2011 14:37, Lataxes, Karl wrote:
> We are attempting to run identical servlets under several Tomcat 7.0.8 nodes 
> behind a load balancer (Apache 2.0.54 using mod_jk), but we have been unable 
> to get sticky sessions to work.  Initial requests are forwarded to a node as 
> expected, but subsequent requests from the same client are being forwarded to 
> the second node ala round robin, which triggers session not found logic in 
> our application and causes the connection to terminate.  Due to environment 
> limitations, we cannot employ session persistence to our Tomcat instances and 
> must make use of sticky sessions.  My Tomcat instances have been properly 
> configured (HTTP connector commented out, AJP 1.3 connected uncommented, 
> jvmRoute attribute in each instance set to the workers listed in 
> workers.properties file).
> 
> Here are the mod_jk entries in my httpd.conf file:
> 
> LoadModule jk_module /<path_to>/apache/modules/mod_jk.so
> 
> JkWorkersFile /<path_to>/apache/conf/workers.properties
> JkLogFile logs/mod_jk.log
> JkLogLevel debug
> 
> JkMount /* loadbalancer
> 
> Here are the entries in my workers.property file:
> 
> worker.list=loadbalancer
> 
> worker.tomcat7A.type=ajp13
> worker.tomcat7A.host=<host_name>
> worker.tomcat7A.port=4911
> worker.tomcat7A.lbfactor=1
> 
> 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
> 
> What am I doing wrong?


Are they always forwarded to the wrong node, or do some succeed?

If you monitor the response headers (look for Set-Cookie:
NNNNNN.tomcat7X) is a new session sent each time?

Is the client sending the Cookie: header with the second request?

Are you URL encoding each link in the page?


p






Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to