tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niki Diulgerov <ndiulge...@imx.fr>
Subject clustering mode in apache tomcat 5.5.25
Date Thu, 15 Nov 2007 16:08:25 GMT
Hello friends,
I read a lot in internet, connected to #tomcat irc channel but still no 
help (except one user in irc who told me in this mailing list there are 
very nice people).
So my problem is that I'm trying to use 2 tomcats in clustering mode.
I installed standard tomcat 5.5.25 downloaded from the official site.
The operating systems are RHEL4 and Open SuSE10.2
I have setenv.sh
JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:PermSize=512m 
-XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError"
CATALINA_OPTS="-Dlogs.root=/extranet/logs -Dwas.install.root=/extranet"
JAVA_HOME=/jdk1.5.0_13
ENCODING=utf-8

Java version jdk1.5.0_13 (I tried with java 1.4 and the compat package 
for tomcat 5.5.25 but still the same)
I changed only server.xml file on both machines. Here is how it looks like:

<Server                 port="8011"
                       shutdown="SHUTDOWN" >
    <GlobalNamingResources>
    <Resource              name="UserDatabase" auth="Container"
                           type="org.apache.catalina.UserDatabase"
                    description="User database that can be updated and 
saved"
                        
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                        pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
    <Service              name="Catalina">
        <Connector        port="9012"
                      protocol="AJP/1.3" />
        <Connector         port="9013"
                     maxThreads="100"
                minSpareThreads="4"
                maxSpareThreads="4"
        />
        <Engine            name="Catalina"
                   defaultHost="localhost"
                        jvmRoute="node01">
        <Realm        
className="org.apache.catalina.realm.UserDatabaseRealm"
                   resourceName="UserDatabase" />
            <Host          name="localhost"
                        appBase="webapps">
                <Cluster                  
className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                                       doClusterLog="true"
                                     clusterLogName="clusterlog"
                                  
manager.className="org.apache.catalina.cluster.session.DeltaManager"
                   manager.expireSessionsOnShutdown="false"
               manager.notifyListenersOnReplication="false"
        manager.notifySessionListenersOnReplication="false"
                            manager.sendAllSessions="false"
                        manager.sendAllSessionsSize="500"
                    manager.sendAllSessionsWaitTime="20">
                  <Membership
                                          
className="org.apache.catalina.cluster.mcast.McastService"
                                          mcastAddr="228.0.0.4"
                                   mcastBindAddress="127.0.0.1"
                                 mcastClusterDomain="d10"
                                          mcastPort="45564"
                                     mcastFrequency="1000"
                                      mcastDropTime="30000"
                                    recoveryCounter="10"
                                    recoveryEnabled="true"
                                  recoverySleepTime="5000"/>        
                  <Receiver
                                           
className="org.apache.catalina.cluster.tcp.ReplicationListener"
                                    tcpListenAddress="auto"
                                       tcpListenPort="9015"
                                  tcpSelectorTimeout="100"
                                      tcpThreadCount="6"/>
                  <Sender
                                           
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                                     replicationMode="fastasyncqueue"
                                      recoverTimeout="5000"
                                      recoverCounter="6"
                        doTransmitterProcessingStats="true"
                                   doProcessingStats="true"
                                      doWaitAckStats="true"
                                       queueTimeWait="true"
                                        queueDoStats="true"
                                      queueCheckLock="true"
                                          ackTimeout="15000"
                                          waitForAck="true"
                                    keepAliveTimeout="80000"
                            keepAliveMaxRequestCount="-1"/>
                  <Valve                   
className="org.apache.catalina.cluster.tcp.ReplicationValve"
                                              
filter=".*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"
                                    primaryIndicator="true" />
                  <Valve                    
className="org.apache.catalina.cluster.session.JvmRouteBinderValve"
                                             enabled="true" />   
                  <ClusterListener         
className="org.apache.catalina.cluster.session.ClusterSessionListener" />
                  <ClusterListener         
className="org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener" 
/>
                  <Deployer                
className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                                            
tempDir="${catalina.base}/war-temp"
                                          
deployDir="${catalina.base}/war-deploy/"
                                           
watchDir="${catalina.base}/war-listen/"
                                       watchEnabled="true"/>
                  </Cluster>
            </Host>
        </Engine>
    </Service>
</Server>

I changed only mcastBindAddress="127.0.0.1"
on both machines and replaced 127.0.0.1 with the appropriate IP address 
of any of these machines.
everything else was the same. (Here I'm not sure if I should use the 
same jvmRoute on both machines)

The problem is that in the catalina.out I have
WARNING: Error receiving mcast package (errorCounter=10). Try Recovery!
java.net.SocketTimeoutException: Receive timed out
        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.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:238)
        at 
org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:330)
Nov 15, 2007 5:22:33 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$RecoveryThread run
INFO: Cluster membership, running recovery thread, multicasting is not 
functional.
Nov 15, 2007 5:22:33 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$SenderThread run
WARNING: Sender Thread ends with errorCounter=0.
Nov 15, 2007 5:22:34 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread run
WARNING: Receiver Thread ends with errorCounter=1.
Nov 15, 2007 5:22:35 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/192.9.202.166
Nov 15, 2007 5:22:35 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 1000
Nov 15, 2007 5:22:35 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$RecoveryThread run
INFO: Membership recovery was successful.
Nov 15, 2007 5:22:43 PM org.apache.catalina.cluster.deploy.WarWatcher check
INFO: check cluster wars at /extranet/tomcat/war-listen
Nov 15, 2007 5:22:55 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread run
WARNING: Error receiving mcast package (errorCounter=10). Try Recovery!
java.net.SocketTimeoutException: Receive timed out
        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.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:238)
        at 
org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:330)
Nov 15, 2007 5:22:55 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$RecoveryThread run
INFO: Cluster membership, running recovery thread, multicasting is not 
functional.
Nov 15, 2007 5:22:55 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$SenderThread run
WARNING: Sender Thread ends with errorCounter=0.
Nov 15, 2007 5:22:56 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread run
WARNING: Receiver Thread ends with errorCounter=1.
Nov 15, 2007 5:22:57 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/192.9.202.166
Nov 15, 2007 5:22:57 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 1000
Nov 15, 2007 5:22:57 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$RecoveryThread run
INFO: Membership recovery was successful.
Nov 15, 2007 5:23:03 PM org.apache.catalina.cluster.deploy.WarWatcher check
INFO: check cluster wars at /extranet/tomcat/war-listen
Nov 15, 2007 5:23:17 PM 
org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread run


Please help.



-- 
Best regards,

Nikolay Diulgerov



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message