2

I want to use load balancing with Apache mod_jk module. I have installed Apache 2.2 and coresponding mod_jk module. Additionally I'm running to Tomcat 7 instances. My application running on the Tomcat produces a session-id in a hidden form field like in the example below:

<input name="USERID" type="hidden" value="o8b651zQOY1A1Hvl" id="USERID">

Here's my httpd.conf:

# all servlets and jsp to balance1
JkMount /*.jsp balance1

my workers.properties:

worker.list=jkstatus,balance1

# The load balancer worker balance1 will distribute
# load to the members worker1 and worker2
worker.balance1.type=lb
worker.balance1.balance_workers=worker1, worker2
worker.balance1.sticky_session=true
worker.balance1.sticky_session_force=true

#worker1
worker.worker1.type=ajp13
worker.worker1.host=demoappsrv1
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.session_cookie=USERID

#worker2
worker.worker2.type=ajp13
worker.worker2.host=demoappsrv2
worker.worker2.port=8009
worker.worker2.lbfactor=50
worker.worker2.session_cookie=USERID

my server.xml from first Tomcat instance:

<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">

my server.xml from second Tomcat instance:

<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">

With this configuration the sticky session is not working. Any idea would be appreciated.

Thanks in advance!

Dirk66
  • 29
  • 1
  • 3

1 Answers1

-2

Having a hidden field in a form does not automatically create a cookie.

mauhiz
  • 506
  • 5
  • 14