tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From János Löbb <>
Subject [Cluster] Sanity check
Date Tue, 12 Apr 2011 19:14:58 GMT

/Httpd 2.2.17, mod_jk 1.2.31, tomcat 7.0.10, OSX 10.6.5/

Looks like there is something I do not get regarding Tomcat clustering, so I do here a sanity
check :-)

I have two machines with one tomcat on both.

I use one of the machines as reverse proxy.  here is the reverse proxy conf from the httpd.conf

ProxyRequests Off
<Proxy balancer://pathCluster>
	BalancerMember loadfactor=10 
	BalancerMember loadfactor=10 
	ProxySet lbmethod=bytraffic
ProxyPass	/tc/ balancer://pathCluster/ 
ProxyPassReverse	/tc/ balancer://pathCluster/
ProxyPassReverseCookiePAth	/ /
ProxyPassReverseCookieDomain	/ /

The reverse proxy passes the request to one of the balance members.  The balance member see
that the request is for tomcat and passes it to mod_jk.  Mod_jk is checking its
file and based upon the load it passes the request to one of the two Tomcat instances.  Here
is one of the file:

bml0065:local administrator$ cat apache2/conf/ 
worker.list = lb,jkstatus,tomcat3 = True = False


worker.tomcat1.type = ajp13 =
worker.tomcat1.port = 8109
worker.tomcat1.lbfactor = 1

worker.tomcat3.type = ajp13 =
worker.tomcat3.port = 8309
worker.tomcat3.lbfactor = 1

To check session replication and session failover, I use the SessionExmaple servlet from the
supplied examples webapp this way:

bml0065 is the reverse proxy.  When I see that the session is created I shut down that tomcat
which hosts the session and add another session attribute via the SessionExample servlet.
 The mechanism is working fine, the session fails over to the other tomcat instance.  I add
more session attribute, and start up the previously shouted down tomcat instance, add more
attribute, then I shut down the other tomcat instance and check for fail over, etc..etc..
 Everything works.

Then I do not shut down tomcat, just stop the examples webapp on that tomcat instance where
currently the session resides and try to add more session attribute.  Instead of failing over,
I receive a 404 error:

HTTP Status 404 - /examples/servlets/servlet/SessionExample
type Status report
message /examples/servlets/servlet/SessionExample
description The requested resource (/examples/servlets/servlet/SessionExample) is not available.
Apache Tomcat/7.0.10

My understanding is that the request should be rerouted to the other tomcat instance and present
the sessions from that machine, the same way when tomcat itself was stopped.  However that
is not what happenzzzz.

So the question is what do I miss in this process ?

Thanks ahead,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message