You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joshua Sunil Kumar <jo...@wipro.com> on 2003/03/10 06:52:25 UTC

Problem with sticky session in Tomcat4.1.18 and Apache 2.0.43 using mod_JK Connector.

BlankHi
I'm using Apache2.0.43 and Tomcat4.1.18. I have configured it with multiple
tomcat instances with a load balancer. But I am unable to maintain sticky
session . The application that I am using has to maintain sessions. But this
not happening .When I login the request is JSP so it does to the first
Tomcat after login when I click on any link it goes to the second Tomcat and
I get a session timeout.
I want to know if any one has configured this version of tomcat for
maintaining sticky session . I am also sending the workers.properties
# workers.properties
#

# In Unix, we use forward slashes:
ps=/

# list the workers by name

#worker.list=tomcat1,tomcat2,loadbalancer
worker.list=loadbalancer
#worker.list=loadbalancer
# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=11009
worker.tomcat1.host=192.168.146.205
worker.tomcat1.type=ajp13

# Specify the size of the open connection cache.
#worker.tomcat1.cachesize

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=100
#worker.tomcat1.local_worker=1


# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat2.port=12009
worker.tomcat2.host=192.168.146.205
worker.tomcat2.type=ajp13

# Specify the size of the open connection cache.
#worker.tomcat2.cachesize

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.tomcat2.lbfactor=100
#worker.tomcat2.local_worker=1

# ------------------------
# Load Balancer worker
# ------------------------

#
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
#  ----> If a worker dies, the load balancer will check its state
#        once in a while. Until then all work is redirected to peer
#        worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1,tomcat2
worker.loadbalancer.sticky_session=1
 in Tomcat#worker.loadbalancer.local_worker_only=2

RE: Problem with sticky session in Tomcat4.1.18 and Apache 2.0.43 using mod_JK Connector.

Posted by Filip Hanik <ma...@filip.net>.
BlankI remember there being a property called jvmRoute in the server.xml
file that would allow the Apache workers to make sure you got the right
Tomcat server upon the next request.

otherwise, you can just cluster enable your system, and it should work for
you.
http://www.filip.net/tomcat-clustering.html

Filip

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
www.filip.net

  -----Original Message-----
  From: Joshua Sunil Kumar [mailto:joshua.kumar@wipro.com]
  Sent: Sunday, March 09, 2003 9:52 PM
  To: tomcat-user@jakarta.apache.org
  Subject: Problem with sticky session in Tomcat4.1.18 and Apache 2.0.43
using mod_JK Connector.


  Hi
  I'm using Apache2.0.43 and Tomcat4.1.18. I have configured it with
multiple tomcat instances with a load balancer. But I am unable to maintain
sticky session . The application that I am using has to maintain sessions.
But this not happening .When I login the request is JSP so it does to the
first Tomcat after login when I click on any link it goes to the second
Tomcat and I get a session timeout.
  I want to know if any one has configured this version of tomcat for
maintaining sticky session . I am also sending the workers.properties
  # workers.properties
  #

  # In Unix, we use forward slashes:
  ps=/

  # list the workers by name

  #worker.list=tomcat1,tomcat2,loadbalancer
  worker.list=loadbalancer
  #worker.list=loadbalancer
  # ------------------------
  # First tomcat server
  # ------------------------
  worker.tomcat1.port=11009
  worker.tomcat1.host=192.168.146.205
  worker.tomcat1.type=ajp13

  # Specify the size of the open connection cache.
  #worker.tomcat1.cachesize

  #
  # Specifies the load balance factor when used with
  # a load balancing worker.
  # Note:
  #  ----> lbfactor must be > 0
  #  ----> Low lbfactor means less work done by the worker.
  worker.tomcat1.lbfactor=100
  #worker.tomcat1.local_worker=1


  # ------------------------
  # Second tomcat server
  # ------------------------
  worker.tomcat2.port=12009
  worker.tomcat2.host=192.168.146.205
  worker.tomcat2.type=ajp13

  # Specify the size of the open connection cache.
  #worker.tomcat2.cachesize

  #
  # Specifies the load balance factor when used with
  # a load balancing worker.
  # Note:
  #  ----> lbfactor must be > 0
  #  ----> Low lbfactor means less work done by the worker.
  worker.tomcat2.lbfactor=100
  #worker.tomcat2.local_worker=1

  # ------------------------
  # Load Balancer worker
  # ------------------------

  #
  # The loadbalancer (type lb) worker performs weighted round-robin
  # load balancing with sticky sessions.
  # Note:
  #  ----> If a worker dies, the load balancer will check its state
  #        once in a while. Until then all work is redirected to peer
  #        worker.
  worker.loadbalancer.type=lb
  worker.loadbalancer.balanced_workers=tomcat1,tomcat2
  worker.loadbalancer.sticky_session=1
   in Tomcat#worker.loadbalancer.local_worker_only=2