Hello all:

I�ve been struggling with this issue for quite a long time now, and I can�t seem to 
find a solution.

I�m actually using this configuration:

Apache 1.3.23
Tomcat 4.0.1
Jboss 4.2.3


I�ve used mod_jk and the loadbalancer connector to connect my web server with two 
other tomcat servers. Both of the tomcat servers connect to the Jboss server.

The problem is that sessions are not mantained. Apache keeps sending me randomly to 
one tomcat server or the other instead of choosing one. That makes me lose my session 
id and get errors in my application.


Regarding to the tomcat servers configuration, I have my jvmroute statement set right 
(I think):

in server 1:

    <Engine jvmRoute="tomcat1" name="Standalone" defaultHost="foo.bar.com" debug="1">

in server 2:


    <Engine jvmRoute="tomcat2" name="Standalone" defaulttHost="foo2.bar.com" debug="1">



the workers.properties file has this configuration:

# list the workers by name

worker.list=tomcat1, tomcat2, loadbalancer

# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=foo.bar.com
worker.tomcat1.type=ajp13#

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

# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat2.port=8009
worker.tomcat2.host=foo2.bar.com
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=50

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

#
# END workers.properties
#

Maybe I set the lbfactor wrong? Wich numbers should I use?

Thanks a lot for all your help so far.
 

Gabriel

PS: Here is a little graph of the distribution of the servers


*************************                            ***********************
*Apache web server  *                            * Tomcat2 server   *
*Tomcat1 server       *----------------------------*  Jboss 2.4.3       *
*foo.bar.com            *                            * foo2.bar.com      *
*************************                            ***********************

Reply via email to