tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Whiteside <...@larts.co.uk>
Subject Session replication not working
Date Wed, 26 Jan 2005 20:52:13 GMT
Hi!

I'm trying to get two tomcat servers to replicate their sessions with 
each other.

We have a BigIP load balancer connecting to two Redhat Linux Enterprise 
3 servers running Tomcat only (no Apache).

I've uncommented the Cluster and Replication valve sections in 
server.xml, added <distributable> to my web.xml and ensured that all 
session variables implement java.io.Serializable.

I've also configured a PersistentManager to store Sessions via JDBCStore 
in a database.

Here are the relevent configuration bits:

from server.xml:

       <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                 
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                 expireSessionsOnShutdown="false"
                 useDirtyFlag="true">

            <Membership
                className="org.apache.catalina.cluster.mcast.McastService"
                mcastAddr="228.0.0.4"
                mcastPort="45564"
                mcastFrequency="500"
                mcastDropTime="3000"/>

            <Receiver
                
className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="auto"
                tcpListenPort="4001"
                tcpSelectorTimeout="100"
                tcpThreadCount="6"/>

            <Sender
                
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                replicationMode="pooled"/>

            <Valve 
className="org.apache.catalina.cluster.tcp.ReplicationValve"
                   
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>

            <Deployer 
className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                      tempDir="/tmp/war-temp/"
                     deployDir="/tmp/war-deploy/"
                      watchDir="/tmp/war-listen/"
                      watchEnabled="false"/>
        </Cluster>

Here is the PersistentManager in the server.xml like this:

<Manager className="org.apache.catalina.session.PersistentManager" 
debug="0" saveOnRestart="true" maxActiveSessions="-1" minIdleSwap="-1" 
maxIdleSwap="0" maxIdleBackup="0">
<Store className="org.apache.catalina.session.JDBCStore"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://10.0.0.24/tomcat?user=x&amp;password=x"
sessionTable="tomcat_sessions"
sessionIdCol="session_id"
sessionValidCol="valid_session"
sessionMaxInactiveCol="max_inactive"
sessionLastAccessedCol="last_access"
sessionAppCol="app_name"
sessionDataCol="session_data"
checkInterval="60"
debug="99" />

I am able to ping 228.0.0.4 with the response:

64 bytes from 10.0.0.52: icmp_seq=0 ttl=64 time=0.028 ms
64 bytes from 10.0.0.51: icmp_seq=0 ttl=64 time=0.490 ms (DUP!)

10.0.0.52 and 10.0.0.51 are the two servers running Tomcat.

However, when I start the servers, I get the following message in 
catalina.out for both servers.

Creating ClusterManager for context /tunetribe using class 
org.apache.catalina.cluster.session.DeltaManager
26-Jan-2005 19:13:29 org.apache.catalina.cluster.session.DeltaManager start
INFO: Starting clustering manager...:/tunetribe
26-Jan-2005 19:13:29 org.apache.catalina.cluster.session.DeltaManager start
INFO: Manager[/tunetribe], skipping state transfer. No members active in 
cluster group.

I get no further messages after this, the sessions are not replicating 
correctly.

The session ids are being correctly picked up, and when the sessions get 
loaded from the database they are in sync, but when they are modified in 
memory and not yet saved, they are different on each server.

Can anyone suggest how I can get the servers to recognise each other?

Regards,

Simon

-- 
Simon Whiteside                  
Lateral Arts Limited

Clients include: 
Tunetribe.com, The Times and Sunday Times Newspapers, 
Incisive Media, Wigmore Hall, Photobox.com, SOSplc.com

Registered Office: 19 Allenby Road, Forest Hill, London SE23 2RQ 
Registered in England and Wales. Company Number: 3055039 
http://www.larts.co.uk

Blog: http://miro.larts.co.uk/blog
Skype: callto://swhiteside




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message