You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randall Svancara <rs...@adaweb.net> on 2005/03/01 16:46:31 UTC

RE: Tomcat Cluster

Apparently this was too verbose for anyone to read.  I simply just don't
understand why each tomcat instance is failing to recognize any other
instance in the cluster.  Multicast messages are being broadcasted.  Is
there any configuration parameter I can turn on that will verify that
each tomcat instance can see the other instances???

Thanks,

Randall


 

-----Original Message-----
From: Randall Svancara [mailto:rsvancara@adaweb.net] 
Sent: Wednesday, February 23, 2005 9:44 AM
To: Tomcat Users List
Subject: Tomcat Cluster 

I have attempted to configure a tomcat cluster using version 5.5.7 of
tomcat.  
I have configured a simple tcp cluster in the server.xml.  I have two
tomcat instances installed on two different Linux servers (Fedora core
3, IPTAPLES is turned off, there is not firewall).  
I have apache and mod_jk set up on a third server.  Multicast is
enabled!!!  
When I start up each tomcat instance I receive the following message in
the catalina.out file.

------
Feb 23, 2005 9:21:49 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster
start
INFO: Cluster is about to start
Feb 23, 2005 9:21:49 AM
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/10.111.22.163 Feb 23,
2005 9:21:49 AM org.apache.catalina.cluster.mcast.McastService
start
INFO: Sleeping for 2000 secs to establish cluster membership Feb 23,
2005 9:21:51 AM org.apache.catalina.cluster.deploy.FarmWarDeployer start
INFO: Cluster FarmWarDeployer started.
Feb 23, 2005 9:21:51 AM org.apache.catalina.cluster.session.DeltaManager
start
INFO: Starting clustering manager...:/testapp Feb 23, 2005 9:21:51 AM
org.apache.catalina.cluster.session.DeltaManager
start
INFO: Manager[/testapp], skipping state transfer. No members active in
cluster group.
-----

The important thing to note here is that in the last line, I see
"INFO: Manager[/testapp], skipping state transfer. No members active in
cluster group."
At first I was thinking that multicast was not working properly.
However, I was researching the
Tomcat mailing list and found another thread discussing the same issue.
I tried to use the tool,
tomcat-replication.jar located on the CVS for tomcat.  I can see the
multicast sessions being generated between both servers using this tool.
I also started up ethereal, the packet sniffer.  I noticed that both
servers are generating multicast packets.

However after careful analysis of the packet information, I noticed that
my servers were looking for 127.0.0.1/4001 for the receiver port.
So I set the tcpListenAddress from "auto" to "10.111.22.163"  This
seemed to fix the problem with the multicast packets sending out the
incorrect listener addresses.  However, I am still getting the same
error...

"INFO: Manager[/testapp], skipping state transfer. No members active in
cluster group."

So here are my questions:
1. Is this really an error, or is session replication working and I am
not testing it properly?  

2.What is the proper way to test that session replication is working
properly?  Can anyone provide me with code that works.  I am currently
using a bean that I declare with <jsp:usebean
scope=session.............Is this wrong, should I use
request.getAttribute(), request.setAttribute()instead.

3.Can session replication replicate things like a class that I implement
as java.io.serializable?


Thanks in advance,

Randall



Cluster configuration from server.xml:

        <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="224.0.0.5"
                mcastPort="45564"
                mcastFrequency="500"
                mcastDropTime="3000"
                mcastBindAddress="10.111.22.163"/>

            <Receiver
 
className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="10.111.22.163"
                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;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;
"/>

            <Deployer
className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                      tempDir="/tmp/war-temp/"
                      deployDir="/tmp/war-deploy/"
                      watchDir="/tmp/war-listen/"
                      watchEnabled="false"/>
        </Cluster>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat Cluster

Posted by "Richard Mixon (qwest)" <rn...@qwest.net>.
Randall,

Below is the clustering section of my server.xml running under SuSE
Linux (SLES9). Things to check I can think of:

1. Is your server multi-homed (more than one network adapter)? If so you
"must" (at least from my experience) specify both "mcastBindAddr" and
tcpListendAddress as shown below. In my case I'm using a dedicated
adapter to connect the cluster over the private address space
192.168.11.x. Obviously the values are different for the Tomcat instance
on each server.
2. If after reviewing this it still does not work you can test that
multicasting is really working by using the utilities included in the
JGroups jars. See:
  http://www.jgroups.org/javagroupsnew/docs/newuser/node15.html#ItDoesnt
Work

HTH - Richard

  <SNIP>
  <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
           managerClassName="org.apache.catalina.cluster.session.DeltaMa
nager"
           expireSessionsOnShutdown="false"
           useDirtyFlag="true"
           notifyListenersOnReplication="true">

      <Membership
          className="org.apache.catalina.cluster.mcast.McastService"
          mcastAddr="228.0.0.4"
          mcastPort="45564"
          mcastBindAddr="192.168.11.3"
          mcastFrequency="500"
          mcastDropTime="3000"/>

      <Receiver
          className="org.apache.catalina.cluster.tcp.ReplicationListener
