Hi all, I tried to create a cluster two hosts. At which I did not succeeded completely.
OS(both systems):
SMP Debian 3.16.7
java (both systems):
martijn@bloemkool:~/apache-tomcat-8.0.26/conf$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
Tomcat (both systems):
Apache Tomcat/8.0.26
I installed 2 tomcat's
One on host bloemkool.bos.
The server.xml:
---------------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<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="8080" protocol="HTTP/1.1" connectionTimeout="20000"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="bloemkool.bos"
jvmRoute="bloemkoolRoute">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="bloemkool.bos" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<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="45564"
frequency="500"
dropTime="3000"/>
<Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="192.168.2.123"
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=""/>
<Valve
className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
<Deployer
className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="${catalina.base}/webapps"
watchDir="/tmp/war-listen/"
watchEnabled="true"/>
<ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
---------------------------------------------
And one on broccoli.bos.
The server.xml:
---------------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<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="8080" protocol="HTTP/1.1" connectionTimeout="20000"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="broccoli.bos"
jvmRoute="broccoliRoute">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="broccoli.bos" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<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="45564"
frequency="500"
dropTime="3000"/>
<Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="192.168.2.124"
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=""/>
<Valve
className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
<Deployer
className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="${catalina.base}/webapps"
watchDir="/tmp/war-listen/"
watchEnabled="true"/>
<ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
---------------------------------------------
I see some communication between the nodes, which indicates to me that a
lot is going OK.
However, if I deploy a webapp on one host, I'll get a warning on the
other host and the webapp will not be deployed:
Logging from the host on which I deploy:
---------------------------------------------
08-Sep-2015 12:55:35.144 INFO [http-nio-8080-exec-9]
org.apache.catalina.startup.HostConfig.deployWAR Deploying web
application archive /home/martijn/apache-tomcat-8.0.26/webapps/hw2.war
08-Sep-2015 12:55:35.291 WARNING [http-nio-8080-exec-9]
org.apache.catalina.startup.SetContextPropertiesRule.begin
[SetContextPropertiesRule]{Context} Setting property 'antiJARLocking' to
'true' did not find a matching property.
08-Sep-2015 12:55:35.576 INFO [http-nio-8080-exec-9]
org.apache.catalina.ha.session.DeltaManager.startInternal Register
manager /hw2 to cluster element Host with name bloemkool.bos
08-Sep-2015 12:55:35.577 INFO [http-nio-8080-exec-9]
org.apache.catalina.ha.session.DeltaManager.startInternal Starting
clustering manager at /hw2
08-Sep-2015 12:55:35.736 INFO [http-nio-8080-exec-9]
org.apache.catalina.ha.session.DeltaManager.getAllClusterSessions
Manager [/hw2], requesting session state from
org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 2,
124}:4000,{192, 168, 2, 124},4000, alive=210612, securePort=-1, UDP
Port=-1, id={-43 -36 -16 -70 71 113 74 112 -79 39 -47 -84 51 -124 72 -70
}, payload={}, command={}, domain={}, ]. This operation will timeout if
no session state has been received within 60 seconds.
08-Sep-2015 12:55:35.857 WARNING [http-nio-8080-exec-9]
org.apache.catalina.ha.session.DeltaManager.waitForSendAllSessions
Manager [/hw2]: No context manager send at 9/8/15 12:55 PM received in
260 ms.
08-Sep-2015 12:55:35.867 INFO [http-nio-8080-exec-9]
org.apache.catalina.startup.HostConfig.deployWAR Deployment of web
application archive /home/martijn/apache-tomcat-8.0.26/webapps/hw2.war
has finished in 722 ms
08-Sep-2015 12:55:35.867 INFO [http-nio-8080-exec-9]
org.apache.catalina.core.ApplicationContext.log HTMLManager: list:
Listing contexts for virtual host 'bloemkool.bos'
---------------------------------------------
And logging from the host which fails:
---------------------------------------------
08-Sep-2015 12:55:35.789 WARNING [Tribes-Task-Receiver-3]
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived
Context manager doesn't exist:/hw2
---------------------------------------------
I'm a bit out of options. Google did not came up with a solution (at
least not for me).
Can someone point me in the right direction (or is there a solution
available?).
Any pointers or advice are greatly appreciated.
Best Regards,
Martijn
signature.asc
Description: OpenPGP digital signature
