Hi,

I have an apache 1.3.22 server with two tomcat 4.0.2-B2
servers to serve JSP pages.  I use the load balancer.

The problem is that when I reload the "/index.jsp" page,
I randomly get the first or the second tomcat server.
So the problem seems to be that sticky sessions (aka
session affinity) appears to be broken.

Any help would be greatly appreciated!

Pascal Forget
[EMAIL PROTECTED]


Setup:

Linux i686
JDK 1.4 beta3 installed under /apps/jdk_tc1
Apache 1.3.22
mod_jk.so dated january 23, 2002
Two tomcat 4.0.2-b2 servers, with AJP13 connectors
listening on ports 11009 and 12009 respectively.

Part of apache's httpd.conf:

JkMount /*.jsp loadbalancer
JKMount /servlet/* loadbalancer
JkWorkersFile /web/tc402b2-1/conf/workers.properties
JkLogFile /web/foobar/logs/mod_jk.log
JkLogLevel info


#
# workers.properties
#
workers.tomcat_home=/web/tc402b2-1
workers.java_home=/apps/jdk_tc1
ps=/
worker.list=tomcat1, tomcat2, loadbalancer

# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=11009
worker.tomcat1.host=localhost
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=100

# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat2.port=12009
worker.tomcat2.host=localhost
worker.tomcat2.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.tomcat2.lbfactor=101


# ------------------------
# Load balancer worker
#-------------------------
#
# The loadbalancer (type lb) worker perform 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
#


Contents of the index.jsp page on the FIRST tomcat server:

<html><body bgcolor=red>
<center>
<%= request.getSession().getId() %>
<h1>Tomcat 1</h1>
</body></html>


Contents of the index.jsp page on the SECOND tomcat server:

<html><body bgcolor=blue>
<center>
<%= request.getSession().getId() %>
<h1>Tomcat 2</h1>
</body></html>




--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to