"
          tcpListenAddress="192.168.11.3"
          tcpListenPort="4001"
          tcpSelectorTimeout="100"
          tcpThreadCount="6"/>

      <Sender
          className="org.apache.catalina.cluster.tcp.ReplicationTransmit
ter"
          replicationMode="pooled"
          ackTimeout="15000"/>

      <Valve
className="org.apache.catalina.cluster.tcp.ReplicationValve"
             filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\
.css;.*\.txt;"/>

      <Deployer
className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                tempDir="/tmp/war-temp/"
                deployDir="/home/tomcat1/jakarta-tomcat-5.5.7/webapps"
                watchDir="/home/tomcat1/jakarta-tomcat-5.5.7-deployer/bu
ild/webapp"
                watchEnabled="false"/>
  </Cluster>
  <SNIP>

-----Original Message-----
From: Randall Svancara [mailto:rsvancara@adaweb.net]
Sent: Tuesday, March 01, 2005 8:47 AM
To: Tomcat Users List
Subject: RE: Tomcat Cluster


Apparently this was too verbose for anyone to read.  I simply just don't
understand why each tomcat instance is failing to recognize any other
instance in the cluster.  Multicast messages are being broadcasted.  Is
there any configuration parameter I can turn on that will verify that
each tomcat instance can see the other instances???

Thanks,

Randall




-----Original Message-----
From: Randall Svancara [mailto:rsvancara@adaweb.net]
Sent: Wednesday, February 23, 2005 9:44 AM
To: Tomcat Users List
Subject: Tomcat Cluster

I have attempted to configure a tomcat cluster using version 5.5.7 of
tomcat.
I have configured a simple tcp cluster in the server.xml.  I have two
tomcat instances installed on two different Linux servers (Fedora core
3, IPTAPLES is turned off, there is not firewall).
I have apache and mod_jk set up on a third server.  Multicast is
enabled!!!
When I start up each tomcat instance I receive the following message in
the catalina.out file.

------
Feb 23, 2005 9:21:49 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster
start
INFO: Cluster is about to start
Feb 23, 2005 9:21:49 AM
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/10.111.22.163 Feb 23,
2005 9:21:49 AM org.apache.catalina.cluster.mcast.McastService
start
INFO: Sleeping for 2000 secs to establish cluster membership Feb 23,
2005 9:21:51 AM org.apache.catalina.cluster.deploy.FarmWarDeployer start
INFO: Cluster FarmWarDeployer started.
Feb 23, 2005 9:21:51 AM org.apache.catalina.cluster.session.DeltaManager
start
INFO: Starting clustering manager...:/testapp Feb 23, 2005 9:21:51 AM
org.apache.catalina.cluster.session.DeltaManager
start
INFO: Manager[/testapp], skipping state transfer. No members active in
cluster group.
-----

The important thing to note here is that in the last line, I see
"INFO: Manager[/testapp], skipping state transfer. No members active in
cluster group."
At first I was thinking that multicast was not working properly.
However, I was researching the
Tomcat mailing list and found another thread discussing the same issue.
I tried to use the tool,
tomcat-replication.jar located on the CVS for tomcat.  I can see the
multicast sessions being generated between both servers using this tool.
I also started up ethereal, the packet sniffer.  I noticed that both
servers are generating multicast packets.

However after careful analysis of the packet information, I noticed that
my servers were looking for 127.0.0.1/4001 for the receiver port.
So I set the tcpListenAddress from "auto" to "10.111.22.163"  This
seemed to fix the problem with the multicast packets sending out the
incorrect listener addresses.  However, I am still getting the same
error...

"INFO: Manager[/testapp], skipping state transfer. No members active in
cluster group."

So here are my questions:
1. Is this really an error, or is session replication working and I am
not testing it properly?

2.What is the proper way to test that session replication is working
properly?  Can anyone provide me with code that works.  I am currently
using a bean that I declare with <jsp:usebean
scope=session.............Is this wrong, should I use
request.getAttribute(), request.setAttribute()instead.

3.Can session replication replicate things like a class that I implement
as java.io.serializable?


Thanks in advance,

Randall



Cluster configuration from server.xml:

        <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="224.0.0.5"
                mcastPort="45564"
                mcastFrequency="500"
                mcastDropTime="3000"
                mcastBindAddress="10.111.22.163"/>

            <Receiver

className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="10.111.22.163"
                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;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;
"/>

            <Deployer
className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                      tempDir="/tmp/war-temp/"
                      deployDir="/tmp/war-deploy/"
                      watchDir="/tmp/war-listen/"
                      watchEnabled="false"/>
        </Cluster>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org