tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachariah Zachariah <zk...@genome.stanford.edu>
Subject Re: Tomcat 6 Cluster Woes
Date Thu, 07 Aug 2008 19:16:03 GMT
Thanks Filip. I found that changing the Host name to localhost from the 
actual node names made it to work properly. So in my case z2 and z3 were 
the actual node names that the OS (Solaris) knew them to be. I changed 
Engine and Host elements of the server.xml in these nodes  to point to 
localhost. Then replication worked just fine. I could test it with the 
Session examples application and persist the session variables accross a 
failover process.

However, now I find that when I take down a node I get the following 
error logged in my catalina.out:

INFO: Manager [localhost#/manager] expiring sessions upon shutdown
Aug 7, 2008 12:03:26 PM 
org.apache.catalina.tribes.membership.McastServiceImpl$ReceiverThread run
WARNING: Error receiving mcast package. Sleeping 500ms
java.io.InterruptedIOException: operation interrupted
        at java.net.PlainDatagramSocketImpl.receive0(Native Method)
        at 
java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
        at java.net.DatagramSocket.receive(DatagramSocket.java:712)
        at 
org.apache.catalina.tribes.membership.McastServiceImpl.receive(McastServiceImpl.java:278)
        at 
org.apache.catalina.tribes.membership.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:366)
Aug 7, 2008 12:03:26 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080

It happens only when I bring down any of the two nodes. Is this 
something to be concerned about? I don't see any thing wrong with the 
session variables. They are all still alive when the failover node takes 
over.

Thanks  in advance  for any insight into this.

--Zac

