tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edlira "Kumbar˙ffffffffffffffffe7e" <inapatat...@yahoo.com>
Subject Apache2+Tomcat5.5+mod_jk loadbalancing: Sticky sessions not working
Date Wed, 11 May 2005 22:13:45 GMT
Hello,
I have been trying for weeks now to get this to work.
Maybe someone can help me.
I have Apache2 installed and configured in machine A,
using mod_jk to connect to two tomcat servers. Tomcat1
is in machine B and Tomcat2 in machine A. I have
created a workers.properties file, which I have put in
the apache "conf". This file specifies workers timcat1
and tomcat2, as well as worker loadbalancer, which is
supposed to balance the load between the two tomcats.
Everything works fine, except for the sticky sessions,
or session affinity. When a page is requested, I need
it to be served from one of the available tomcat
servers, and then each time the page is requested
subsequently from the same machine, it should be
served from the same tomcat server as before. It
doesn't seem to work. Each time I refresh the page, it
get served from the same tomcat a couple of times,
then it gets served from the other tomcat, stays on
that tomcat a couple of refresh hits and then swiches
again. I can't see a pattern or figure out why this is
happening.
Here's my workers.properties file:
#
# workers.properties 
#

# In Windows, we use backward slashes:
ps=\

# list the workers by name

worker.list=loadbalancer

# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=<machine B's IP>
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


# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat2.port=8009
worker.tomcat2.host=<machine A's IP>
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

# ------------------------
# 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=True

#
# END workers.properties
#


In httpd.conf, I have added:
JkWorkersFile "conf/workers.properties"
JkLogFile "logs/mod_jk.log"
JkLogLevel debug

<some JkMount lines>

LoadModule jk_module modules/mod_jk.so

In server.xml, I've set jvmRoute="tomcat1" (tomcat2 on
the other tomcat's server.xml)

I can't think of any other infomation that you may
find helpful.
If anyone has any idea, or any question, I really need
help on this.
Anything would be much appreciated.
Thanks,
Edlira

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message