You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Lataxes, Karl" <Ka...@nielsen.com> on 2011/07/13 15:09:54 UTC

[users@httpd] Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

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?

[users@httpd] RE: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

Posted by Ashwin Kesavan <as...@yahoo-inc.com>.
This is not the right mailing list. Ask in tomcat user mailing list http://tomcat.apache.org/lists.html . Because session stickness has to do with mod_jk and tomcat, not httpd. Mod_jk and tomcat issues are best addressed in tomcat mailing list.

With regards,
ashwin

From: Lataxes, Karl [mailto:Karl.Lataxes.ap@nielsen.com]
Sent: Wednesday, July 13, 2011 6:40 PM
To: users@httpd.apache.org
Subject: [users@httpd] Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

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?