[Yanel-usage] Tomcat and Sticky Sessions

Cedric Staub cedric.staub at wyona.com
Wed Feb 9 10:55:42 CET 2011


Hello there!

I'm playing around with a cluster consisting of four nodes here, and I'm
having trouble getting sticky sessions to work. I constantly get swapped
around different nodes which leads to me being logged out.

Here's the setup:
- Apache HTTPd as Balancer
- Four Tomcat 5.5.30 worker nodes

I have configured everything according to
https://tomcat.apache.org/connectors-doc/reference/workers.html

Here's the workers config:
--------------------------
worker.list=wlb,jkstatus

worker.ajp13w1.type=ajp13
worker.ajp13w1.host=127.0.0.1
worker.ajp13w1.port=9109
worker.ajp13w1.route=cnode1

worker.ajp13w2.type=ajp13
worker.ajp13w2.host=127.0.0.1
worker.ajp13w2.port=9209
worker.ajp13w2.route=cnode2

worker.ajp13w3.type=ajp13
worker.ajp13w3.host=192.168.1.81
worker.ajp13w3.port=9109
worker.ajp13w3.route=cnode3

worker.ajp13w4.type=ajp13
worker.ajp13w4.host=192.168.1.81
worker.ajp13w4.port=9209
worker.ajp13w4.route=cnode4

worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w1,ajp13w2,ajp13w3,ajp13w4
worker.wlb.sticky_session=True

worker.jkstatus.type=status
--------------------------

The jvmRoute settings in the Tomcat workers match the route
configuration in the balancer, that is the cnode1 worker also has cnode1
set as jvmRoute. 

Yet, my session still gets swapped around occasionally, and I have no
idea where to look. Does anyone have any ideas on how I can troubleshoot
this or something?

If all else fails, I think I might abandon the Apache Tomcat Connector
and just try it with mod_proxy.

Thanks,
Cedric


More information about the Yanel-usage mailing list