Users who may attempt to configure this may run into issues when using more than one application server. This additional information is for the TC Server.
Resolution
In order to setup the clustering on TC Server, the notes in the Whitepaper should be carried out with the additional information as follows:
- For each TC Server Instance that will be a member of the cluster, update the server.xml with the following:
<Cluster className=”org.apache.catalina.ha.tcp.SimpleTcpCluster”
channelSendOptions=”8″>
<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=”45501″
frequency=”500″
dropTime=”3000″/>
<Receiver className=”org.apache.catalina.tribes.transport.nio.NioReceiver”
address=”auto”
port=”4000″
autoBind=”100″
selectorTimeout=”5000″
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=”.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt;”/>
<Deployer className=”org.apache.catalina.ha.deploy.FarmWarDeployer”
tempDir=”/u01/dmadmin/temp”
deployDir=”/u01/dmadmin/vfabric-tc-server/appServer/webapps”
watchDir=”/u01/dmadmin/watch”
watchEnabled=”true” />
<ClusterListener className=”org.apache.catalina.ha.session.ClusterSessionListener”/>
</Cluster>
- The context.xml should be updated as follows:
<?xml version=”1.0″?>
<Context antiJARLocking=”true” antiResourceLocking=”true” useHttpOnly=”false” distributable=”true”>
<!– Default set of monitored resources –>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!– Uncomment this to disable session persistence across Tomcat restarts –>
<!–
<Manager pathname=”” />
–>
<!– Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) –>
<!–
<Valve className=”org.apache.catalina.valves.CometConnectionManagerValve” />
–>
</Context>
- The following directories were required to be created:
- /u01/dmadmin/temp
- /u01/dmadmin/watch
- Before starting the TC Server, ensure that the war file that will be deployed does NOT exist in the /webapps or /watch directories on the server.
- Start the first TC Server and wait till it is completely started.
- Start the second TC Server and wait till it is completely started.
- Once both have started, you can test the cluster is working by placing a war file in the /watch folder.
- This should appear in the webapps folder on both servers.
- Remove the war file from the watch folder, and the war will be removed from the /webapps folder on each server.
- Now deploy the war using xMS. On the first run the war will appear in the /webapps and /watch folder.
- Upon second deployment, the war will be removed from the /watch and /webapps folder.
- You will need to do a third deployment to get the war file back again in the /watch and /webapps folders. Do not remove the *.war from the /watch folder as this will remove it from the /webapps folder.