-
1. Re: Tomcat Session Replication in cluster
trackingroi.com Mar 16, 2005 10:52 AM (in response to trackingroi.com)Here is some additional informaiton:
jboss-web.xml<jboss-web> <replication-config> <replication-trigger>SET_AND_GET</replication-trigger> <replication-type>SYNC</replication-type> </replication-config> </jboss-web>
web.xml<web-app> <display-name>cluster</display-name> <distributable/> </web-app>
In server.log, I am seeing info relating to the session replication on the first machine, but no corresponding entries on the 2nd machine saying it received updates to the session or received the session at all (if it should??). Here is what machine 1 has in its log:2005-03-16 10:48:56,429 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] Session with id=44c+Sh1CNJge0RYt+M5mGw** added. Current active sessions 1 2005-03-16 10:48:56,429 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] Creating an ClusteredSession with id: 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:48:56,439 INFO [STDOUT] Test jsp: 1 : : 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:48:56,469 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] check to see if needs to store and replicate session with id 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:48:56,469 DEBUG [org.jboss.web.tomcat.tc5.session.ClusteredSession] processSessionRepl(): session is dirty. Will increment version from: 1 and replicate. 2005-03-16 10:48:59,573 INFO [STDOUT] Test jsp: 2 : : 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:48:59,573 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] check to see if needs to store and replicate session with id 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:48:59,573 DEBUG [org.jboss.web.tomcat.tc5.session.ClusteredSession] processSessionRepl(): session is dirty. Will increment version from: 2 and replicate. 2005-03-16 10:49:01,406 INFO [STDOUT] Test jsp: 3 : : 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:49:01,406 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] check to see if needs to store and replicate session with id 44c+Sh1CNJge0RYt+M5mGw** 2005-03-16 10:49:01,406 DEBUG [org.jboss.web.tomcat.tc5.session.ClusteredSession] processSessionRepl(): session is dirty. Will increment version from: 3 and replicate.
-
2. Re: Tomcat Session Replication in cluster
ben.wang Mar 16, 2005 8:46 PM (in response to trackingroi.com)You need a sw load balancer in front the tomcat server to do failover so they can keep the session id. Check out jboss wiki web site for http session clustering for the example setup.
-Ben -
3. Re: Tomcat Session Replication in cluster
trackingroi.com Mar 17, 2005 7:50 AM (in response to trackingroi.com)Thanks Ben! It hit me last night as I was trying to sleep... I think what was happening was that my session id cookie was not being passed to the 2nd node because I was manually changing the IP and the cookie was only stored in my browser for the first IP if I remember how cookies work... In other words, I had a jsp session id cookie stored in IE for host A that got sent to host a each time I made a request. Now when I change the IP manually, there is no cookie stored for host B in IE so it sends none. JBoss can't tell it's the same client b/c there is no cookie so it creates a new session. Is this right??
This morning I setup a software load balancer and it's working perfectly! The sessions replicate perfectly and at lightning speed!!! I am loving life again ;-)