Filip Hanik - Dev Lists wrote:
> have you by any chance deployed your apps in <Host> elements with a 
> different name?
>
> Filip
>
> Zachariah Zachariah wrote:
>> Hi,
>>
>> I am trying to set up a cluster of tomcat servers to serve up my 
>> dynamic content with session replication. Although failover seems to 
>> be working with each node aware of the other, Session replication 
>> does not work quite as expected. I get the error "WARNING: Context 
>> manager doesn't exist" warning. For testing I use the Sessions 
>> example in the examples web application of the tomcat distribtion. 
>> Although I see session variables created through one node the other 
>> node does not receive the variables.
>>
>> Here is how I have set up the nodes:
>>
>> Zither: NFS server serving apache/tomcat binaries and config files
>> Z2: node1 running Apache 2.2 and Tomcat 6
>> Z3: node2 running Apache 2.2 and Tomcat 6
>>
>> Load balancer: mod_jk
>> CATALINA_BASE: /usr/local/tomcat/<node name>
>> CATALINA_HOME: /usr/local/tomcat
>>
>> Each node has its own config and logs directory under CATALINA_BASE
>>
>> My server.xml file with cluser section shown:
>>
>> / <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
>> channelSendOptions="8">
>> <!--
>> <Manager className="org.apache.catalina.ha.session.BackupManager"
>> expireSessionsOnShutdown="false"
>> notifyListenersOnReplication="true"
>> mapSendOptions="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="z2"
>> 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;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/> 
>>
>> <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
>>
>> <!--
>> <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.JvmRouteSessionIDBinderListener"/> 
>>
>> <ClusterListener 
>> className="org.apache.catalina.ha.session.ClusterSessionListener"/>
>> </Cluster>/
>>
>>
>>
>> Here are the snippets from the Catalina.out log files of Z1 and Z2
>>
>> From NODE Z2
>>
>> /Aug 1, 2008 12:09:11 PM org.apache.catalina.ha.session.DeltaManager 
>> start
>> INFO: Starting clustering manager at /manager
>> Aug 1, 2008 12:09:11 PM org.apache.catalina.ha.session.DeltaManager 
>> getAllClusterSessions
>> INFO: Manager [z2#/manager]: skipping state transfer. No members 
>> active in cluster group.
>> Aug 1, 2008 12:09:11 PM 
>> org.apache.catalina.ha.session.JvmRouteBinderValve start
>> INFO: JvmRouteBinderValve started
>> Aug 1, 2008 12:09:11 PM org.apache.coyote.http11.Http11Protocol start
>> INFO: Starting Coyote HTTP/1.1 on http-8080
>> Aug 1, 2008 12:09:11 PM org.apache.jk.common.ChannelSocket init
>> INFO: JK: ajp13 listening on /0.0.0.0:8009
>> Aug 1, 2008 12:09:11 PM org.apache.jk.server.JkMain start
>> INFO: Jk running ID=0 time=0/34 config=null
>> Aug 1, 2008 12:09:11 PM org.apache.catalina.startup.Catalina start
>> INFO: Server startup in 3552 ms
>> Aug 1, 2008 12:13:25 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
>> Aug 1, 2008 12:13:25 PM org.apache.catalina.ha.tcp.SimpleTcpCluster 
>> memberAdded
>> INFO: Replication member 
>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://z3:5000,z3,5000, 
>> alive=1015,id={111 -85 -38 -109 -29 -125 69 -7
>> 1 -118 121 71 35 86 80 86 20 }, payload={}, command={}, domain={}, ]
>> Aug 1, 2008 12:13:27 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/TestWebApp
>> Aug 1, 2008 12:14:27 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/examples
>> Aug 1, 2008 12:15:27 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/CVS
>> Aug 1, 2008 12:16:27 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/manager
>> Aug 1, 2008 5:20:09 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/examples
>> Aug 1, 2008 5:20:29 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/examples
>> Aug 1, 2008 5:21:12 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/examples
>> Aug 1, 2008 5:51:47 PM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z3#/examples
>> Aug 4, 2008 9:33:52 AM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> sessionCreated('F3BFE5345E7EE26DEA2409E01B06BE0A.z2')
>> Aug 4, 2008 9:33:52 AM 
>> 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.07 MB/sec (total)
>> TxSpeed:0.07 MB/sec (application)
>> Error Msg:0
>> Rx Msg:9 messages
>> Rx Speed:0.00 MB/sec (since 1st msg)
>> Received:0.00 MB]/
>>
>>
>>
>> FROM NODE Z3 (session variables are created through this node)
>>
>> /Aug 1, 2008 12:13:23 PM org.apache.catalina.ha.tcp.SimpleTcpCluster 
>> setProperty
>> WARNING: Dynamic setProperty(className,value) has been disabled, 
>> please use explicit properties for the element you are trying to 
>> identify
>> Aug 1, 2008 12:13:24 PM org.apache.coyote.http11.Http11Protocol init
>> INFO: Initializing Coyote HTTP/1.1 on http-8080
>> Aug 1, 2008 12:13:24 PM org.apache.catalina.startup.Catalina load
>> INFO: Initialization processed in 1099 ms
>> Aug 1, 2008 12:13:24 PM org.apache.catalina.users.MemoryUserDatabase 
>> save
>> WARNING: User database is not persistable - no write permissions on 
>> directory
>> Aug 1, 2008 12:13:24 PM org.apache.catalina.core.StandardService start
>> INFO: Starting service Catalina
>> Aug 1, 2008 12:13:24 PM org.apache.catalina.core.StandardEngine start
>> INFO: Starting Servlet Engine: Apache Tomcat/6.0-snapshot
>> Aug 1, 2008 12:13:24 PM org.apache.catalina.ha.tcp.SimpleTcpCluster 
>> start
>> INFO: Cluster is about to start
>> Aug 1, 2008 12:13:24 PM 
>> org.apache.catalina.tribes.transport.ReceiverBase bind
>> INFO: Receiver Server Socket bound to:z3/192.168.0.3:5000
>> Aug 1, 2008 12:13:24 PM 
>> org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>> INFO: Setting cluster mcast soTimeout to 500
>> Aug 1, 2008 12:13:24 PM 
>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>> INFO: Sleeping for 1000 milliseconds to establish cluster membership, 
>> start level:4
>> Aug 1, 2008 12:13:25 PM org.apache.catalina.ha.tcp.SimpleTcpCluster 
>> memberAdded
>> INFO: Replication member 
>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://z2:5000,z2,5000, 
>> alive=256519,id={-99 -73 116 5 29 -120 69 124
>> -70 106 64 -72 -2 -118 -116 96 }, payload={}, command={}, domain={}, ]
>> Aug 1, 2008 12:13:25 PM 
>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>> INFO: Done sleeping, membership established, start level:4
>> Aug 1, 2008 12:13:25 PM 
>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>> INFO: Sleeping for 1000 milliseconds to establish cluster membership, 
>> start level:8
>> Aug 1, 2008 12:13:25 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
>> Aug 1, 2008 12:13:26 PM 
>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>> INFO: Done sleeping, membership established, start level:8
>> Aug 1, 2008 12:13:27 PM org.apache.catalina.ha.session.DeltaManager 
>> start
>> INFO: Register manager /TestWebApp to cluster element Engine with 
>> name Catalina
>> Aug 1, 2008 12:13:27 PM org.apache.catalina.ha.session.DeltaManager 
>> start
>> INFO: Starting clustering manager at /TestWebApp
>> Aug 1, 2008 12:13:27 PM org.apache.catalina.ha.session.DeltaManager 
>> getAllClusterSessions
>> WARNING: Manager [z3#/TestWebApp], requesting session state from 
>> org.apache.catalina.tribes.membership.MemberImpl[tcp://z2:5000,z2,5000, 
>> alive=258559
>> ,id={-99 -73 116 5 29 -120 69 124 -70 106 64 -72 -2 -118 -116 96 }, 
>> payload={}, command={}, domain={}, ]. This operation will timeout if 
>> no session s
>> tate has been received within 60 seconds.
>> Aug 1, 2008 12:13:27 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.07 MB/sec (total)
>> TxSpeed:0.07 MB/sec (application)
>> Error Msg:0
>> Rx Msg:1 messages
>> Rx Speed:0.00 MB/sec (since 1st msg)
>> Received:0.00 MB]
>> :$
>> SEVERE: Manager [z3#/manager]: No session state send at 8/1/08 12:16 
>> PM received, timing out after 60,007 ms.
>> Aug 1, 2008 12:17:27 PM 
>> org.apache.catalina.ha.session.JvmRouteBinderValve start
>> INFO: JvmRouteBinderValve started
>> Aug 1, 2008 12:17:27 PM org.apache.coyote.http11.Http11Protocol start
>> INFO: Starting Coyote HTTP/1.1 on http-8080
>> Aug 1, 2008 12:17:28 PM org.apache.jk.common.ChannelSocket init
>> INFO: JK: ajp13 listening on /0.0.0.0:8010
>> Aug 1, 2008 12:17:28 PM org.apache.jk.server.JkMain start
>> INFO: Jk running ID=0 time=0/34 config=null
>> Aug 1, 2008 12:17:28 PM org.apache.catalina.startup.Catalina start
>> INFO: Server startup in 243934 ms
>> Aug 1, 2008 5:20:09 PM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> sessionCreated('949E5DEEB498834B9312D3076C2687CE.z3')
>> Aug 1, 2008 5:20:29 PM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> attributeAdded('949E5DEEB498834B9312D3076C2687CE.z3', 'zkzac', '123')
>> Aug 1, 2008 5:21:12 PM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> attributeAdded('949E5DEEB498834B9312D3076C2687CE.z3', 'bob', '321')
>> Aug 1, 2008 5:51:47 PM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> sessionDestroyed('949E5DEEB498834B9312D3076C2687CE.z3')
>> Aug 1, 2008 5:51:47 PM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> attributeRemoved('949E5DEEB498834B9312D3076C2687CE.z3', 'bob', '321')
>> Aug 1, 2008 5:51:47 PM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: 
>> attributeRemoved('949E5DEEB498834B9312D3076C2687CE.z3', 'zkzac', '123')
>> Aug 4, 2008 9:33:52 AM 
>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>> WARNING: Context manager doesn't exist:z2#/examples
>>
>>
>>
>>
>>
>> /
>>
>> I would be very grateful is someone who have set up a working cluster 
>> on Tomcat 6 throw some light on where I could have gone wrong.
>>
>> Thanks much.
>>
>> --Zac
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message