0

I have a task of clustering web-service in order not to stop processing requests while deploing updates.

I developed test model including Apache2.4 server, mod_jk and two Tocat6 workers. Test model with all it's components are on single machine. Configuration I used is the most simple.

Test model works fine. And I can see that both workers are aware of each other states, and there no problem to users while I'm deploying updates.

The model we prepare for production includes two machines:

  1. Apache2.4, mod_jk, Tomcat(Worker1)
  2. Tomcat (Worker2)

I have changed configuration a little and production model stated work like test model except one detail.

It seems to me that in production model both workers (on different machines) are not aware of each other's existence. And no session replications ocures. My workers logs contains records like this

No members active in cluster group
SEVERE: FarmWarDeployer can only work as host cluster subelement!

while I know for sure that both Tomcats running.

server.xml(worker1) includes Cluster section like this

<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">

   <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
            <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="4000" 
                          tcpListenPort="4007"
                          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"/>
           </Channel>

            <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" 
                   filter=""/>
            <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>      

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
         resourceName="UserDatabase"/>

        <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

        </Host>
    </Engine>

server.xml(worker2) have difference only in port numbers

    <Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">
       <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
            <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="4000" 
                              tcpListenPort="4006"
                              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"/>

            </Channel>

            <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" 
                   filter=""/>
            <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>

  <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
         resourceName="UserDatabase"/>
  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
  </Host>
</Engine>

My question is: how to configure my production model properly? All the samples I have find used the model equal to my test model.

chum
  • 1
  • 1

0 Answers0