tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roy McMorran <>
Subject Session Replication in Cluster
Date Thu, 02 Apr 2009 14:59:23 GMT
Hello all,

I've built a very simple 2-member Tomcat cluster for testing, but I am 
unable to get the session replication quite right.  The problem is when 
I fail one member of the cluster.  The behavior I was expecting is that 
the other cluster member would take over the session ids for the failed 
member.  However it is appending it's own jvmRoute value to the session 
id, and thus setting a new cookie.

I have 2 cluster members, "itchy" and "scratchy", running on the same 
physical server, and CATALINA_BASE is /var/tomcat/itchy and 
/var/tomcat/scratchy respectively.  Tomcat 6.0.18 binaries, etc. are at 
/usr/local/tomcat.  Using mod_jk 1.2.27 on Apache 2.2.11 (Apache is also 
on the same server).  I am using sticky sessions.

Here are the access logs for the 2 members from a short "failover" 
experiment (note I'm including the session ID in the 2nd field).  The 
session starts on scratchy.  From scratchy_access_log.2009-04-02.txt: E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.scratchy - 
[02/Apr/2009:10:19:55 -0400] "GET / HTTP/1.1" 200 14612 E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.scratchy - 
[02/Apr/2009:10:20:14 -0400] "GET /about/ HTTP/1.1" 200 19507

At 10:21:39 AM I do a kill -9 on the scratchy instance.  Now the traffic 
goes to the other cluster member as expected.  From 
itchy_access_log.2009-04-02.txt: E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.itchy - 
[02/Apr/2009:10:22:11 -0400] "GET /about/publications/ HTTP/1.1" 200 18263 E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.itchy - 
[02/Apr/2009:10:22:32 -0400] "GET /about/changes/ HTTP/1.1" 200 12736

Note however that the new member's jvmRoute value is now appended to the 
session id.  I thought is was supposed to stay exactly the same after 

Additional details can be found as follows:

server.xml for "itchy" - see:

server.xml for "scratchy" - see:

context.xml (identical) - see:

I've also included the catalina.out file for both, from startup and 
through the test at:

I'd appreciate any advice on where I went wrong.  Thanks and best wishes,

Roy McMorran
Systems Administrator
MDI Biological Laboratory

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

View raw message