0

There are 4 servers in the load balancer and Tomcat 5.5 is being used. The following points have been covered in setting up the Tomcat clustering, still the session replication is not happening properly.

  1. Session attributes have implemented java.io.Serializable
  2. Uncommented the Cluster element, Valve(ReplicationValve) element in server.xml
  3. Web.xml has the <distributable/> element
  4. <Engine name="Catalina" jvmRoute="node01"> set to unique values in all four servers.
  5. Loadbalancer is configured for sticky session mode.

    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
             managerClassName="org.apache.catalina.cluster.session.DeltaManager"
             expireSessionsOnShutdown="false"
             useDirtyFlag="true"
             notifyListenersOnReplication="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"
            ackTimeout="15000"/>
    
        <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>
    
Sébastien Le Callonnec
  • 23,877
  • 6
  • 58
  • 77
Shivayan
  • 127
  • 1
  • 2
  • 12

0 Answers0