Hi,
We started working on our next generation platform project.
One of our requirement is to have session replication via tomcat clustering.
We have managed to set up a cluster with replication when the tomcats
(7.0.47) were both on the SAME machine as a POC.
Now as we are setting up the production configuration... (one tomcat is on
server "10.0.110.44" and the other "10.0.110.45")
We are having the following issues:
*When we try to configure the both tomcats with the delta manager, we use
this server.xml in both of them:*
.. / default configuration here ../
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="6">
<Manager className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
<Channel
className="org.apache.catalina.tribes.group.GroupChannel">
<Membership
className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
port="45564"
frequency="500"
dropTime="3000"/>
<Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto"
port="5000"
selectorTimeout="100"
maxThreads="6"/>
<Sender
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<Transport
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
</Sender>
<Interceptor
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
<Interceptor
className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
<Interceptor
className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
</Channel>
<Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.css|.*\.txt"/>
<Deployer
className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
<ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
*This configuration fails to replicate sessions and the error we get in the
logs :*
INFO: Cluster is about to start
Dec 16, 2013 6:42:26 PM org.apache.catalina.tribes.transport.ReceiverBase
bind
INFO: Receiver Server Socket bound to:/127.0.1.1:5000
Dec 16, 2013 6:42:26 PM
org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 500
Dec 16, 2013 6:42:26 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start
level:4
Dec 16, 2013 6:42:27 PM org.apache.catalina.ha.tcp.SimpleTcpCluster
memberAdded
INFO: Replication member
added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1,
1}:5000,{127, 0, 1, 1},5000, alive=2516, securePort=-1, UDP Port=-1,
id={-90 41 -113 110 96 -50 78 -88 -79 -103 1 61 -60 -125 75 44 },
payload={}, command={}, domain={}, ]
Dec 16, 2013 6:42:27 PM org.apache.catalina.tribes.io.BufferPool
getBufferPool
INFO: Created a buffer pool with max size:104857600 bytes of
type:org.apache.catalina.tribes.io.BufferPool15Impl
Dec 16, 2013 6:42:27 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:4
Dec 16, 2013 6:42:27 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start
level:8
Dec 16, 2013 6:42:28 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:8
Dec 16, 2013 6:42:28 PM org.apache.catalina.ha.deploy.FarmWarDeployer start
INFO: Cluster FarmWarDeployer started.
Dec 16, 2013 6:42:28 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/HATest.war
Dec 16, 2013 6:42:29 PM org.apache.catalina.ha.session.DeltaManager
startInternal
INFO: Register manager /HATest to cluster element Host with name localhost
Dec 16, 2013 6:42:29 PM org.apache.catalina.ha.session.DeltaManager
startInternal
INFO: Starting clustering manager at /HATest
Dec 16, 2013 6:42:29 PM
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor report
INFO: ThroughputInterceptor Report[
Tx Msg:1 messages
Sent:0.00 MB (total)
Sent:0.00 MB (application)
Time:0.01 seconds
Tx Speed:0.04 MB/sec (total)
TxSpeed:0.04 MB/sec (application)
Error Msg:0
Rx Msg:2 messages
Rx Speed:0.00 MB/sec (since 1st msg)
Received:0.00 MB]
Dec 16, 2013 6:42:29 PM org.apache.catalina.ha.session.DeltaManager
getAllClusterSessions
INFO: Manager [/HATest], requesting session state from
org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1,
1}:5000,{127, 0, 1, 1},5000, alive=4517, securePort=-1, UDP Port=-1,
id={-90 41 -113 110 96 -50 78 -88 -79 -103 1 61 -60 -125 75 44 },
payload={}, command={}, domain={}, ]. This operation will timeout if no
session state has been received within 60 seconds.
Dec 16, 2013 6:43:29 PM org.apache.catalina.ha.session.DeltaManager
waitForSendAllSessions
SEVERE: Manager [/HATest]: No session state send at 12/16/13 6:42 PM
received, timing out after 60,102 ms.
Dec 16, 2013 6:43:29 PM org.apache.catalina.ha.session.DeltaManager
getAllClusterSessions
WARNING: Manager [/HATest]: Drop message SESSION-GET-ALL inside
GET_ALL_SESSIONS sync phase start date 12/16/13 6:42 PM message date 1/1/70
2:00 AM
Dec 16, 2013 6:43:29 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/docs
Dec 16, 2013 6:43:29 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/host-manager
Dec 16, 2013 6:43:29 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/ROOT
Dec 16, 2013 6:43:29 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/examples
Dec 16, 2013 6:43:30 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/manager
Dec 16, 2013 6:43:30 PM org.apache.catalina.ha.session.DeltaManager
startInternal
INFO: Register manager /manager to cluster element Host with name localhost
Dec 16, 2013 6:43:30 PM org.apache.catalina.ha.session.DeltaManager
startInternal
INFO: Starting clustering manager at /manager
Dec 16, 2013 6:43:30 PM org.apache.catalina.ha.session.DeltaManager
getAllClusterSessions
INFO: Manager [/manager], requesting session state from
org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1,
1}:5000,{127, 0, 1, 1},5000, alive=65057, securePort=-1, UDP Port=-1,
id={-90 41 -113 110 96 -50 78 -88 -79 -103 1 61 -60 -125 75 44 },
payload={}, command={}, domain={}, ]. This operation will timeout if no
session state has been received within 60 seconds.
Dec 16, 2013 6:44:16 PM
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector
memberDisappeared
INFO: Verification complete. Member
disappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0,
1, 1}:5000,{127, 0, 1, 1},5000, alive=112037, securePort=-1, UDP Port=-1,
id={-90 41 -113 110 96 -50 78 -88 -79 -103 1 61 -60 -125 75 44 },
payload={}, command={66 65 66 89 45 65 76 69 88 ...(9)}, domain={}, ]]
Dec 16, 2013 6:44:16 PM org.apache.catalina.ha.tcp.SimpleTcpCluster
memberDisappeared
INFO: Received member
disappeared:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0,
1, 1}:5000,{127, 0, 1, 1},5000, alive=112037, securePort=-1, UDP Port=-1,
id={-90 41 -113 110 96 -50 78 -88 -79 -103 1 61 -60 -125 75 44 },
payload={}, command={66 65 66 89 45 65 76 69 88 ...(9)}, domain={}, ]
Dec 16, 2013 6:44:22 PM org.apache.catalina.ha.tcp.SimpleTcpCluster
memberAdded
INFO: Replication member
added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1,
1}:5000,{127, 0, 1, 1},5000, alive=1014, securePort=-1, UDP Port=-1, id={75
3 86 -1 25 78 67 111 -125 -65 74 58 79 -20 93 16 }, payload={}, command={},
domain={}, ]
Dec 16, 2013 6:44:30 PM org.apache.catalina.ha.session.DeltaManager
waitForSendAllSessions
SEVERE: Manager [/manager]: No session state send at 12/16/13 6:43 PM
received, timing out after 60,081 ms.
Dec 16, 2013 6:44:30 PM org.apache.catalina.ha.session.DeltaManager
getAllClusterSessions
WARNING: Manager [/manager]: Drop message SESSION-GET-ALL inside
GET_ALL_SESSIONS sync phase start date 12/16/13 6:43 PM message date 1/1/70
2:00 AM
Dec 16, 2013 6:44:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 16, 2013 6:44:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 16, 2013 6:44:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 123619 ms
*When we try to configure the Backup manager (which is my goal actually)
with the same server.xml only with backup manager tag:*
<Manager className="org.apache.catalina.ha.session.BackupManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"
mapSendOptions="6"/>
*We get the following log (again, no replication):*
INFO: Cluster is about to start
Dec 16, 2013 6:56:40 PM org.apache.catalina.tribes.transport.ReceiverBase
bind
INFO: Receiver Server Socket bound to:/127.0.1.1:5000
Dec 16, 2013 6:56:40 PM
org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 500
Dec 16, 2013 6:56:40 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start
level:4
Dec 16, 2013 6:56:40 PM org.apache.catalina.ha.tcp.SimpleTcpCluster
memberAdded
INFO: Replication member
added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1,
1}:5000,{127, 0, 1, 1},5000, alive=23027, securePort=-1, UDP Port=-1,
id={52 -40 0 -117 -60 82 71 -42 -110 21 -91 -16 88 -96 -46 -113 },
payload={}, command={}, domain={}, ]
Dec 16, 2013 6:56:41 PM org.apache.catalina.tribes.io.BufferPool
getBufferPool
INFO: Created a buffer pool with max size:104857600 bytes of
type:org.apache.catalina.tribes.io.BufferPool15Impl
Dec 16, 2013 6:56:41 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:4
Dec 16, 2013 6:56:41 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start
level:8
Dec 16, 2013 6:56:42 PM
org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:8
Dec 16, 2013 6:56:42 PM org.apache.catalina.ha.deploy.FarmWarDeployer start
INFO: Cluster FarmWarDeployer started.
Dec 16, 2013 6:56:42 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/HATest.war
Dec 16, 2013 6:56:43 PM
org.apache.catalina.tribes.tipis.AbstractReplicatedMap init
INFO: Initializing AbstractReplicatedMap with context name:/HATest-map
Dec 16, 2013 6:56:43 PM
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor report
INFO: ThroughputInterceptor Report[
Tx Msg:1 messages
Sent:0.00 MB (total)
Sent:0.00 MB (application)
Time:0.01 seconds
Tx Speed:0.09 MB/sec (total)
TxSpeed:0.09 MB/sec (application)
Error Msg:0
Rx Msg:2 messages
Rx Speed:0.00 MB/sec (since 1st msg)
Received:0.00 MB]
Dec 16, 2013 6:56:43 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/docs
Dec 16, 2013 6:56:43 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/host-manager
Dec 16, 2013 6:56:43 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/ROOT
Dec 16, 2013 6:56:43 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/examples
Dec 16, 2013 6:56:44 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/usr/local/tomcat7/apache-tomcat-7.0.47/webapps/manager
Dec 16, 2013 6:56:44 PM
org.apache.catalina.tribes.tipis.AbstractReplicatedMap init
INFO: Initializing AbstractReplicatedMap with context name:/manager-map
Dec 16, 2013 6:56:44 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 16, 2013 6:56:44 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 16, 2013 6:56:44 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3535 ms
*It appears there are no severe errors on the log file with the backup
manager setup, but still we got no replication going.*
*Of course we added the *<distributable/>
*tag to both our web.xml of the tomcats AND for the WAR's web.xml as well.*
*Any ideas why this is happening? *
Regards and many thanks,
NGT.