You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Avenante <d....@gmail.com> on 2006/02/15 02:26:49 UTC

Tomcat 5.5.15 Clustering ?

Hi,

I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
configuration and test
i seems to be on limit of my all possibilities ;)

I try to use two tomcat in cluster with apache web server and mod_jk as
connector.

my Apache configuration look like :


# workers.properties

ps=/

# List the workers name
worker.list=loadbalancer

# ----------------
# First worker
# ----------------
worker.node01.port=8009
worker.node01.host=agnes
worker.node01.type=ajp13
worker.node01.lbfactor=1
#worker.node01.domain=cluster1
# ----------------
# Second worker
# ----------------
worker.node02.port=9009
worker.node02.host=ovea-inspiron
worker.node02.type=ajp13
worker.node02.lbfactor=1
#worker.node02.domain=cluster1
# ----------------------
# Load Balancer worker
# ----------------------
worker.loadbalancer.type=lb
worker.loadbalancer.sticky_session=false
worker.loadbalancer.balanced_workers=node01,node02

As you can see i use two server ('agnes' IP : 192.168.2.102 and
'ovea-inspiron' IP : 192.168.2.103)
I' ve coded a little aplication who read un file and create a sessions if
session not exist.

If i use the system in mod load balancing (with no cluster mod activate)
all is great (my config is of course worker.loadbalancer.sticky_session=true
)

So system run with session affinitu but the two server are accessible ;)

Now i try to configure as cluster mode with session replication
(my config is now worker.loadbalancer.sticky_session=3Dfalse)

I configure my to server.xml like that :
agnes (IP : 192.168.2.102)

<Server port="8005" shutdown="SHUTDOWN">
  <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" maxHttpHeaderSize="8192"
                      maxThreads="150" minSpareThreads="25"
                      maxSpareThreads="75"
                      enableLookups="false" redirectPort="8443"
acceptCount="100"
                      connectionTimeout="20000" disableUploadTimeout="true"
/>

    <Connector port="8009" enableLookups="false"
                      redirectPort="8443" protocol="AJP/1.3" />

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

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

      <Host name="localhost" appBase="webapps"
               unpackWARs="true" autoDeploy="true"
               xmlValidation="false" xmlNamespaceAware="false">
     <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                  doClusterLog="true"
                  clusterLogName="clusterlog"
                  manager.className="
org.apache.catalina.cluster.session.DeltaManager"
                  manager.expireSessionsOnShutdown="false"
                  manager.notifyListenersOnReplication="true"
                  manager.notifySessionListenersOnReplication="true"
                  manager.sendAllSessions="true"
                  manager.sendAllSessionsSize="500"
                  manager.sendAllSessionsWaitTime="20">

        <Membership className="
org.apache.catalina.cluster.mcast.McastService"
                             mcastBindAddress="192.168.2.102"
                             mcastAddr="224.0.0.1"
                             mcastPort="45564"
                             mcastFrequency="1000"
                             mcastDropTime="30000"/>

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

        <Sender className="
org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                      replicationMode="fastasyncqueue"
                      doTransmitterProcessingStats="true"
                      doProcessingStats="true"
                      doWaitAckStats="true"
                      queueTimeWait="true"
                      queueDoStats="true"
                      queueCheckLock="true"
                      ackTimeout="15000"
                      waitForAck="true"
                      keepAliveTimeout="80000"
                      keepAliveMaxRequestCount="-1" />

      </Host>
    </Engine>
  </Service>
</Server>


ovea-inspiron (IP : 192.168.2.103)
<Server port="9005" shutdown="SHUTDOWN">

  <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="9080" maxHttpHeaderSize="8192"
                     maxThreads="150" minSpareThreads="25"
                     maxSpareThreads="75"
                     enableLookups="false" redirectPort="8443"
                     acceptCount="100"
                     connectionTimeout="20000" disableUploadTimeout="true"
/>

   <Connector port="9009" enableLookups="false"
                     redirectPort="8443" protocol="AJP/1.3" />

   <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02" >
     <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                  resourceName="UserDatabase"/>

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

     <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                  doClusterLog="true"
                  clusterLogName="clusterlog"
                  manager.className="
org.apache.catalina.cluster.session.DeltaManager"
                  manager.expireSessionsOnShutdown="false"
                  manager.notifyListenersOnReplication="true"
                  manager.notifySessionListenersOnReplication="true"
                  manager.sendAllSessions="true"
                  manager.sendAllSessionsSize="500"
                  manager.sendAllSessionsWaitTime="20">

        <Membership className="
org.apache.catalina.cluster.mcast.McastService"
                             mcastBindAddress="192.168.2.103"
                             mcastAddr="224.0.0.1"
                             mcastPort="45564"
                             mcastFrequency="1000"
                             mcastDropTime="30000"/>

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

        <Sender className="
org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                      replicationMode="fastasyncqueue"
                      doTransmitterProcessingStats="true"
                      doProcessingStats="true"
                      doWaitAckStats="true"
                      queueTimeWait="true"
                      queueDoStats="true"
                      queueCheckLock="true"
                      ackTimeout="15000"
                      waitForAck="true"
                      keepAliveTimeout="80000"
                      keepAliveMaxRequestCount="-1" />

      </Host>
    </Engine>
  </Service>
</Server>


I'm user linux so i've compiled my kernel with multicat kernel option
I add the rout like rooute add -host 224.0.0.1 dev eth0

N.B : why 224.0.0.1 => http://www.iana.org/assignments/multicast-addresses

So route is :
ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
192.168.2.0     *              255.255.255.0     U      0      0        0
eth0
loopback        *               255.0.0.0            U      0      0
 0 lo
default         .                  0.0.0.0               UG    0      0
   0 eth0

now i start the two tomcat with the same application in webapp directories
with tcpdump i verify the multicasting btewen my server .. so :

19:39:17.809978 IP 192.168.2.102.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:18.546034 IP ovea-inspiron.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.45564UDP,
length 56
19:39:19.790470 IP ovea-inspiron.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:19.818691 IP 192.168.2.102.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:20.826650 IP 192.168.2.102.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:20.943933 IP ovea-inspiron.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:21.806813 arp who-has . tell 192.168.2.102
19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
19:39:21.831048 IP 192.168.2.102.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:22.164812 IP ovea-inspiron.45564 > all-systems.mcast.net.45564:UDP,
length 56
19:39:22.835240 IP 192.168.2.102.45564 > all-systems.mcast.net.45564:UDP,
length 56

So all semms to be OK but i've

Feb 14, 2006 6:33:26 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster st
art
INFO: Cluster is about to start
Feb 14, 2006 6:33:26 PM
org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterValves
INFO: Add Default ClusterValves at cluster localhost
Feb 14, 2006 6:33:26 PM
org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterListener
INFO: Add Default ClusterListener at cluster localhost
Feb 14, 2006 6:33:26 PM
org.apache.catalina.cluster.tcp.ReplicationTransmitter start
INFO: Start ClusterSender at cluster Catalina:type=3DCluster,host=3Dlocalhost
with name Catalina:type=3DClusterSender,host=3Dlocalhost
Feb 14, 2006 6:33:26 PM
org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
INFO: Setting multihome multicast interface to:/192.168.2.102
Feb 14, 2006 6:33:26 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 4000 secs to establish cluster membership
Feb 14, 2006 6:33:30 PM
org.apache.catalina.cluster.mcast.McastServiceregisterMBean
INFO: membership mbean registered
(Catalina:type=3DClusterMembership,host=3Dlocalhost)
Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 14, 2006 6:33:31 PM org.apache.catalina.cluster.session.DeltaManager st
art
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host with
name localhost
Feb 14, 2006 6:33:31 PM org.apache.catalina.cluster.session.DeltaManager st
art
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 14, 2006 6:33:31 PM
org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No members
active in cluster group.

As you can see in the last line cluster member are not found !!!!

What's the hell ;)

When i test my application i've always the sequences :

   This page is rendered on server : *Cluster Node - 01 (One) New session is
created with saved value ....UserId : 123456
   This page is rendered on server : *Cluster Node - 02 (Two) New session is
created with saved value ....UserId : 123456
   This page is rendered on server : *Cluster Node - 01 (One) New session is
created with saved value ....UserId : 123456

So the request is well balanced but a new session is alway created !!!!!

Some ideas ...

Thank you guys

Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
Yes you're right i' ve a problem in my /etc/hosts as you can see in my
response
to Hanik.

I hope this type of thread can help people to save time.
Because some skills are necessary for reolve the problem.

Thank you Paul ;)


On 2/15/06, Paul Smith <ps...@aconex.com> wrote:
>
> Is the multicast going over the 127.0.0.1 instead?  We've had this
> problem before (redhat el3), and to fix it, you have to make sure
> that in /etc/hosts that localhost is bound to a real IP address and
> not 127.0.0.1.  for some reason, in Java it always seems to want to
> stick to the local interface when localhost is mapped to this.
>
> Paul Smith
> On 16/02/2006, at 3:08 AM, Filip Hanik - Dev Lists wrote:
>
> > David, you are all over the place. Slow down for a second.
> > my guess is that one of your interfaces is not doing what you think
> > it is doing.
> >
> > follow these simple steps
> >
> > 1. Make sure that your multicast is working
> > 2. Stop all your tomcat processes
> > 3. Make sure nothing else is broadcasting on the same mcast address
> > 4. Delete or archive all your previous logs
> > 5. Startup tomcat 1 - wait 10 seconds
> > 6. Startup tomcat 2
> >
> > Then do the following
> > 7. Set tcpListenAddress="auto" in your server.xml file
> > 8. Repeat steps 1 through 6
> >
> > 9. email the logs to the list
> >
> > our guess is that you have a networking problem, but you just don't
> > dont look into it close enough for yourself and then provide us
> > with the info.
> >
> > Filip
> >
> >
> >
> >
> > David Avenante wrote:
> >> Yes all right !
> >>
> >> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element
> >> Host with
> >> name localhost
> >> Feb 15, 2006 10:47:32 AM
> >> org.apache.catalina.cluster.session.DeltaManagerstart
> >>
> >> But Why !!!!
> >> my mcastAddress is good !!!!!
> >>
> >> now i' ve a new error
> >>
> >> Feb 15, 2006 10:50:41 AM
> >> org.apache.catalina.cluster.tcp.FastAsyncSocketSender
> >> $FastQueueThreadpushQueuedMessages
> >> WARNING: Unable to asynchronously send session with id=[GET-ALL-/
> >> cluster-
> >> 1.0-SNAPSHOT] - message will be ignored.
> >> java.net.ConnectException: Connection timed out
> >>         at java.net.PlainSocketImpl.socketConnect(Native Method)
> >>
> >> but it's a big progress ;)
> >>
> >> I got to verifiy if my ntp synchronisation between my server is OK ;)
> >>
> >> Thank you very much.
> >>
> >>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Paul Smith <ps...@aconex.com>.
Is the multicast going over the 127.0.0.1 instead?  We've had this  
problem before (redhat el3), and to fix it, you have to make sure  
that in /etc/hosts that localhost is bound to a real IP address and  
not 127.0.0.1.  for some reason, in Java it always seems to want to  
stick to the local interface when localhost is mapped to this.

Paul Smith
On 16/02/2006, at 3:08 AM, Filip Hanik - Dev Lists wrote:

> David, you are all over the place. Slow down for a second.
> my guess is that one of your interfaces is not doing what you think  
> it is doing.
>
> follow these simple steps
>
> 1. Make sure that your multicast is working
> 2. Stop all your tomcat processes
> 3. Make sure nothing else is broadcasting on the same mcast address
> 4. Delete or archive all your previous logs
> 5. Startup tomcat 1 - wait 10 seconds
> 6. Startup tomcat 2
>
> Then do the following
> 7. Set tcpListenAddress="auto" in your server.xml file
> 8. Repeat steps 1 through 6
>
> 9. email the logs to the list
>
> our guess is that you have a networking problem, but you just don't  
> dont look into it close enough for yourself and then provide us  
> with the info.
>
> Filip
>
>
>
>
> David Avenante wrote:
>> Yes all right !
>>
>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element  
>> Host with
>> name localhost
>> Feb 15, 2006 10:47:32 AM  
>> org.apache.catalina.cluster.session.DeltaManagerstart
>>
>> But Why !!!!
>> my mcastAddress is good !!!!!
>>
>> now i' ve a new error
>>
>> Feb 15, 2006 10:50:41 AM
>> org.apache.catalina.cluster.tcp.FastAsyncSocketSender 
>> $FastQueueThreadpushQueuedMessages
>> WARNING: Unable to asynchronously send session with id=[GET-ALL-/ 
>> cluster-
>> 1.0-SNAPSHOT] - message will be ignored.
>> java.net.ConnectException: Connection timed out
>>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>>
>> but it's a big progress ;)
>>
>> I got to verifiy if my ntp synchronisation between my server is OK ;)
>>
>> Thank you very much.
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
APR is not yet planned for the clustering component. but is on the to do 
list
waitForAck is not related to APR, its a NIO problem between Java and 
your OS platform.


Filip

David Avenante wrote:
> Ok so question .. if I configure my tomcat with apr (Apache Portable
> Runtime)
> it's isue be solved ?
>
> I've listen that futur version of Tomcat will embed APR as natif and i can
> run Tomcat
> without apache in fronted with same performance and with support of other
> scripring language like PHP !!!!
>
> Is it true ? ;)
>
> On 2/17/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>   
>> you're welcome, glad I could help.
>>
>> there is one problem that you have on your linux box, NIO is not working
>> properly,
>> so disabling acknowledgements solved that problem (waitForAck="false")
>>
>> Filip
>>
>>
>> David Avenante wrote:
>>     
>>> OK i continu to explore this multicast problem on my boxes
>>>
>>> So what i've learn !!!!
>>>
>>> I learn that it's right to develop J2EE application on Linux.
>>> I can see very quickly problem that i can find in production
>>>       
>> infrastructure.
>>     
>>> i'm sure on windows all my problemes was be masked.
>>>
>>> It's improve my knlowledge of Linux system and network.
>>>
>>> It's fun for a developper like me too learn about system.
>>> Now i need to modifiy my real application to support clustering.
>>>
>>> Thank you again ;)
>>>
>>>
>>>
>>> On 2/17/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>>>
>>>       
>>>> Perfect David, and as far as I can tell, the latter sequence that you
>>>> present, clustering and session replication is working just fine.
>>>> now, obviously your system is not setup correctly to bind an interface
>>>> to the multicasting, so don't do it if it works without it.
>>>> so what have you learned? :)
>>>>
>>>> Filip
>>>>
>>>>         
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>     
>
>   


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
Ok so question .. if I configure my tomcat with apr (Apache Portable
Runtime)
it's isue be solved ?

I've listen that futur version of Tomcat will embed APR as natif and i can
run Tomcat
without apache in fronted with same performance and with support of other
scripring language like PHP !!!!

Is it true ? ;)

On 2/17/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> you're welcome, glad I could help.
>
> there is one problem that you have on your linux box, NIO is not working
> properly,
> so disabling acknowledgements solved that problem (waitForAck="false")
>
> Filip
>
>
> David Avenante wrote:
> > OK i continu to explore this multicast problem on my boxes
> >
> > So what i've learn !!!!
> >
> > I learn that it's right to develop J2EE application on Linux.
> > I can see very quickly problem that i can find in production
> infrastructure.
> > i'm sure on windows all my problemes was be masked.
> >
> > It's improve my knlowledge of Linux system and network.
> >
> > It's fun for a developper like me too learn about system.
> > Now i need to modifiy my real application to support clustering.
> >
> > Thank you again ;)
> >
> >
> >
> > On 2/17/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
> >
> >> Perfect David, and as far as I can tell, the latter sequence that you
> >> present, clustering and session replication is working just fine.
> >> now, obviously your system is not setup correctly to bind an interface
> >> to the multicasting, so don't do it if it works without it.
> >> so what have you learned? :)
> >>
> >> Filip
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
you're welcome, glad I could help.

there is one problem that you have on your linux box, NIO is not working 
properly,
so disabling acknowledgements solved that problem (waitForAck="false")

Filip


David Avenante wrote:
> OK i continu to explore this multicast problem on my boxes
>
> So what i've learn !!!!
>
> I learn that it's right to develop J2EE application on Linux.
> I can see very quickly problem that i can find in production infrastructure.
> i'm sure on windows all my problemes was be masked.
>
> It's improve my knlowledge of Linux system and network.
>
> It's fun for a developper like me too learn about system.
> Now i need to modifiy my real application to support clustering.
>
> Thank you again ;)
>
>
>
> On 2/17/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>   
>> Perfect David, and as far as I can tell, the latter sequence that you
>> present, clustering and session replication is working just fine.
>> now, obviously your system is not setup correctly to bind an interface
>> to the multicasting, so don't do it if it works without it.
>> so what have you learned? :)
>>
>> Filip
>>     


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
OK i continu to explore this multicast problem on my boxes

So what i've learn !!!!

I learn that it's right to develop J2EE application on Linux.
I can see very quickly problem that i can find in production infrastructure.
i'm sure on windows all my problemes was be masked.

It's improve my knlowledge of Linux system and network.

It's fun for a developper like me too learn about system.
Now i need to modifiy my real application to support clustering.

Thank you again ;)



On 2/17/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> Perfect David, and as far as I can tell, the latter sequence that you
> present, clustering and session replication is working just fine.
> now, obviously your system is not setup correctly to bind an interface
> to the multicasting, so don't do it if it works without it.
> so what have you learned? :)
>
> Filip
>
>
>
> David Avenante wrote:
> > -- Ok so let's go ;)
> >
> > My two tomcat are stopped and i run the MCaster on both box
> >
> > >From agnes
> > java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
> > Usage MCaster [address port message]
> > BEGIN TO RECEIVE
> > SENT:ovea-inspiron1
> > RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
> > BEGIN TO RECEIVE
> > RECEIVED:agnes3 FROM /192.168.2.103:45564
> > SENT:ovea-inspiron2
> > BEGIN TO RECEIVE
> > RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564
> > SENT:ovea-inspiron3
> > BEGIN TO RECEIVE
> > RECEIVED:agnes4 FROM /192.168.2.103:45564
> > SENT:ovea-inspiron4
> > BEGIN TO RECEIVE
> > RECEIVED:ovea-inspiron3 FROM /192.168.2.102:45564
> > SENT:ovea-inspiron5
> >
> > >From ovea-inspiron
> > java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
> > Usage MCaster [address port message]
> > BEGIN TO RECEIVE
> > RECEIVED:agnes1 FROM /192.168.2.103:45564
> > SENT:agnes1
> > BEGIN TO RECEIVE
> > SENT:agnes2
> > RECEIVED:agnes2 FROM /192.168.2.103:45564
> > SENT:agnes3
> > BEGIN TO RECEIVE
> > RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
> > SENT:agnes4
> > BEGIN TO RECEIVE
> > RECEIVED:agnes3 FROM /192.168.2.103:45564
> > SENT:agnes5
> > BEGIN TO RECEIVE
> > RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564
> >
> > Come on ...
> >
> > I - WITH mcastBindAddress
> >
> > Shutdown the MCaster program => Ok
> > hutdown both Tomcats - delete or archive your logs => Ok
> > set waitForAck="false" on your <Sender> element => Ok
> > Start tomcat 1 => OK ... logs are :
> >
> > Feb 17, 2006 12:09:08 PM org.apache.catalina.core.AprLifecycleListener
> > lifecycleEvent
> > INFO: The Apache Tomcat Native library which allows optimal
> > performance in production environments was not found on the
> > java.library.path:
> > /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06
> /jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> > Feb 17, 2006 12:09:08 PM org.apache.coyote.http11.Http11BaseProtocolinit
> > INFO: Initializing Coyote HTTP/1.1 on http-8080
> > Feb 17, 2006 12:09:08 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 995 ms
> > Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardService start
> > INFO: Starting service Catalina
> > Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardEngine start
> > INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> > Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardHost start
> > INFO: XML validation disabled
> > Feb 17, 2006 12:09:08 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> > INFO: Cluster is about to start
> > Feb 17, 2006 12:09:08 PM
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> > INFO: Start ClusterSender at cluster
> > Catalina:type=Cluster,host=localhost with name
> > Catalina:type=ClusterSender,host=localhost
> > Feb 17, 2006 12:09:08 PM
> > org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
> > INFO: Setting multihome multicast interface to:/192.168.2.102
> > Feb 17, 2006 12:09:08 PM org.apache.catalina.cluster.mcast.McastServicestart
> > INFO: Sleeping for 4000 secs to establish cluster membership
> > Feb 17, 2006 12:09:12 PM
> > org.apache.catalina.cluster.mcast.McastService registerMBean
> > INFO: membership mbean registered
> > (Catalina:type=ClusterMembership,host=localhost)
> > Feb 17, 2006 12:09:12 PM
> > org.apache.catalina.cluster.session.JvmRouteBinderValve start
> > INFO: JvmRouteBinderValve started
> > Feb 17, 2006 12:09:13 PM org.apache.catalina.startup.HostConfigdeployWAR
> > INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> > Feb 17, 2006 12:09:13 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> > with name localhost
> > Feb 17, 2006 12:09:13 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> > Feb 17, 2006 12:09:13 PM
> > org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> > INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> > members active in cluster group.
> > Feb 17, 2006 12:09:13 PM org.apache.jasper.EmbeddedServletOptions <init>
> > SEVERE: The scratchDir you specified:
> > /opt/java/appserver/tomcat-5.5.15/work/Catalina/localhost/cluster-
> 1.0-SNAPSHOT
> > is unusable.
> > Feb 17, 2006 12:09:15 PM org.apache.tapestry.ApplicationServlet init
> > INFO: Initialized application servlet 'cluster': 911 millis to create
> > HiveMind Registry, 1,986 millis overall.
> > Feb 17, 2006 12:09:16 PM org.apache.coyote.http11.Http11BaseProtocolstart
> > INFO: Starting Coyote HTTP/1.1 on http-8080
> > Feb 17, 2006 12:09:16 PM org.apache.jk.common.ChannelSocket init
> > INFO: JK: ajp13 listening on /0.0.0.0:8009
> > Feb 17, 2006 12:09:16 PM org.apache.jk.server.JkMain start
> > INFO: Jk running ID=0 time=0/27  config=null
> > Feb 17, 2006 12:09:16 PM org.apache.catalina.storeconfig.StoreLoaderload
> > INFO: Find registry server-registry.xml at classpath resource
> > Feb 17, 2006 12:09:16 PM org.apache.catalina.startup.Catalina start
> > INFO: Server startup in 7732 ms
> >
> > Start tomcat 2 => OK ... logs are
> >
> > Feb 17, 2006 12:15:48 PM org.apache.catalina.core.AprLifecycleListener
> > lifecycleEvent
> > INFO: The Apache Tomcat Native library which allows optimal
> > performance in production environments was not found on the
> > java.library.path:
> > /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06
> /jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> > Feb 17, 2006 12:15:48 PM org.apache.coyote.http11.Http11BaseProtocolinit
> > INFO: Initializing Coyote HTTP/1.1 on http-9080
> > Feb 17, 2006 12:15:48 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 738 ms
> > Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardService start
> > INFO: Starting service Catalina
> > Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardEngine start
> > INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> > Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardHost start
> > INFO: XML validation disabled
> > Feb 17, 2006 12:15:48 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> > INFO: Cluster is about to start
> > Feb 17, 2006 12:15:48 PM
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> > INFO: Start ClusterSender at cluster
> > Catalina:type=Cluster,host=localhost with name
> > Catalina:type=ClusterSender,host=localhost
> > Feb 17, 2006 12:15:48 PM
> > org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
> > INFO: Setting multihome multicast interface to:/192.168.2.103
> > Feb 17, 2006 12:15:48 PM org.apache.catalina.cluster.mcast.McastServicestart
> > INFO: Sleeping for 4000 secs to establish cluster membership
> > Feb 17, 2006 12:15:52 PM
> > org.apache.catalina.cluster.mcast.McastService registerMBean
> > INFO: membership mbean registered
> > (Catalina:type=ClusterMembership,host=localhost)
> > Feb 17, 2006 12:15:52 PM
> > org.apache.catalina.cluster.session.JvmRouteBinderValve start
> > INFO: JvmRouteBinderValve started
> > Feb 17, 2006 12:15:53 PM org.apache.catalina.startup.HostConfigdeployWAR
> > INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> > Feb 17, 2006 12:15:53 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> > with name localhost
> > Feb 17, 2006 12:15:53 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> > Feb 17, 2006 12:15:53 PM
> > org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> > INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> > members active in cluster group.
> > Feb 17, 2006 12:15:54 PM org.apache.tapestry.ApplicationServlet init
> > INFO: Initialized application servlet 'cluster': 712 millis to create
> > HiveMind Registry, 1,426 millis overall.
> > Feb 17, 2006 12:15:55 PM org.apache.coyote.http11.Http11BaseProtocolstart
> > INFO: Starting Coyote HTTP/1.1 on http-9080
> > Feb 17, 2006 12:15:55 PM org.apache.jk.common.ChannelSocket init
> > INFO: JK: ajp13 listening on /0.0.0.0:9009
> > Feb 17, 2006 12:15:55 PM org.apache.jk.server.JkMain start
> > INFO: Jk running ID=0 time=0/73  config=null
> > Feb 17, 2006 12:15:55 PM org.apache.catalina.storeconfig.StoreLoaderload
> > INFO: Find registry server-registry.xml at classpath resource
> > Feb 17, 2006 12:15:55 PM org.apache.catalina.startup.Catalina start
> > INFO: Server startup in 7168 ms
> >
> > I look on first tomcat log and nothing change
> >
> > Ok now my two apps are deployed ... i start my apache
> > do i my first request => result :
> > Demo This page is rendered on server : Cluster Node - 01 (One) New
> > session is created with saved value ....UserId : 123456
> >
> > do i my second request => result :
> > Demo This page is rendered on server : Cluster Node - 02 (Two) New
> > session is created with saved value ....UserId : 123456
> >
> > Nothing new in the two tomcat log.
> >
> > So no session replication a new session is created on each server ;(
> >
> >
> > II - WITHOUT mcastBindAddress
> >
> > Shutdown the MCaster program => Ok
> > hutdown both Tomcats - delete or archive your logs => Ok
> > set waitForAck="false" on your <Sender> element => Ok (I keep your
> > config here to see ;))
> > Start tomcat 1 => OK ... logs are :
> >
> > Feb 17, 2006 12:25:46 PM org.apache.catalina.core.AprLifecycleListener
> > lifecycleEvent
> > INFO: The Apache Tomcat Native library which allows optimal
> > performance in production environments was not found on the
> > java.library.path:
> > /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06
> /jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> > Feb 17, 2006 12:25:46 PM org.apache.coyote.http11.Http11BaseProtocolinit
> > INFO: Initializing Coyote HTTP/1.1 on http-8080
> > Feb 17, 2006 12:25:46 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 1001 ms
> > Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardService start
> > INFO: Starting service Catalina
> > Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardEngine start
> > INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> > Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardHost start
> > INFO: XML validation disabled
> > Feb 17, 2006 12:25:46 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> > INFO: Cluster is about to start
> > Feb 17, 2006 12:25:46 PM
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> > INFO: Start ClusterSender at cluster
> > Catalina:type=Cluster,host=localhost with name
> > Catalina:type=ClusterSender,host=localhost
> > Feb 17, 2006 12:25:46 PM org.apache.catalina.cluster.mcast.McastServicestart
> > INFO: Sleeping for 4000 secs to establish cluster membership
> > Feb 17, 2006 12:25:50 PM
> > org.apache.catalina.cluster.mcast.McastService registerMBean
> > INFO: membership mbean registered
> > (Catalina:type=ClusterMembership,host=localhost)
> > Feb 17, 2006 12:25:50 PM
> > org.apache.catalina.cluster.session.JvmRouteBinderValve start
> > INFO: JvmRouteBinderValve started
> > Feb 17, 2006 12:25:51 PM org.apache.catalina.startup.HostConfigdeployWAR
> > INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> > Feb 17, 2006 12:25:51 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> > with name localhost
> > Feb 17, 2006 12:25:51 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> > Feb 17, 2006 12:25:51 PM
> > org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> > INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> > members active in cluster group.
> > Feb 17, 2006 12:25:53 PM org.apache.tapestry.ApplicationServlet init
> > INFO: Initialized application servlet 'cluster': 971 millis to create
> > HiveMind Registry, 1,999 millis overall.
> > Feb 17, 2006 12:25:53 PM org.apache.coyote.http11.Http11BaseProtocolstart
> > INFO: Starting Coyote HTTP/1.1 on http-8080
> > Feb 17, 2006 12:25:53 PM org.apache.jk.common.ChannelSocket init
> > INFO: JK: ajp13 listening on /0.0.0.0:8009
> > Feb 17, 2006 12:25:53 PM org.apache.jk.server.JkMain start
> > INFO: Jk running ID=0 time=0/23  config=null
> > Feb 17, 2006 12:25:53 PM org.apache.catalina.storeconfig.StoreLoaderload
> > INFO: Find registry server-registry.xml at classpath resource
> > Feb 17, 2006 12:25:54 PM org.apache.catalina.startup.Catalina start
> > INFO: Server startup in 7621 ms
> >
> > Start tomcat 2 => OK ... logs are
> > Feb 17, 2006 12:27:59 PM org.apache.catalina.core.AprLifecycleListener
> > lifecycleEvent
> > INFO: The Apache Tomcat Native library which allows optimal
> > performance in production environments was not found on the
> > java.library.path:
> > /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06
> /jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> > Feb 17, 2006 12:28:00 PM org.apache.coyote.http11.Http11BaseProtocolinit
> > INFO: Initializing Coyote HTTP/1.1 on http-9080
> > Feb 17, 2006 12:28:00 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 742 ms
> > Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardService start
> > INFO: Starting service Catalina
> > Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardEngine start
> > INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> > Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardHost start
> > INFO: XML validation disabled
> > Feb 17, 2006 12:28:00 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> > INFO: Cluster is about to start
> > Feb 17, 2006 12:28:00 PM
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> > INFO: Start ClusterSender at cluster
> > Catalina:type=Cluster,host=localhost with name
> > Catalina:type=ClusterSender,host=localhost
> > Feb 17, 2006 12:28:00 PM org.apache.catalina.cluster.mcast.McastServicestart
> > INFO: Sleeping for 4000 secs to establish cluster membership
> > Feb 17, 2006 12:28:01 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
> > INFO: Replication member
> > added:org.apache.catalina.cluster.mcast.McastMember
> [tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
> > alive=122566]
> > Feb 17, 2006 12:28:01 PM
> > org.apache.catalina.cluster.tcp.FastAsyncSocketSender checkThread
> > INFO: Create sender [/192.168.2.102:4,000] queue thread to tcp
> > background replication
> > Feb 17, 2006 12:28:04 PM
> > org.apache.catalina.cluster.mcast.McastService registerMBean
> > INFO: membership mbean registered
> > (Catalina:type=ClusterMembership,host=localhost)
> > Feb 17, 2006 12:28:04 PM
> > org.apache.catalina.cluster.session.JvmRouteBinderValve start
> > INFO: JvmRouteBinderValve started
> > Feb 17, 2006 12:28:04 PM org.apache.catalina.startup.HostConfigdeployWAR
> > INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> > Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> > with name localhost
> > Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.session.DeltaManager start
> > INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> > Feb 17, 2006 12:28:04 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:28:04 PM 11 192.168.2.102:4,000
> > GET-ALL-/cluster-1.0-SNAPSHOT Feb 17, 2006 12:28:04 PM
> > org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> > WARNING: Manager [/cluster-1.0-SNAPSHOT], requesting session state
> > from org.apache.catalina.cluster.mcast.McastMember
> [tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
> > alive=125576]. This operation will timeout if no session state has
> > been received within 60 seconds.
> > Feb 17, 2006 12:28:04 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:28:04 PM 1 192.168.2.102:4,000
> > SESSION-STATE-/cluster-1.0-SNAPSHOT true
> > Feb 17, 2006 12:28:04 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:28:04 PM 0 192.168.2.102:4,000
> > SESSION-STATE-TRANSFERED/cluster-1.0-SNAPSHOT true
> > Feb 17, 2006 12:28:05 PM
> > org.apache.catalina.cluster.session.DeltaManager
> > waitForSendAllSessions
> > INFO: Manager [/cluster-1.0-SNAPSHOT]; session state send at 2/17/06
> > 12:28 PM received in 204 ms.
> > Feb 17, 2006 12:28:06 PM org.apache.tapestry.ApplicationServlet init
> > INFO: Initialized application servlet 'cluster': 711 millis to create
> > HiveMind Registry, 1,459 millis overall.
> > Feb 17, 2006 12:28:07 PM org.apache.coyote.http11.Http11BaseProtocolstart
> > INFO: Starting Coyote HTTP/1.1 on http-9080
> > Feb 17, 2006 12:28:07 PM org.apache.jk.common.ChannelSocket init
> > INFO: JK: ajp13 listening on /0.0.0.0:9009
> > Feb 17, 2006 12:28:07 PM org.apache.jk.server.JkMain start
> > INFO: Jk running ID=0 time=0/15  config=null
> > Feb 17, 2006 12:28:07 PM org.apache.catalina.storeconfig.StoreLoaderload
> > INFO: Find registry server-registry.xml at classpath resource
> > Feb 17, 2006 12:28:07 PM org.apache.catalina.startup.Catalina start
> > INFO: Server startup in 7521 ms
> >
> > And on the first server new logs are outputed :
> > ...
> > Feb 17, 2006 12:27:56 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
> > INFO: Replication member
> > added:org.apache.catalina.cluster.mcast.McastMember
> [tcp://192.168.2.103:4001,cluster1,192.168.2.103,4001,
> > alive=3]
> > Feb 17, 2006 12:27:56 PM
> > org.apache.catalina.cluster.tcp.FastAsyncSocketSender checkThread
> > INFO: Create sender [/192.168.2.103:4,001] queue thread to tcp
> > background replication
> > Feb 17, 2006 12:27:57 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:27:57 PM 6 192.168.2.103:4,001
> > SESSION-STATE-/cluster-1.0-SNAPSHOT
> > Feb 17, 2006 12:27:57 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:27:57 PM 3 192.168.2.103:4,001
> > SESSION-STATE-TRANSFERED/cluster-1.0-SNAPSHOT
> > Feb 17, 2006 12:27:57 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:27:57 PM 17 192.168.2.103:4,001
> > GET-ALL-/cluster-1.0-SNAPSHOT true
> >
> > Ok now my two apps are deployed ... i start my apache
> > do i my first request => result :
> >
> > Demo This page is rendered on server : Cluster Node - 01 (One) New
> > session is created with saved value ....UserId : 123456
> >
> > do i my second request => result :
> > Demo This page is rendered on server : Cluster Node - 02 (Two) Session
> > already exist with saved value ....UserId : 123456
> >
> > So session replication is OK ;) on session created and duplicated on
> > the other server
> >
> > New logs are present in my two boxes :
> > on agnes :
> >
> > Feb 17, 2006 12:31:45 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:31:45 PM 5 -
> > 492D5B75E173E7323E076E96010274AD.node01-1140197505797
> > Feb 17, 2006 12:31:46 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:31:46 PM 2 -
> > 492D5B75E173E7323E076E96010274AD.node01-1140197506232
> > Feb 17, 2006 12:31:59 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:31:59 PM 1 192.168.2.103:4,001
> >
> 492D5B75E173E7323E076E96010274AD.node01#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140197519860
> > true
> > Feb 17, 2006 12:32:02 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:32:02 PM 0 192.168.2.103:4,001
> > 492D5B75E173E7323E076E96010274AD.node02-1140197530043 true
> >
> > on ovea-inspiron :
> >
> > Feb 17, 2006 12:31:53 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:31:53 PM 10 192.168.2.102:4,000
> > 492D5B75E173E7323E076E96010274AD.node01-1140197505797 true
> > Feb 17, 2006 12:31:54 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> > INFO: RECEIVE Feb 17, 2006:12:31:54 PM 2 192.168.2.102:4,000
> > 492D5B75E173E7323E076E96010274AD.node01-1140197506232 true
> > Feb 17, 2006 12:32:07 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:32:07 PM 4 -
> >
> 492D5B75E173E7323E076E96010274AD.node01#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140197527691
> > Feb 17, 2006 12:32:10 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> > INFO: SEND Feb 17, 2006:12:32:10 PM 3 -
> > 492D5B75E173E7323E076E96010274AD.node02-1140197530043
> >
> > Is it ok for you or do you want some more tests ?
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On 2/16/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
> >
> >> wow, apologies for being blunt in advance, not my style, but you really
> >> really really need to slow down and you need to start reading carefully
> >> so that we can get this out of the way.
> >>
> >> 1. The output from MCaster that we are looking for is when MCaster is
> >> running on both boxes, and tomcat is NOT(!) running.
> >>    Please provide that output, what I am looking for is your pure
> >> MCaster messages, not cluttered with tomcat's messages.
> >>    You could have done this way back when if you had read carefully
> >> :).Dont take free support for granted :)
> >>
> >>
> >>> For the next steps wich configuration do you want ?
> >>> with or without mcastBindAddress in server.xml
> >>>
> >> both. does Tomcat recognize membership on both settings now? or still
> >> only without the mcastBindAddress attribute?
> >>
> >> Then follow these steps
> >> 1. Shutdown the MCaster program
> >> 2. Shutdown both Tomcats - delete or archive your logs
> >> 3. Set waitForAck="false" on your <Sender> element
> >> 4. Start tomcat 1
> >> 5. Wait 10 seconds
> >> 6. Start tomcat 2
> >> 7. Send us your new output from tomcat
> >>
> >> Filip
> >>
> >> David Avenante wrote:
> >>
> >>> Now tell us
> >>> 1. OS Version
> >>>  - gentoo with 2.6.15 kernel
> >>>
> >>> 2. Java version
> >>>  - Sun JDK 1.5.0.06
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Perfect David, and as far as I can tell, the latter sequence that you 
present, clustering and session replication is working just fine.
now, obviously your system is not setup correctly to bind an interface 
to the multicasting, so don't do it if it works without it.
so what have you learned? :)

Filip



David Avenante wrote:
> -- Ok so let's go ;)
>
> My two tomcat are stopped and i run the MCaster on both box
>
> >From agnes
> java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
> Usage MCaster [address port message]
> BEGIN TO RECEIVE
> SENT:ovea-inspiron1
> RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
> BEGIN TO RECEIVE
> RECEIVED:agnes3 FROM /192.168.2.103:45564
> SENT:ovea-inspiron2
> BEGIN TO RECEIVE
> RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564
> SENT:ovea-inspiron3
> BEGIN TO RECEIVE
> RECEIVED:agnes4 FROM /192.168.2.103:45564
> SENT:ovea-inspiron4
> BEGIN TO RECEIVE
> RECEIVED:ovea-inspiron3 FROM /192.168.2.102:45564
> SENT:ovea-inspiron5
>
> >From ovea-inspiron
> java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
> Usage MCaster [address port message]
> BEGIN TO RECEIVE
> RECEIVED:agnes1 FROM /192.168.2.103:45564
> SENT:agnes1
> BEGIN TO RECEIVE
> SENT:agnes2
> RECEIVED:agnes2 FROM /192.168.2.103:45564
> SENT:agnes3
> BEGIN TO RECEIVE
> RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
> SENT:agnes4
> BEGIN TO RECEIVE
> RECEIVED:agnes3 FROM /192.168.2.103:45564
> SENT:agnes5
> BEGIN TO RECEIVE
> RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564
>
> Come on ...
>
> I - WITH mcastBindAddress
>
> Shutdown the MCaster program => Ok
> hutdown both Tomcats - delete or archive your logs => Ok
> set waitForAck="false" on your <Sender> element => Ok
> Start tomcat 1 => OK ... logs are :
>
> Feb 17, 2006 12:09:08 PM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path:
> /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> Feb 17, 2006 12:09:08 PM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Feb 17, 2006 12:09:08 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 995 ms
> Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> Feb 17, 2006 12:09:08 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> INFO: Cluster is about to start
> Feb 17, 2006 12:09:08 PM
> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> INFO: Start ClusterSender at cluster
> Catalina:type=Cluster,host=localhost with name
> Catalina:type=ClusterSender,host=localhost
> Feb 17, 2006 12:09:08 PM
> org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
> INFO: Setting multihome multicast interface to:/192.168.2.102
> Feb 17, 2006 12:09:08 PM org.apache.catalina.cluster.mcast.McastService start
> INFO: Sleeping for 4000 secs to establish cluster membership
> Feb 17, 2006 12:09:12 PM
> org.apache.catalina.cluster.mcast.McastService registerMBean
> INFO: membership mbean registered
> (Catalina:type=ClusterMembership,host=localhost)
> Feb 17, 2006 12:09:12 PM
> org.apache.catalina.cluster.session.JvmRouteBinderValve start
> INFO: JvmRouteBinderValve started
> Feb 17, 2006 12:09:13 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> Feb 17, 2006 12:09:13 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> with name localhost
> Feb 17, 2006 12:09:13 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> Feb 17, 2006 12:09:13 PM
> org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> members active in cluster group.
> Feb 17, 2006 12:09:13 PM org.apache.jasper.EmbeddedServletOptions <init>
> SEVERE: The scratchDir you specified:
> /opt/java/appserver/tomcat-5.5.15/work/Catalina/localhost/cluster-1.0-SNAPSHOT
> is unusable.
> Feb 17, 2006 12:09:15 PM org.apache.tapestry.ApplicationServlet init
> INFO: Initialized application servlet 'cluster': 911 millis to create
> HiveMind Registry, 1,986 millis overall.
> Feb 17, 2006 12:09:16 PM org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Feb 17, 2006 12:09:16 PM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> Feb 17, 2006 12:09:16 PM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/27  config=null
> Feb 17, 2006 12:09:16 PM org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> Feb 17, 2006 12:09:16 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 7732 ms
>
> Start tomcat 2 => OK ... logs are
>
> Feb 17, 2006 12:15:48 PM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path:
> /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> Feb 17, 2006 12:15:48 PM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-9080
> Feb 17, 2006 12:15:48 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 738 ms
> Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> Feb 17, 2006 12:15:48 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> INFO: Cluster is about to start
> Feb 17, 2006 12:15:48 PM
> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> INFO: Start ClusterSender at cluster
> Catalina:type=Cluster,host=localhost with name
> Catalina:type=ClusterSender,host=localhost
> Feb 17, 2006 12:15:48 PM
> org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
> INFO: Setting multihome multicast interface to:/192.168.2.103
> Feb 17, 2006 12:15:48 PM org.apache.catalina.cluster.mcast.McastService start
> INFO: Sleeping for 4000 secs to establish cluster membership
> Feb 17, 2006 12:15:52 PM
> org.apache.catalina.cluster.mcast.McastService registerMBean
> INFO: membership mbean registered
> (Catalina:type=ClusterMembership,host=localhost)
> Feb 17, 2006 12:15:52 PM
> org.apache.catalina.cluster.session.JvmRouteBinderValve start
> INFO: JvmRouteBinderValve started
> Feb 17, 2006 12:15:53 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> Feb 17, 2006 12:15:53 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> with name localhost
> Feb 17, 2006 12:15:53 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> Feb 17, 2006 12:15:53 PM
> org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> members active in cluster group.
> Feb 17, 2006 12:15:54 PM org.apache.tapestry.ApplicationServlet init
> INFO: Initialized application servlet 'cluster': 712 millis to create
> HiveMind Registry, 1,426 millis overall.
> Feb 17, 2006 12:15:55 PM org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-9080
> Feb 17, 2006 12:15:55 PM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:9009
> Feb 17, 2006 12:15:55 PM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/73  config=null
> Feb 17, 2006 12:15:55 PM org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> Feb 17, 2006 12:15:55 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 7168 ms
>
> I look on first tomcat log and nothing change
>
> Ok now my two apps are deployed ... i start my apache
> do i my first request => result :
> Demo This page is rendered on server : Cluster Node - 01 (One) New
> session is created with saved value ....UserId : 123456
>
> do i my second request => result :
> Demo This page is rendered on server : Cluster Node - 02 (Two) New
> session is created with saved value ....UserId : 123456
>
> Nothing new in the two tomcat log.
>
> So no session replication a new session is created on each server ;(
>
>
> II - WITHOUT mcastBindAddress
>
> Shutdown the MCaster program => Ok
> hutdown both Tomcats - delete or archive your logs => Ok
> set waitForAck="false" on your <Sender> element => Ok (I keep your
> config here to see ;))
> Start tomcat 1 => OK ... logs are :
>
> Feb 17, 2006 12:25:46 PM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path:
> /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> Feb 17, 2006 12:25:46 PM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Feb 17, 2006 12:25:46 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 1001 ms
> Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> Feb 17, 2006 12:25:46 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> INFO: Cluster is about to start
> Feb 17, 2006 12:25:46 PM
> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> INFO: Start ClusterSender at cluster
> Catalina:type=Cluster,host=localhost with name
> Catalina:type=ClusterSender,host=localhost
> Feb 17, 2006 12:25:46 PM org.apache.catalina.cluster.mcast.McastService start
> INFO: Sleeping for 4000 secs to establish cluster membership
> Feb 17, 2006 12:25:50 PM
> org.apache.catalina.cluster.mcast.McastService registerMBean
> INFO: membership mbean registered
> (Catalina:type=ClusterMembership,host=localhost)
> Feb 17, 2006 12:25:50 PM
> org.apache.catalina.cluster.session.JvmRouteBinderValve start
> INFO: JvmRouteBinderValve started
> Feb 17, 2006 12:25:51 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> Feb 17, 2006 12:25:51 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> with name localhost
> Feb 17, 2006 12:25:51 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> Feb 17, 2006 12:25:51 PM
> org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> members active in cluster group.
> Feb 17, 2006 12:25:53 PM org.apache.tapestry.ApplicationServlet init
> INFO: Initialized application servlet 'cluster': 971 millis to create
> HiveMind Registry, 1,999 millis overall.
> Feb 17, 2006 12:25:53 PM org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Feb 17, 2006 12:25:53 PM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> Feb 17, 2006 12:25:53 PM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/23  config=null
> Feb 17, 2006 12:25:53 PM org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> Feb 17, 2006 12:25:54 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 7621 ms
>
> Start tomcat 2 => OK ... logs are
> Feb 17, 2006 12:27:59 PM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path:
> /opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
> Feb 17, 2006 12:28:00 PM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-9080
> Feb 17, 2006 12:28:00 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 742 ms
> Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
> Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> Feb 17, 2006 12:28:00 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
> INFO: Cluster is about to start
> Feb 17, 2006 12:28:00 PM
> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> INFO: Start ClusterSender at cluster
> Catalina:type=Cluster,host=localhost with name
> Catalina:type=ClusterSender,host=localhost
> Feb 17, 2006 12:28:00 PM org.apache.catalina.cluster.mcast.McastService start
> INFO: Sleeping for 4000 secs to establish cluster membership
> Feb 17, 2006 12:28:01 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
> INFO: Replication member
> added:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
> alive=122566]
> Feb 17, 2006 12:28:01 PM
> org.apache.catalina.cluster.tcp.FastAsyncSocketSender checkThread
> INFO: Create sender [/192.168.2.102:4,000] queue thread to tcp
> background replication
> Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.mcast.McastService registerMBean
> INFO: membership mbean registered
> (Catalina:type=ClusterMembership,host=localhost)
> Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.session.JvmRouteBinderValve start
> INFO: JvmRouteBinderValve started
> Feb 17, 2006 12:28:04 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> Feb 17, 2006 12:28:04 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> with name localhost
> Feb 17, 2006 12:28:04 PM org.apache.catalina.cluster.session.DeltaManager start
> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:28:04 PM 11 192.168.2.102:4,000
> GET-ALL-/cluster-1.0-SNAPSHOT Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
> WARNING: Manager [/cluster-1.0-SNAPSHOT], requesting session state
> from org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
> alive=125576]. This operation will timeout if no session state has
> been received within 60 seconds.
> Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:28:04 PM 1 192.168.2.102:4,000
> SESSION-STATE-/cluster-1.0-SNAPSHOT true
> Feb 17, 2006 12:28:04 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:28:04 PM 0 192.168.2.102:4,000
> SESSION-STATE-TRANSFERED/cluster-1.0-SNAPSHOT true
> Feb 17, 2006 12:28:05 PM
> org.apache.catalina.cluster.session.DeltaManager
> waitForSendAllSessions
> INFO: Manager [/cluster-1.0-SNAPSHOT]; session state send at 2/17/06
> 12:28 PM received in 204 ms.
> Feb 17, 2006 12:28:06 PM org.apache.tapestry.ApplicationServlet init
> INFO: Initialized application servlet 'cluster': 711 millis to create
> HiveMind Registry, 1,459 millis overall.
> Feb 17, 2006 12:28:07 PM org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-9080
> Feb 17, 2006 12:28:07 PM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:9009
> Feb 17, 2006 12:28:07 PM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/15  config=null
> Feb 17, 2006 12:28:07 PM org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> Feb 17, 2006 12:28:07 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 7521 ms
>
> And on the first server new logs are outputed :
> ...
> Feb 17, 2006 12:27:56 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
> INFO: Replication member
> added:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.103:4001,cluster1,192.168.2.103,4001,
> alive=3]
> Feb 17, 2006 12:27:56 PM
> org.apache.catalina.cluster.tcp.FastAsyncSocketSender checkThread
> INFO: Create sender [/192.168.2.103:4,001] queue thread to tcp
> background replication
> Feb 17, 2006 12:27:57 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:27:57 PM 6 192.168.2.103:4,001
> SESSION-STATE-/cluster-1.0-SNAPSHOT
> Feb 17, 2006 12:27:57 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:27:57 PM 3 192.168.2.103:4,001
> SESSION-STATE-TRANSFERED/cluster-1.0-SNAPSHOT
> Feb 17, 2006 12:27:57 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:27:57 PM 17 192.168.2.103:4,001
> GET-ALL-/cluster-1.0-SNAPSHOT true
>
> Ok now my two apps are deployed ... i start my apache
> do i my first request => result :
>
> Demo This page is rendered on server : Cluster Node - 01 (One) New
> session is created with saved value ....UserId : 123456
>
> do i my second request => result :
> Demo This page is rendered on server : Cluster Node - 02 (Two) Session
> already exist with saved value ....UserId : 123456
>
> So session replication is OK ;) on session created and duplicated on
> the other server
>
> New logs are present in my two boxes :
> on agnes :
>
> Feb 17, 2006 12:31:45 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:31:45 PM 5 -
> 492D5B75E173E7323E076E96010274AD.node01-1140197505797
> Feb 17, 2006 12:31:46 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:31:46 PM 2 -
> 492D5B75E173E7323E076E96010274AD.node01-1140197506232
> Feb 17, 2006 12:31:59 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:31:59 PM 1 192.168.2.103:4,001
> 492D5B75E173E7323E076E96010274AD.node01#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140197519860
> true
> Feb 17, 2006 12:32:02 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:32:02 PM 0 192.168.2.103:4,001
> 492D5B75E173E7323E076E96010274AD.node02-1140197530043 true
>
> on ovea-inspiron :
>
> Feb 17, 2006 12:31:53 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:31:53 PM 10 192.168.2.102:4,000
> 492D5B75E173E7323E076E96010274AD.node01-1140197505797 true
> Feb 17, 2006 12:31:54 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
> INFO: RECEIVE Feb 17, 2006:12:31:54 PM 2 192.168.2.102:4,000
> 492D5B75E173E7323E076E96010274AD.node01-1140197506232 true
> Feb 17, 2006 12:32:07 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:32:07 PM 4 -
> 492D5B75E173E7323E076E96010274AD.node01#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140197527691
> Feb 17, 2006 12:32:10 PM
> org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
> INFO: SEND Feb 17, 2006:12:32:10 PM 3 -
> 492D5B75E173E7323E076E96010274AD.node02-1140197530043
>
> Is it ok for you or do you want some more tests ?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On 2/16/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>   
>> wow, apologies for being blunt in advance, not my style, but you really
>> really really need to slow down and you need to start reading carefully
>> so that we can get this out of the way.
>>
>> 1. The output from MCaster that we are looking for is when MCaster is
>> running on both boxes, and tomcat is NOT(!) running.
>>    Please provide that output, what I am looking for is your pure
>> MCaster messages, not cluttered with tomcat's messages.
>>    You could have done this way back when if you had read carefully
>> :).Dont take free support for granted :)
>>
>>     
>>> For the next steps wich configuration do you want ?
>>> with or without mcastBindAddress in server.xml
>>>       
>> both. does Tomcat recognize membership on both settings now? or still
>> only without the mcastBindAddress attribute?
>>
>> Then follow these steps
>> 1. Shutdown the MCaster program
>> 2. Shutdown both Tomcats - delete or archive your logs
>> 3. Set waitForAck="false" on your <Sender> element
>> 4. Start tomcat 1
>> 5. Wait 10 seconds
>> 6. Start tomcat 2
>> 7. Send us your new output from tomcat
>>
>> Filip
>>
>> David Avenante wrote:
>>     
>>> Now tell us
>>> 1. OS Version
>>>  - gentoo with 2.6.15 kernel
>>>
>>> 2. Java version
>>>  - Sun JDK 1.5.0.06
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>     
>
>   


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
-- Ok so let's go ;)

My two tomcat are stopped and i run the MCaster on both box

>From agnes
java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
Usage MCaster [address port message]
BEGIN TO RECEIVE
SENT:ovea-inspiron1
RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
BEGIN TO RECEIVE
RECEIVED:agnes3 FROM /192.168.2.103:45564
SENT:ovea-inspiron2
BEGIN TO RECEIVE
RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564
SENT:ovea-inspiron3
BEGIN TO RECEIVE
RECEIVED:agnes4 FROM /192.168.2.103:45564
SENT:ovea-inspiron4
BEGIN TO RECEIVE
RECEIVED:ovea-inspiron3 FROM /192.168.2.102:45564
SENT:ovea-inspiron5

>From ovea-inspiron
java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
Usage MCaster [address port message]
BEGIN TO RECEIVE
RECEIVED:agnes1 FROM /192.168.2.103:45564
SENT:agnes1
BEGIN TO RECEIVE
SENT:agnes2
RECEIVED:agnes2 FROM /192.168.2.103:45564
SENT:agnes3
BEGIN TO RECEIVE
RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
SENT:agnes4
BEGIN TO RECEIVE
RECEIVED:agnes3 FROM /192.168.2.103:45564
SENT:agnes5
BEGIN TO RECEIVE
RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564

Come on ...

I - WITH mcastBindAddress

Shutdown the MCaster program => Ok
hutdown both Tomcats - delete or archive your logs => Ok
set waitForAck="false" on your <Sender> element => Ok
Start tomcat 1 => OK ... logs are :

Feb 17, 2006 12:09:08 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
Feb 17, 2006 12:09:08 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 17, 2006 12:09:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 995 ms
Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Feb 17, 2006 12:09:08 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 17, 2006 12:09:08 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
INFO: Cluster is about to start
Feb 17, 2006 12:09:08 PM
org.apache.catalina.cluster.tcp.ReplicationTransmitter start
INFO: Start ClusterSender at cluster
Catalina:type=Cluster,host=localhost with name
Catalina:type=ClusterSender,host=localhost
Feb 17, 2006 12:09:08 PM
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/192.168.2.102
Feb 17, 2006 12:09:08 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 4000 secs to establish cluster membership
Feb 17, 2006 12:09:12 PM
org.apache.catalina.cluster.mcast.McastService registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Feb 17, 2006 12:09:12 PM
org.apache.catalina.cluster.session.JvmRouteBinderValve start
INFO: JvmRouteBinderValve started
Feb 17, 2006 12:09:13 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 17, 2006 12:09:13 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
with name localhost
Feb 17, 2006 12:09:13 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 17, 2006 12:09:13 PM
org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
members active in cluster group.
Feb 17, 2006 12:09:13 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified:
/opt/java/appserver/tomcat-5.5.15/work/Catalina/localhost/cluster-1.0-SNAPSHOT
is unusable.
Feb 17, 2006 12:09:15 PM org.apache.tapestry.ApplicationServlet init
INFO: Initialized application servlet 'cluster': 911 millis to create
HiveMind Registry, 1,986 millis overall.
Feb 17, 2006 12:09:16 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 17, 2006 12:09:16 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Feb 17, 2006 12:09:16 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/27  config=null
Feb 17, 2006 12:09:16 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 17, 2006 12:09:16 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7732 ms

Start tomcat 2 => OK ... logs are

Feb 17, 2006 12:15:48 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
Feb 17, 2006 12:15:48 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-9080
Feb 17, 2006 12:15:48 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 738 ms
Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Feb 17, 2006 12:15:48 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 17, 2006 12:15:48 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
INFO: Cluster is about to start
Feb 17, 2006 12:15:48 PM
org.apache.catalina.cluster.tcp.ReplicationTransmitter start
INFO: Start ClusterSender at cluster
Catalina:type=Cluster,host=localhost with name
Catalina:type=ClusterSender,host=localhost
Feb 17, 2006 12:15:48 PM
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/192.168.2.103
Feb 17, 2006 12:15:48 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 4000 secs to establish cluster membership
Feb 17, 2006 12:15:52 PM
org.apache.catalina.cluster.mcast.McastService registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Feb 17, 2006 12:15:52 PM
org.apache.catalina.cluster.session.JvmRouteBinderValve start
INFO: JvmRouteBinderValve started
Feb 17, 2006 12:15:53 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 17, 2006 12:15:53 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
with name localhost
Feb 17, 2006 12:15:53 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 17, 2006 12:15:53 PM
org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
members active in cluster group.
Feb 17, 2006 12:15:54 PM org.apache.tapestry.ApplicationServlet init
INFO: Initialized application servlet 'cluster': 712 millis to create
HiveMind Registry, 1,426 millis overall.
Feb 17, 2006 12:15:55 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-9080
Feb 17, 2006 12:15:55 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:9009
Feb 17, 2006 12:15:55 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/73  config=null
Feb 17, 2006 12:15:55 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 17, 2006 12:15:55 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7168 ms

I look on first tomcat log and nothing change

Ok now my two apps are deployed ... i start my apache
do i my first request => result :
Demo This page is rendered on server : Cluster Node - 01 (One) New
session is created with saved value ....UserId : 123456

do i my second request => result :
Demo This page is rendered on server : Cluster Node - 02 (Two) New
session is created with saved value ....UserId : 123456

Nothing new in the two tomcat log.

So no session replication a new session is created on each server ;(


II - WITHOUT mcastBindAddress

Shutdown the MCaster program => Ok
hutdown both Tomcats - delete or archive your logs => Ok
set waitForAck="false" on your <Sender> element => Ok (I keep your
config here to see ;))
Start tomcat 1 => OK ... logs are :

Feb 17, 2006 12:25:46 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
Feb 17, 2006 12:25:46 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 17, 2006 12:25:46 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1001 ms
Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Feb 17, 2006 12:25:46 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 17, 2006 12:25:46 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
INFO: Cluster is about to start
Feb 17, 2006 12:25:46 PM
org.apache.catalina.cluster.tcp.ReplicationTransmitter start
INFO: Start ClusterSender at cluster
Catalina:type=Cluster,host=localhost with name
Catalina:type=ClusterSender,host=localhost
Feb 17, 2006 12:25:46 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 4000 secs to establish cluster membership
Feb 17, 2006 12:25:50 PM
org.apache.catalina.cluster.mcast.McastService registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Feb 17, 2006 12:25:50 PM
org.apache.catalina.cluster.session.JvmRouteBinderValve start
INFO: JvmRouteBinderValve started
Feb 17, 2006 12:25:51 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 17, 2006 12:25:51 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
with name localhost
Feb 17, 2006 12:25:51 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 17, 2006 12:25:51 PM
org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
members active in cluster group.
Feb 17, 2006 12:25:53 PM org.apache.tapestry.ApplicationServlet init
INFO: Initialized application servlet 'cluster': 971 millis to create
HiveMind Registry, 1,999 millis overall.
Feb 17, 2006 12:25:53 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 17, 2006 12:25:53 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Feb 17, 2006 12:25:53 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/23  config=null
Feb 17, 2006 12:25:53 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 17, 2006 12:25:54 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7621 ms

Start tomcat 2 => OK ... logs are
Feb 17, 2006 12:27:59 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
Feb 17, 2006 12:28:00 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-9080
Feb 17, 2006 12:28:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 742 ms
Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Feb 17, 2006 12:28:00 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 17, 2006 12:28:00 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
INFO: Cluster is about to start
Feb 17, 2006 12:28:00 PM
org.apache.catalina.cluster.tcp.ReplicationTransmitter start
INFO: Start ClusterSender at cluster
Catalina:type=Cluster,host=localhost with name
Catalina:type=ClusterSender,host=localhost
Feb 17, 2006 12:28:00 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 4000 secs to establish cluster membership
Feb 17, 2006 12:28:01 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
INFO: Replication member
added:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
alive=122566]
Feb 17, 2006 12:28:01 PM
org.apache.catalina.cluster.tcp.FastAsyncSocketSender checkThread
INFO: Create sender [/192.168.2.102:4,000] queue thread to tcp
background replication
Feb 17, 2006 12:28:04 PM
org.apache.catalina.cluster.mcast.McastService registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Feb 17, 2006 12:28:04 PM
org.apache.catalina.cluster.session.JvmRouteBinderValve start
INFO: JvmRouteBinderValve started
Feb 17, 2006 12:28:04 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 17, 2006 12:28:04 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
with name localhost
Feb 17, 2006 12:28:04 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 17, 2006 12:28:04 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:28:04 PM 11 192.168.2.102:4,000
GET-ALL-/cluster-1.0-SNAPSHOT Feb 17, 2006 12:28:04 PM
org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
WARNING: Manager [/cluster-1.0-SNAPSHOT], requesting session state
from org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
alive=125576]. This operation will timeout if no session state has
been received within 60 seconds.
Feb 17, 2006 12:28:04 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:28:04 PM 1 192.168.2.102:4,000
SESSION-STATE-/cluster-1.0-SNAPSHOT true
Feb 17, 2006 12:28:04 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:28:04 PM 0 192.168.2.102:4,000
SESSION-STATE-TRANSFERED/cluster-1.0-SNAPSHOT true
Feb 17, 2006 12:28:05 PM
org.apache.catalina.cluster.session.DeltaManager
waitForSendAllSessions
INFO: Manager [/cluster-1.0-SNAPSHOT]; session state send at 2/17/06
12:28 PM received in 204 ms.
Feb 17, 2006 12:28:06 PM org.apache.tapestry.ApplicationServlet init
INFO: Initialized application servlet 'cluster': 711 millis to create
HiveMind Registry, 1,459 millis overall.
Feb 17, 2006 12:28:07 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-9080
Feb 17, 2006 12:28:07 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:9009
Feb 17, 2006 12:28:07 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15  config=null
Feb 17, 2006 12:28:07 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 17, 2006 12:28:07 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7521 ms

And on the first server new logs are outputed :
...
Feb 17, 2006 12:27:56 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
INFO: Replication member
added:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.103:4001,cluster1,192.168.2.103,4001,
alive=3]
Feb 17, 2006 12:27:56 PM
org.apache.catalina.cluster.tcp.FastAsyncSocketSender checkThread
INFO: Create sender [/192.168.2.103:4,001] queue thread to tcp
background replication
Feb 17, 2006 12:27:57 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:27:57 PM 6 192.168.2.103:4,001
SESSION-STATE-/cluster-1.0-SNAPSHOT
Feb 17, 2006 12:27:57 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:27:57 PM 3 192.168.2.103:4,001
SESSION-STATE-TRANSFERED/cluster-1.0-SNAPSHOT
Feb 17, 2006 12:27:57 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:27:57 PM 17 192.168.2.103:4,001
GET-ALL-/cluster-1.0-SNAPSHOT true

Ok now my two apps are deployed ... i start my apache
do i my first request => result :

Demo This page is rendered on server : Cluster Node - 01 (One) New
session is created with saved value ....UserId : 123456

do i my second request => result :
Demo This page is rendered on server : Cluster Node - 02 (Two) Session
already exist with saved value ....UserId : 123456

So session replication is OK ;) on session created and duplicated on
the other server

New logs are present in my two boxes :
on agnes :

Feb 17, 2006 12:31:45 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:31:45 PM 5 -
492D5B75E173E7323E076E96010274AD.node01-1140197505797
Feb 17, 2006 12:31:46 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:31:46 PM 2 -
492D5B75E173E7323E076E96010274AD.node01-1140197506232
Feb 17, 2006 12:31:59 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:31:59 PM 1 192.168.2.103:4,001
492D5B75E173E7323E076E96010274AD.node01#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140197519860
true
Feb 17, 2006 12:32:02 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:32:02 PM 0 192.168.2.103:4,001
492D5B75E173E7323E076E96010274AD.node02-1140197530043 true

on ovea-inspiron :

Feb 17, 2006 12:31:53 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:31:53 PM 10 192.168.2.102:4,000
492D5B75E173E7323E076E96010274AD.node01-1140197505797 true
Feb 17, 2006 12:31:54 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 17, 2006:12:31:54 PM 2 192.168.2.102:4,000
492D5B75E173E7323E076E96010274AD.node01-1140197506232 true
Feb 17, 2006 12:32:07 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:32:07 PM 4 -
492D5B75E173E7323E076E96010274AD.node01#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140197527691
Feb 17, 2006 12:32:10 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 17, 2006:12:32:10 PM 3 -
492D5B75E173E7323E076E96010274AD.node02-1140197530043

Is it ok for you or do you want some more tests ?



















On 2/16/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> wow, apologies for being blunt in advance, not my style, but you really
> really really need to slow down and you need to start reading carefully
> so that we can get this out of the way.
>
> 1. The output from MCaster that we are looking for is when MCaster is
> running on both boxes, and tomcat is NOT(!) running.
>    Please provide that output, what I am looking for is your pure
> MCaster messages, not cluttered with tomcat's messages.
>    You could have done this way back when if you had read carefully
> :).Dont take free support for granted :)
>
> >For the next steps wich configuration do you want ?
> >with or without mcastBindAddress in server.xml
>
> both. does Tomcat recognize membership on both settings now? or still
> only without the mcastBindAddress attribute?
>
> Then follow these steps
> 1. Shutdown the MCaster program
> 2. Shutdown both Tomcats - delete or archive your logs
> 3. Set waitForAck="false" on your <Sender> element
> 4. Start tomcat 1
> 5. Wait 10 seconds
> 6. Start tomcat 2
> 7. Send us your new output from tomcat
>
> Filip
>
> David Avenante wrote:
> > Now tell us
> > 1. OS Version
> >  - gentoo with 2.6.15 kernel
> >
> > 2. Java version
> >  - Sun JDK 1.5.0.06
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
wow, apologies for being blunt in advance, not my style, but you really 
really really need to slow down and you need to start reading carefully 
so that we can get this out of the way.

1. The output from MCaster that we are looking for is when MCaster is 
running on both boxes, and tomcat is NOT(!) running.
   Please provide that output, what I am looking for is your pure 
MCaster messages, not cluttered with tomcat's messages.
   You could have done this way back when if you had read carefully 
:).Dont take free support for granted :)

 >For the next steps wich configuration do you want ?
 >with or without mcastBindAddress in server.xml

both. does Tomcat recognize membership on both settings now? or still 
only without the mcastBindAddress attribute?

Then follow these steps
1. Shutdown the MCaster program
2. Shutdown both Tomcats - delete or archive your logs
3. Set waitForAck="false" on your <Sender> element
4. Start tomcat 1
5. Wait 10 seconds
6. Start tomcat 2
7. Send us your new output from tomcat

Filip

David Avenante wrote:
> Now tell us
> 1. OS Version
>  - gentoo with 2.6.15 kernel
>
> 2. Java version
>  - Sun JDK 1.5.0.06
>


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
Now tell us
1. OS Version
 - gentoo with 2.6.15 kernel

2. Java version
 - Sun JDK 1.5.0.06


OK in response of your previous message.
I start the two servers and run MCast
output is :
On agnes : java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
Usage MCaster [address port message]
BEGIN TO RECEIVE
SENT:ovea-inspiron1
RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
BEGIN TO RECEIVE
SENT:ovea-inspiron2
RECEIVED:▒��(f▒tcp://192.168.2.102:400cluster1 FROM /192.168.2.102:45564
SENT:ovea-inspiron3
BEGIN TO RECEIVE
RECEIVED:�t�(g▒tcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
SENT:ovea-inspiron4
BEGIN TO RECEIVE
RECEIVED:��(f▒tcp://192.168.2.102:400cluster1 FROM /192.168.2.102:45564

On ovea-inspiron : java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
Usage MCaster [address port message]
BEGIN TO RECEIVE
SENT:agnes1
RECEIVED:agnes1 FROM /192.168.2.103:45564
BEGIN TO RECEIVE
RECEIVED:gm???fâ–’tcp://192.168.2.102:400cluster1 FROM /192.168.2.102:45564
SENT:agnes2
BEGIN TO RECEIVE
RECEIVED:â–’????gâ–’tcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
SENT:agnes3
BEGIN TO RECEIVE
RECEIVED:k_???fâ–’tcp://192.168.2.102:400cluster1 FROM /192.168.2.102:45564
SENT:agnes4

For the next steps wich configuration do you want ?
with or without mcastBindAddress in server.xml configuration

Then follow these steps
1. Shutdown the MCaster program
2. Shutdown both Tomcats - delete or archive your logs
3. Set waitForAck="false" on your <Sender> element
4. Start tomcat 1
5. Wait 10 seconds
6. Start tomcat 2
7. Send us your new output from tomcat





On 2/16/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> ok, you didn't read my message again, that's ok.
>
> Now tell us
> 1. OS Version
> 2. Java version
>
> Then follow these steps
> 1. Shutdown the MCaster program
> 2. Shutdown both Tomcats - delete or archive your logs
> 3. Set waitForAck="false" on your <Sender> element
> 4. Start tomcat 1
> 5. Wait 10 seconds
> 6. Start tomcat 2
> 7. Send us your new output from tomcat
>
> Filip
>
>
> David Avenante wrote:
> > See my previous post
> > it's
> >
> >      on agnes the command java -cp tomcat-replication.jar MCaster
> > 224.0.0.1 45564 ovea-inspiron
> >      and on ovea-inspiron start comand : java -cp
> > tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
> >
> >      the ouput as the same a the other tests but tcpdump info are now :
> >      on agnes
> >      12:43: 02.336748 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566: UDP, length 7
> >      12:43:02.395214 IP agnes.45564 > all-systems.mcast.net.45564:
> > UDP, length 15
> >      12:43:05.400696 IP agnes.45564 > all-systems.mcast.net.45564:
> > UDP, length 15
> >      12:43:05.506764 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566: UDP, length 7
> >      12:43:08.405287 IP agnes.45564 > all-systems.mcast.net.45564:
> > UDP, length 15
> >      12:43:08.604056 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566: UDP, length 7
> >      12:43:11.410371 IP agnes.45564 > all-systems.mcast.net.45564 :
> > UDP, length 15
> >      12:43:11.608944 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566: UDP, length 7
> >
> >      on ovea-inspiron
> >      12:45:55.861466 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566:UDP, length 7
> >      12:45:57.983294 IP AGNES.45564 > all-systems.mcast.net.45564:
> > UDP, length 14
> >      12:45:58.914085 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566:UDP, length 7
> >      12:46:00.988429 IP AGNES.45564 > all-systems.mcast.net.45564:
> > UDP, length 15
> >      12:46:01.918123 IP ovea-inspiron.45566 >
> > all-systems.mcast.net.45566:UDP , length 7
> >
> >
> >
> > On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
> >
> >> ok, we will work through it one item at the time.
> >>
> >> show me the output from both servers MCaster program (not the tcpdump)
> >> when they run simultanously.
> >>
> >> Filip
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
ok, you didn't read my message again, that's ok.

Now tell us
1. OS Version
2. Java version

Then follow these steps
1. Shutdown the MCaster program
2. Shutdown both Tomcats - delete or archive your logs
3. Set waitForAck="false" on your <Sender> element
4. Start tomcat 1
5. Wait 10 seconds
6. Start tomcat 2
7. Send us your new output from tomcat

Filip


David Avenante wrote:
> See my previous post
> it's
>
>      on agnes the command java -cp tomcat-replication.jar MCaster
> 224.0.0.1 45564 ovea-inspiron
>      and on ovea-inspiron start comand : java -cp
> tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
>
>      the ouput as the same a the other tests but tcpdump info are now :
>      on agnes
>      12:43:02.336748 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566: UDP, length 7
>      12:43:02.395214 IP agnes.45564 > all-systems.mcast.net.45564:
> UDP, length 15
>      12:43:05.400696 IP agnes.45564 > all-systems.mcast.net.45564:
> UDP, length 15
>      12:43:05.506764 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566: UDP, length 7
>      12:43:08.405287 IP agnes.45564 > all-systems.mcast.net.45564:
> UDP, length 15
>      12:43:08.604056 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566: UDP, length 7
>      12:43:11.410371 IP agnes.45564 > all-systems.mcast.net.45564:
> UDP, length 15
>      12:43:11.608944 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566: UDP, length 7
>
>      on ovea-inspiron
>      12:45:55.861466 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566:UDP, length 7
>      12:45:57.983294 IP AGNES.45564 > all-systems.mcast.net.45564:
> UDP, length 14
>      12:45:58.914085 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566:UDP, length 7
>      12:46:00.988429 IP AGNES.45564 > all-systems.mcast.net.45564:
> UDP, length 15
>      12:46:01.918123 IP ovea-inspiron.45566 >
> all-systems.mcast.net.45566:UDP, length 7
>
>
>
> On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>   
>> ok, we will work through it one item at the time.
>>
>> show me the output from both servers MCaster program (not the tcpdump)
>> when they run simultanously.
>>
>> Filip
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>     
>
>   


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
See my previous post
it's

     on agnes the command java -cp tomcat-replication.jar MCaster
224.0.0.1 45564 ovea-inspiron
     and on ovea-inspiron start comand : java -cp
tomcat-replication.jar MCaster 224.0.0.1 45564 agnes

     the ouput as the same a the other tests but tcpdump info are now :
     on agnes
     12:43:02.336748 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7
     12:43:02.395214 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:05.400696 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:05.506764 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7
     12:43:08.405287 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:08.604056 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7
     12:43:11.410371 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:11.608944 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7

     on ovea-inspiron
     12:45:55.861466 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 7
     12:45:57.983294 IP AGNES.45564 > all-systems.mcast.net.45564:
UDP, length 14
     12:45:58.914085 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 7
     12:46:00.988429 IP AGNES.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:46:01.918123 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 7



On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> ok, we will work through it one item at the time.
>
> show me the output from both servers MCaster program (not the tcpdump)
> when they run simultanously.
>
> Filip
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
ok, we will work through it one item at the time.

show me the output from both servers MCaster program (not the tcpdump) 
when they run simultanously.

Filip


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
 You're right so :

 1 - I reboot my too servers agnes : 192.168.2.102 and ovea-inspiron :
192.168.2.103
 2 - I test the multicat on each server

     for that, I start on agnes the command
     java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
     output :
     Usage MCaster [address port message]
     BEGIN TO RECEIVE
     SENT:ovea-inspiron1
     RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
     BEGIN TO RECEIVE
     SENT:ovea-inspiron2
     RECEIVED:ovea-inspiron2 FROM /192.168.2.102:45564
     BEGIN TO RECEIVE
     ...
     a tcpdump on agnes output :
     12:03:56.160976 IP 192.168.2.102.45564 >
all-systems.mcast.net.45564: UDP, length 14
     12:03:59.165908 IP 192.168.2.102.45564 >
all-systems.mcast.net.45564: UDP, length 14
     12:04:02.170789 IP 192.168.2.102.45564 >
all-systems.mcast.net.45564: UDP, length 14
     12:04:05.175930 IP 192.168.2.102.45564 >
all-systems.mcast.net.45564: UDP, length 14
     12:04:08.180810 IP 192.168.2.102.45564 >
all-systems.mcast.net.45564: UDP, length 14
     ...

     a tcpdump on ovea-inspiron output :
     12:00:24.229852 IP AGNES.45564 > ALL-SYSTEMS.MCAST.NET.45564:
UDP, length 15
     12:00:27.234391 IP AGNES.45564 > ALL-SYSTEMS.MCAST.NET.45564:
UDP, length 15
     ...

     I stop the process on agnes and on ovea-inspiron start comand :
java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 agnes
     Usage MCaster [address port message]
     BEGIN TO RECEIVE
     RECEIVED:agnes1 FROM /192.168.2.103:45566
     SENT:agnes1
     BEGIN TO RECEIVE
     SENT:agnes2
     RECEIVED:agnes2 FROM /192.168.2.103:45566
     SENT:agnes3
     BEGIN TO RECEIVE
     RECEIVED:agnes3 FROM /192.168.2.103:45566

     a tcpdump on agnes output :
     12:12:48.210143 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 6
     12:12:51.264541 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 6
     12:12:54.396574 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7

     a tcpdump on ovea-inspiron output :
     12:27:10.603013 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 8
     12:27:13.855782 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 8
     12:27:16.863749 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 8

     Ok here first problem in the first server name of agnes is not
resolved !!!!
     so i take a look on my hosts and a see the problem !!!!
     fuck ... bad configuration
     it's
     127.0.0.1       localhost  agnes
     192.168.2.103   ovea-inspiron
     but must be
     127.0.0.1       localhost
     192.168.2.102   agnes
     192.168.2.103   ovea-inspiron

     same error on second server so i correct this mistake
     and retry the test ... ok name is resolved as well.

     Now i run the command simultany on two servers
     on agnes the command java -cp tomcat-replication.jar MCaster
224.0.0.1 45564 ovea-inspiron
     and on ovea-inspiron start comand : java -cp
tomcat-replication.jar MCaster 224.0.0.1 45564 agnes

     the ouput as the same a the other tests but tcpdump info are now :
     on agnes
     12:43:02.336748 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7
     12:43:02.395214 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:05.400696 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:05.506764 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7
     12:43:08.405287 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:08.604056 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7
     12:43:11.410371 IP agnes.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:43:11.608944 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566: UDP, length 7

     on ovea-inspiron
     12:45:55.861466 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 7
     12:45:57.983294 IP AGNES.45564 > all-systems.mcast.net.45564:
UDP, length 14
     12:45:58.914085 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 7
     12:46:00.988429 IP AGNES.45564 > all-systems.mcast.net.45564:
UDP, length 15
     12:46:01.918123 IP ovea-inspiron.45566 >
all-systems.mcast.net.45566:UDP, length 7

     Ok so now I think my multicast is OK no ?

     So now I use the two server configuration of my first post and i
start the first server.
     the log is :
Feb 15, 2006 4:00:26 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/opt/sun-jdk-1.5.0.06/jre/lib/i386/client:/opt/sun-jdk-1.5.0.06/jre/lib/i386:/opt/sun-jdk-1.5.0.06/jre/../lib/i386
Feb 15, 2006 4:00:26 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 15, 2006 4:00:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 980 ms
Feb 15, 2006 4:00:26 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 15, 2006 4:00:27 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Feb 15, 2006 4:00:27 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 15, 2006 4:00:27 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start
INFO: Cluster is about to start
Feb 15, 2006 4:00:27 PM
org.apache.catalina.cluster.tcp.ReplicationTransmitter start
INFO: Start ClusterSender at cluster
Catalina:type=Cluster,host=localhost with name
Catalina:type=ClusterSender,host=localhost
Feb 15, 2006 4:00:27 PM
org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket
INFO: Setting multihome multicast interface to:/192.168.2.102
Feb 15, 2006 4:00:27 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 4000 secs to establish cluster membership
Feb 15, 2006 4:00:31 PM org.apache.catalina.cluster.mcast.McastService
registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Feb 15, 2006 4:00:31 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start
INFO: Cluster deployment is watching
/opt/java/appserver/tomcat-5.5.15/war-listen/ for changes.
Feb 15, 2006 4:00:31 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start
INFO: Cluster FarmWarDeployer started.
Feb 15, 2006 4:00:31 PM
org.apache.catalina.cluster.session.JvmRouteBinderValve start
INFO: JvmRouteBinderValve started
Feb 15, 2006 4:00:31 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 15, 2006 4:00:31 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
with name localhost
Feb 15, 2006 4:00:31 PM org.apache.catalina.cluster.session.DeltaManager start
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 15, 2006 4:00:31 PM
org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions
INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
members active in cluster group.
Feb 15, 2006 4:00:33 PM org.apache.tapestry.ApplicationServlet init
INFO: Initialized application servlet 'cluster': 889 millis to create
HiveMind Registry, 1,887 millis overall.
Feb 15, 2006 4:00:34 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 15, 2006 4:00:34 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Feb 15, 2006 4:00:34 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/23  config=null
Feb 15, 2006 4:00:34 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 15, 2006 4:00:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7699 ms

when i start the second server the log is the same ;(

But when i remove the mcastBindAddress="..." in the two server.xml file
and i restart the two servers ....

All is ok the second server is in the cluster

Feb 15, 2006 4:15:18 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
Feb 15, 2006 4:15:18 PM org.apache.catalina.cluster.session.DeltaManagerstart
INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
with name localhost
Feb 15, 2006 4:15:18 PM org.apache.catalina.cluster.session.DeltaManagerstart
INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
Feb 15, 2006 4:15:19 PM
org.apache.catalina.cluster.tcp.SimpleTcpClusterlogSendMessage
INFO: SEND Feb 15, 2006:4:15:18 PM 11 192.168.2.102:4,000
GET-ALL-/cluster-1.0-SNAPSHOT
Feb 15, 2006 4:15:19 PM
org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
WARNING: Manager [/cluster-1.0-SNAPSHOT], requesting session state
fromorg.apache.catalina.cluster.mcast.McastMember[tcp://192.168.2.102:4000,cluster1,192.168.2.102,4000,
alive=19092]. This operation will timeout if no session state has been
received within 60 seconds.

and when a session is created on one nodethe other is notified :

Feb 15, 2006 4:16:29 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 15, 2006:4:16:29 PM 12 192.168.2.103:4,001
A075861428D2CE5A0257DEF8B622839D.node02-1140038190628 true
Feb 15, 2006 4:16:30 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logReceiveMessage
INFO: RECEIVE Feb 15, 2006:4:16:30 PM 7 192.168.2.103:4,001
A075861428D2CE5A0257DEF8B622839D.node02-1140038191128 true
Feb 15, 2006 4:16:34 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster logSendMessage
INFO: SEND Feb 15, 2006:4:16:34 PM 2 -
A075861428D2CE5A0257DEF8B622839D.node02#-#localhost#-#/cluster-1.0-SNAPSHOT#-#0#-#1140038194813

I don't always know why I need remove my mcastBindAddress

So a big thank you for all you help me to explore other way ;)

On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:

David, you are all over the place. Slow down for a second.
> my guess is that one of your interfaces is not doing what you think it
> is doing.
>
> follow these simple steps
>
> 1. Make sure that your multicast is working
> 2. Stop all your tomcat processes
> 3. Make sure nothing else is broadcasting on the same mcast address
> 4. Delete or archive all your previous logs
> 5. Startup tomcat 1 - wait 10 seconds
> 6. Startup tomcat 2
>
> Then do the following
> 7. Set tcpListenAddress="auto" in your server.xml file
> 8. Repeat steps 1 through 6
>
> 9. email the logs to the list
>
> our guess is that you have a networking problem, but you just don't dont
> look into it close enough for yourself and then provide us with the info.
>
> Filip
>
>
>
>
> David Avenante wrote:
> > Yes all right !
> >
> > INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> with
> > name localhost
> > Feb 15, 2006 10:47:32 AM
> org.apache.catalina.cluster.session.DeltaManagerstart
> >
> > But Why !!!!
> > my mcastAddress is good !!!!!
> >
> > now i' ve a new error
> >
> > Feb 15, 2006 10:50:41 AM
> >
> org.apache.catalina.cluster.tcp.FastAsyncSocketSender$FastQueueThreadpushQueuedMessages
> > WARNING: Unable to asynchronously send session with
> id=[GET-ALL-/cluster-
> > 1.0-SNAPSHOT] - message will be ignored.
> > java.net.ConnectException: Connection timed out
> >         at java.net.PlainSocketImpl.socketConnect(Native Method)
> >
> > but it's a big progress ;)
> >
> > I got to verifiy if my ntp synchronisation between my server is OK ;)
> >
> > Thank you very much.
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
David, you are all over the place. Slow down for a second.
my guess is that one of your interfaces is not doing what you think it 
is doing.

follow these simple steps

1. Make sure that your multicast is working
2. Stop all your tomcat processes
3. Make sure nothing else is broadcasting on the same mcast address
4. Delete or archive all your previous logs
5. Startup tomcat 1 - wait 10 seconds
6. Startup tomcat 2

Then do the following
7. Set tcpListenAddress="auto" in your server.xml file
8. Repeat steps 1 through 6

9. email the logs to the list

our guess is that you have a networking problem, but you just don't dont 
look into it close enough for yourself and then provide us with the info.

Filip




David Avenante wrote:
> Yes all right !
>
> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host with
> name localhost
> Feb 15, 2006 10:47:32 AM org.apache.catalina.cluster.session.DeltaManagerstart
>
> But Why !!!!
> my mcastAddress is good !!!!!
>
> now i' ve a new error
>
> Feb 15, 2006 10:50:41 AM
> org.apache.catalina.cluster.tcp.FastAsyncSocketSender$FastQueueThreadpushQueuedMessages
> WARNING: Unable to asynchronously send session with id=[GET-ALL-/cluster-
> 1.0-SNAPSHOT] - message will be ignored.
> java.net.ConnectException: Connection timed out
>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>
> but it's a big progress ;)
>
> I got to verifiy if my ntp synchronisation between my server is OK ;)
>
> Thank you very much.
>
>
>
>   


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
Yes all right !

INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host with
name localhost
Feb 15, 2006 10:47:32 AM org.apache.catalina.cluster.session.DeltaManagerstart

But Why !!!!
my mcastAddress is good !!!!!

now i' ve a new error

Feb 15, 2006 10:50:41 AM
org.apache.catalina.cluster.tcp.FastAsyncSocketSender$FastQueueThreadpushQueuedMessages
WARNING: Unable to asynchronously send session with id=[GET-ALL-/cluster-
1.0-SNAPSHOT] - message will be ignored.
java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)

but it's a big progress ;)

I got to verifiy if my ntp synchronisation between my server is OK ;)

Thank you very much.





On 2/15/06, Peter Rossbach <pr...@objektpark.de> wrote:
>
> Can you test your config without the parameter mcastBindAddress="xx"?
>
>
> Peter
>
>
>
> Am 15.02.2006 um 14:35 schrieb David Avenante:
>
> > Yes MULTICAST is enabled i see that by too fact :
> >
> > first,
> > ifconfig eth0 :
> >
> > eth0      Link encap:Ethernet  HWaddr 00:13:D4:45:A6:3F
> >           inet addr:192.168.2.102  Bcast:192.168.2.255  Mask:
> > 255.255.255.0
> >           UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST  MTU:1500
> > Metric:1
> >           RX packets:264493 errors:0 dropped:0 overruns:0 frame:0
> >           TX packets:292063 errors:0 dropped:0 overruns:0 carrier:0
> >           collisions:0 txqueuelen:1000
> >           RX bytes:98079150 (93.5 Mb)  TX bytes:41007393 (39.1 Mb)
> >
> > ALLMULTI and MULTICAST is enabled on two serveur interface.
> >
> > second,
> >
> > as you see in my first post tcpdump track the UDP messages send
> > between
> > server.
> >
> >
> > For sticky_session=true i' m not agree with you.
> > In the connector documentation (see
> > http://tomcat.apache.org/connectors-doc/config/workers.html)
> > => Set sticky_session to *False* when Tomcat is using a Session
> > Manager
> > which can persist session data across multiple instances of Tomcat
> > It' s my situation.
> >
> > So i' m alway in the trouble by thanks a lot for the verification ;)
> >
> >
> > On 2/15/06, Peter Rossbach <pr...@objektpark.de> wrote:
> >>
> >> Hey,
> >>
> >> 1)      Clustering need sticky_session=true and is only design for
> >> failover (see servlet spec).
> >> 2)      Are your sure that MULTICAST is enabled at eth0?
> >>
> >> regards
> >> Peter
> >> pr@objektpark.de
> >>
> >>
> >>
> >> Am 15.02.2006 um 02:26 schrieb David Avenante:
> >>
> >>> Hi,
> >>>
> >>> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some
> >>> work on
> >>> configuration and test
> >>> i seems to be on limit of my all possibilities ;)
> >>>
> >>> I try to use two tomcat in cluster with apache web server and
> >>> mod_jk as
> >>> connector.
> >>>
> >>> my Apache configuration look like :
> >>>
> >>>
> >>> # workers.properties
> >>>
> >>> ps=/
> >>>
> >>> # List the workers name
> >>> worker.list=loadbalancer
> >>>
> >>> # ----------------
> >>> # First worker
> >>> # ----------------
> >>> worker.node01.port=8009
> >>> worker.node01.host=agnes
> >>> worker.node01.type=ajp13
> >>> worker.node01.lbfactor=1
> >>> #worker.node01.domain=cluster1
> >>> # ----------------
> >>> # Second worker
> >>> # ----------------
> >>> worker.node02.port=9009
> >>> worker.node02.host=ovea-inspiron
> >>> worker.node02.type=ajp13
> >>> worker.node02.lbfactor=1
> >>> #worker.node02.domain=cluster1
> >>> # ----------------------
> >>> # Load Balancer worker
> >>> # ----------------------
> >>> worker.loadbalancer.type=lb
> >>> worker.loadbalancer.sticky_session=false
> >>> worker.loadbalancer.balanced_workers=node01,node02
> >>>
> >>> As you can see i use two server ('agnes' IP : 192.168.2.102 and
> >>> 'ovea-inspiron' IP : 192.168.2.103)
> >>> I' ve coded a little aplication who read un file and create a
> >>> sessions if
> >>> session not exist.
> >>>
> >>> If i use the system in mod load balancing (with no cluster mod
> >>> activate)
> >>> all is great (my config is of course
> >>> worker.loadbalancer.sticky_session=true
> >>> )
> >>>
> >>> So system run with session affinitu but the two server are
> >>> accessible ;)
> >>>
> >>> Now i try to configure as cluster mode with session replication
> >>> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
> >>>
> >>> I configure my to server.xml like that :
> >>> agnes (IP : 192.168.2.102)
> >>>
> >>> <Server port="8005" shutdown="SHUTDOWN">
> >>>   <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" maxHttpHeaderSize="8192"
> >>>                       maxThreads="150" minSpareThreads="25"
> >>>                       maxSpareThreads="75"
> >>>                       enableLookups="false" redirectPort="8443"
> >>> acceptCount="100"
> >>>                       connectionTimeout="20000"
> >>> disableUploadTimeout="true"
> >>> />
> >>>
> >>>     <Connector port="8009" enableLookups="false"
> >>>                       redirectPort="8443" protocol="AJP/1.3" />
> >>>
> >>>     <Engine name="Catalina" defaultHost="localhost"
> >>> jvmRoute="node01" >
> >>>
> >>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>>                    resourceName="UserDatabase" />
> >>>
> >>>       <Host name="localhost" appBase="webapps"
> >>>                unpackWARs="true" autoDeploy="true"
> >>>                xmlValidation="false" xmlNamespaceAware="false">
> >>>      <Cluster
> >>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >>>                   doClusterLog="true"
> >>>                   clusterLogName="clusterlog"
> >>>                   manager.className="
> >>> org.apache.catalina.cluster.session.DeltaManager"
> >>>                   manager.expireSessionsOnShutdown="false"
> >>>                   manager.notifyListenersOnReplication="true"
> >>>                   manager.notifySessionListenersOnReplication="true"
> >>>                   manager.sendAllSessions="true"
> >>>                   manager.sendAllSessionsSize="500"
> >>>                   manager.sendAllSessionsWaitTime="20">
> >>>
> >>>         <Membership className="
> >>> org.apache.catalina.cluster.mcast.McastService"
> >>>                              mcastBindAddress="192.168.2.102"
> >>>                              mcastAddr="224.0.0.1"
> >>>                              mcastPort="45564"
> >>>                              mcastFrequency="1000"
> >>>                              mcastDropTime="30000"/>
> >>>
> >>>         <Receiver className="
> >>> org.apache.catalina.cluster.tcp.ReplicationListener"
> >>>                          tcpListenAddress="192.168.2.102"
> >>>                          tcpListenPort="4000"
> >>>                          tcpSelectorTimeout="100"
> >>>                          tcpThreadCount="6" />
> >>>
> >>>         <Sender className="
> >>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >>>                       replicationMode="fastasyncqueue"
> >>>                       doTransmitterProcessingStats="true"
> >>>                       doProcessingStats="true"
> >>>                       doWaitAckStats="true"
> >>>                       queueTimeWait="true"
> >>>                       queueDoStats="true"
> >>>                       queueCheckLock="true"
> >>>                       ackTimeout="15000"
> >>>                       waitForAck="true"
> >>>                       keepAliveTimeout="80000"
> >>>                       keepAliveMaxRequestCount="-1" />
> >>>
> >>>       </Host>
> >>>     </Engine>
> >>>   </Service>
> >>> </Server>
> >>>
> >>>
> >>> ovea-inspiron (IP : 192.168.2.103)
> >>> <Server port="9005" shutdown="SHUTDOWN">
> >>>
> >>>   <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="9080" maxHttpHeaderSize="8192"
> >>>                      maxThreads="150" minSpareThreads="25"
> >>>                      maxSpareThreads="75"
> >>>                      enableLookups="false" redirectPort="8443"
> >>>                      acceptCount="100"
> >>>                      connectionTimeout="20000"
> >>> disableUploadTimeout="true"
> >>> />
> >>>
> >>>    <Connector port="9009" enableLookups="false"
> >>>                      redirectPort="8443" protocol="AJP/1.3" />
> >>>
> >>>    <Engine name="Catalina" defaultHost="localhost"
> >>> jvmRoute="node02" >
> >>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>>                   resourceName="UserDatabase"/>
> >>>
> >>>      <Host name="localhost" appBase="webapps"
> >>>               unpackWARs="true" autoDeploy="true"
> >>>               xmlValidation="false" xmlNamespaceAware="false">
> >>>
> >>>      <Cluster
> >>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >>>                   doClusterLog="true"
> >>>                   clusterLogName="clusterlog"
> >>>                   manager.className="
> >>> org.apache.catalina.cluster.session.DeltaManager"
> >>>                   manager.expireSessionsOnShutdown="false"
> >>>                   manager.notifyListenersOnReplication="true"
> >>>                   manager.notifySessionListenersOnReplication="true"
> >>>                   manager.sendAllSessions="true"
> >>>                   manager.sendAllSessionsSize="500"
> >>>                   manager.sendAllSessionsWaitTime="20">
> >>>
> >>>         <Membership className="
> >>> org.apache.catalina.cluster.mcast.McastService"
> >>>                              mcastBindAddress="192.168.2.103"
> >>>                              mcastAddr="224.0.0.1"
> >>>                              mcastPort="45564"
> >>>                              mcastFrequency="1000"
> >>>                              mcastDropTime="30000"/>
> >>>
> >>>         <Receiver className="
> >>> org.apache.catalina.cluster.tcp.ReplicationListener"
> >>>                         tcpListenAddress="192.168.2.103"
> >>>                         tcpListenPort="4000"
> >>>                         tcpSelectorTimeout="100"
> >>>                         tcpThreadCount="6" />
> >>>
> >>>         <Sender className="
> >>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >>>                       replicationMode="fastasyncqueue"
> >>>                       doTransmitterProcessingStats="true"
> >>>                       doProcessingStats="true"
> >>>                       doWaitAckStats="true"
> >>>                       queueTimeWait="true"
> >>>                       queueDoStats="true"
> >>>                       queueCheckLock="true"
> >>>                       ackTimeout="15000"
> >>>                       waitForAck="true"
> >>>                       keepAliveTimeout="80000"
> >>>                       keepAliveMaxRequestCount="-1" />
> >>>
> >>>       </Host>
> >>>     </Engine>
> >>>   </Service>
> >>> </Server>
> >>>
> >>>
> >>> I'm user linux so i've compiled my kernel with multicat kernel
> >>> option
> >>> I add the rout like rooute add -host 224.0.0.1 dev eth0
> >>>
> >>> N.B : why 224.0.0.1 => http://www.iana.org/assignments/multicast-
> >>> addresses
> >>>
> >>> So route is :
> >>> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
> >>> 192.168.2.0     *              255.255.255.0     U      0
> >>> 0        0
> >>> eth0
> >>> loopback        *               255.0.0.0            U      0      0
> >>>  0 lo
> >>> default         .                  0.0.0.0               UG
> >>> 0      0
> >>>    0 eth0
> >>>
> >>> now i start the two tomcat with the same application in webapp
> >>> directories
> >>> with tcpdump i verify the multicasting btewen my server .. so :
> >>>
> >>> 19:39:17.809978 IP 192.168.2.102.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:18.546034 IP ovea-inspiron.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.
> >>> 45564UDP,
> >>> length 56
> >>> 19:39:19.790470 IP ovea-inspiron.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:19.818691 IP 192.168.2.102.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:20.826650 IP 192.168.2.102.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:20.943933 IP ovea-inspiron.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:21.806813 arp who-has . tell 192.168.2.102
> >>> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
> >>> 19:39:21.831048 IP 192.168.2.102.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:22.164812 IP ovea-inspiron.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>> 19:39:22.835240 IP 192.168.2.102.45564 > all-systems.mcast.net.
> >>> 45564:UDP,
> >>> length 56
> >>>
> >>> So all semms to be OK but i've
> >>>
> >>> Feb 14, 2006 6:33:26 PM
> >>> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
> >>> art
> >>> INFO: Cluster is about to start
> >>> Feb 14, 2006 6:33:26 PM
> >>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultCluster
> >>> Va
> >>> lves
> >>> INFO: Add Default ClusterValves at cluster localhost
> >>> Feb 14, 2006 6:33:26 PM
> >>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultCluster
> >>> Li
> >>> stener
> >>> INFO: Add Default ClusterListener at cluster localhost
> >>> Feb 14, 2006 6:33:26 PM
> >>> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> >>> INFO: Start ClusterSender at cluster
> >>> Catalina:type=3DCluster,host=3Dlocalhost
> >>> with name Catalina:type=3DClusterSender,host=3Dlocalhost
> >>> Feb 14, 2006 6:33:26 PM
> >>> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
> >>> INFO: Setting multihome multicast interface to:/192.168.2.102
> >>> Feb 14, 2006 6:33:26 PM
> >>> org.apache.catalina.cluster.mcast.McastService start
> >>> INFO: Sleeping for 4000 secs to establish cluster membership
> >>> Feb 14, 2006 6:33:30 PM
> >>> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
> >>> INFO: membership mbean registered
> >>> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
> >>> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig
> >>> deployWAR
> >>> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> >>> Feb 14, 2006 6:33:31 PM
> >>> org.apache.catalina.cluster.session.DeltaManager st
> >>> art
> >>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element
> >>> Host with
> >>> name localhost
> >>> Feb 14, 2006 6:33:31 PM
> >>> org.apache.catalina.cluster.session.DeltaManager st
> >>> art
> >>> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> >>> Feb 14, 2006 6:33:31 PM
> >>> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSession
> >>> s
> >>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> >>> members
> >>> active in cluster group.
> >>>
> >>> As you can see in the last line cluster member are not found !!!!
> >>>
> >>> What's the hell ;)
> >>>
> >>> When i test my application i've always the sequences :
> >>>
> >>>    This page is rendered on server : *Cluster Node - 01 (One) New
> >>> session is
> >>> created with saved value ....UserId : 123456
> >>>    This page is rendered on server : *Cluster Node - 02 (Two) New
> >>> session is
> >>> created with saved value ....UserId : 123456
> >>>    This page is rendered on server : *Cluster Node - 01 (One) New
> >>> session is
> >>> created with saved value ....UserId : 123456
> >>>
> >>> So the request is well balanced but a new session is alway
> >>> created !!!!!
> >>>
> >>> Some ideas ...
> >>>
> >>> Thank you guys
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Peter Rossbach <pr...@objektpark.de>.
Can you test your config without the parameter mcastBindAddress="xx"?


Peter



Am 15.02.2006 um 14:35 schrieb David Avenante:

> Yes MULTICAST is enabled i see that by too fact :
>
> first,
> ifconfig eth0 :
>
> eth0      Link encap:Ethernet  HWaddr 00:13:D4:45:A6:3F
>           inet addr:192.168.2.102  Bcast:192.168.2.255  Mask: 
> 255.255.255.0
>           UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST  MTU:1500
> Metric:1
>           RX packets:264493 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:292063 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:98079150 (93.5 Mb)  TX bytes:41007393 (39.1 Mb)
>
> ALLMULTI and MULTICAST is enabled on two serveur interface.
>
> second,
>
> as you see in my first post tcpdump track the UDP messages send  
> between
> server.
>
>
> For sticky_session=true i' m not agree with you.
> In the connector documentation (see
> http://tomcat.apache.org/connectors-doc/config/workers.html)
> => Set sticky_session to *False* when Tomcat is using a Session  
> Manager
> which can persist session data across multiple instances of Tomcat
> It' s my situation.
>
> So i' m alway in the trouble by thanks a lot for the verification ;)
>
>
> On 2/15/06, Peter Rossbach <pr...@objektpark.de> wrote:
>>
>> Hey,
>>
>> 1)      Clustering need sticky_session=true and is only design for
>> failover (see servlet spec).
>> 2)      Are your sure that MULTICAST is enabled at eth0?
>>
>> regards
>> Peter
>> pr@objektpark.de
>>
>>
>>
>> Am 15.02.2006 um 02:26 schrieb David Avenante:
>>
>>> Hi,
>>>
>>> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some  
>>> work on
>>> configuration and test
>>> i seems to be on limit of my all possibilities ;)
>>>
>>> I try to use two tomcat in cluster with apache web server and
>>> mod_jk as
>>> connector.
>>>
>>> my Apache configuration look like :
>>>
>>>
>>> # workers.properties
>>>
>>> ps=/
>>>
>>> # List the workers name
>>> worker.list=loadbalancer
>>>
>>> # ----------------
>>> # First worker
>>> # ----------------
>>> worker.node01.port=8009
>>> worker.node01.host=agnes
>>> worker.node01.type=ajp13
>>> worker.node01.lbfactor=1
>>> #worker.node01.domain=cluster1
>>> # ----------------
>>> # Second worker
>>> # ----------------
>>> worker.node02.port=9009
>>> worker.node02.host=ovea-inspiron
>>> worker.node02.type=ajp13
>>> worker.node02.lbfactor=1
>>> #worker.node02.domain=cluster1
>>> # ----------------------
>>> # Load Balancer worker
>>> # ----------------------
>>> worker.loadbalancer.type=lb
>>> worker.loadbalancer.sticky_session=false
>>> worker.loadbalancer.balanced_workers=node01,node02
>>>
>>> As you can see i use two server ('agnes' IP : 192.168.2.102 and
>>> 'ovea-inspiron' IP : 192.168.2.103)
>>> I' ve coded a little aplication who read un file and create a
>>> sessions if
>>> session not exist.
>>>
>>> If i use the system in mod load balancing (with no cluster mod
>>> activate)
>>> all is great (my config is of course
>>> worker.loadbalancer.sticky_session=true
>>> )
>>>
>>> So system run with session affinitu but the two server are
>>> accessible ;)
>>>
>>> Now i try to configure as cluster mode with session replication
>>> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
>>>
>>> I configure my to server.xml like that :
>>> agnes (IP : 192.168.2.102)
>>>
>>> <Server port="8005" shutdown="SHUTDOWN">
>>>   <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" maxHttpHeaderSize="8192"
>>>                       maxThreads="150" minSpareThreads="25"
>>>                       maxSpareThreads="75"
>>>                       enableLookups="false" redirectPort="8443"
>>> acceptCount="100"
>>>                       connectionTimeout="20000"
>>> disableUploadTimeout="true"
>>> />
>>>
>>>     <Connector port="8009" enableLookups="false"
>>>                       redirectPort="8443" protocol="AJP/1.3" />
>>>
>>>     <Engine name="Catalina" defaultHost="localhost"
>>> jvmRoute="node01" >
>>>
>>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>>                    resourceName="UserDatabase" />
>>>
>>>       <Host name="localhost" appBase="webapps"
>>>                unpackWARs="true" autoDeploy="true"
>>>                xmlValidation="false" xmlNamespaceAware="false">
>>>      <Cluster
>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>>                   doClusterLog="true"
>>>                   clusterLogName="clusterlog"
>>>                   manager.className="
>>> org.apache.catalina.cluster.session.DeltaManager"
>>>                   manager.expireSessionsOnShutdown="false"
>>>                   manager.notifyListenersOnReplication="true"
>>>                   manager.notifySessionListenersOnReplication="true"
>>>                   manager.sendAllSessions="true"
>>>                   manager.sendAllSessionsSize="500"
>>>                   manager.sendAllSessionsWaitTime="20">
>>>
>>>         <Membership className="
>>> org.apache.catalina.cluster.mcast.McastService"
>>>                              mcastBindAddress="192.168.2.102"
>>>                              mcastAddr="224.0.0.1"
>>>                              mcastPort="45564"
>>>                              mcastFrequency="1000"
>>>                              mcastDropTime="30000"/>
>>>
>>>         <Receiver className="
>>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>>                          tcpListenAddress="192.168.2.102"
>>>                          tcpListenPort="4000"
>>>                          tcpSelectorTimeout="100"
>>>                          tcpThreadCount="6" />
>>>
>>>         <Sender className="
>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>>                       replicationMode="fastasyncqueue"
>>>                       doTransmitterProcessingStats="true"
>>>                       doProcessingStats="true"
>>>                       doWaitAckStats="true"
>>>                       queueTimeWait="true"
>>>                       queueDoStats="true"
>>>                       queueCheckLock="true"
>>>                       ackTimeout="15000"
>>>                       waitForAck="true"
>>>                       keepAliveTimeout="80000"
>>>                       keepAliveMaxRequestCount="-1" />
>>>
>>>       </Host>
>>>     </Engine>
>>>   </Service>
>>> </Server>
>>>
>>>
>>> ovea-inspiron (IP : 192.168.2.103)
>>> <Server port="9005" shutdown="SHUTDOWN">
>>>
>>>   <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="9080" maxHttpHeaderSize="8192"
>>>                      maxThreads="150" minSpareThreads="25"
>>>                      maxSpareThreads="75"
>>>                      enableLookups="false" redirectPort="8443"
>>>                      acceptCount="100"
>>>                      connectionTimeout="20000"
>>> disableUploadTimeout="true"
>>> />
>>>
>>>    <Connector port="9009" enableLookups="false"
>>>                      redirectPort="8443" protocol="AJP/1.3" />
>>>
>>>    <Engine name="Catalina" defaultHost="localhost"  
>>> jvmRoute="node02" >
>>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>>                   resourceName="UserDatabase"/>
>>>
>>>      <Host name="localhost" appBase="webapps"
>>>               unpackWARs="true" autoDeploy="true"
>>>               xmlValidation="false" xmlNamespaceAware="false">
>>>
>>>      <Cluster
>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>>                   doClusterLog="true"
>>>                   clusterLogName="clusterlog"
>>>                   manager.className="
>>> org.apache.catalina.cluster.session.DeltaManager"
>>>                   manager.expireSessionsOnShutdown="false"
>>>                   manager.notifyListenersOnReplication="true"
>>>                   manager.notifySessionListenersOnReplication="true"
>>>                   manager.sendAllSessions="true"
>>>                   manager.sendAllSessionsSize="500"
>>>                   manager.sendAllSessionsWaitTime="20">
>>>
>>>         <Membership className="
>>> org.apache.catalina.cluster.mcast.McastService"
>>>                              mcastBindAddress="192.168.2.103"
>>>                              mcastAddr="224.0.0.1"
>>>                              mcastPort="45564"
>>>                              mcastFrequency="1000"
>>>                              mcastDropTime="30000"/>
>>>
>>>         <Receiver className="
>>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>>                         tcpListenAddress="192.168.2.103"
>>>                         tcpListenPort="4000"
>>>                         tcpSelectorTimeout="100"
>>>                         tcpThreadCount="6" />
>>>
>>>         <Sender className="
>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>>                       replicationMode="fastasyncqueue"
>>>                       doTransmitterProcessingStats="true"
>>>                       doProcessingStats="true"
>>>                       doWaitAckStats="true"
>>>                       queueTimeWait="true"
>>>                       queueDoStats="true"
>>>                       queueCheckLock="true"
>>>                       ackTimeout="15000"
>>>                       waitForAck="true"
>>>                       keepAliveTimeout="80000"
>>>                       keepAliveMaxRequestCount="-1" />
>>>
>>>       </Host>
>>>     </Engine>
>>>   </Service>
>>> </Server>
>>>
>>>
>>> I'm user linux so i've compiled my kernel with multicat kernel  
>>> option
>>> I add the rout like rooute add -host 224.0.0.1 dev eth0
>>>
>>> N.B : why 224.0.0.1 => http://www.iana.org/assignments/multicast-
>>> addresses
>>>
>>> So route is :
>>> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
>>> 192.168.2.0     *              255.255.255.0     U      0
>>> 0        0
>>> eth0
>>> loopback        *               255.0.0.0            U      0      0
>>>  0 lo
>>> default         .                  0.0.0.0               UG
>>> 0      0
>>>    0 eth0
>>>
>>> now i start the two tomcat with the same application in webapp
>>> directories
>>> with tcpdump i verify the multicasting btewen my server .. so :
>>>
>>> 19:39:17.809978 IP 192.168.2.102.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:18.546034 IP ovea-inspiron.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.
>>> 45564UDP,
>>> length 56
>>> 19:39:19.790470 IP ovea-inspiron.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:19.818691 IP 192.168.2.102.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:20.826650 IP 192.168.2.102.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:20.943933 IP ovea-inspiron.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:21.806813 arp who-has . tell 192.168.2.102
>>> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
>>> 19:39:21.831048 IP 192.168.2.102.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:22.164812 IP ovea-inspiron.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>> 19:39:22.835240 IP 192.168.2.102.45564 > all-systems.mcast.net.
>>> 45564:UDP,
>>> length 56
>>>
>>> So all semms to be OK but i've
>>>
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
>>> art
>>> INFO: Cluster is about to start
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultCluster 
>>> Va
>>> lves
>>> INFO: Add Default ClusterValves at cluster localhost
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultCluster 
>>> Li
>>> stener
>>> INFO: Add Default ClusterListener at cluster localhost
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
>>> INFO: Start ClusterSender at cluster
>>> Catalina:type=3DCluster,host=3Dlocalhost
>>> with name Catalina:type=3DClusterSender,host=3Dlocalhost
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
>>> INFO: Setting multihome multicast interface to:/192.168.2.102
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.mcast.McastService start
>>> INFO: Sleeping for 4000 secs to establish cluster membership
>>> Feb 14, 2006 6:33:30 PM
>>> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
>>> INFO: membership mbean registered
>>> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
>>> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig
>>> deployWAR
>>> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
>>> Feb 14, 2006 6:33:31 PM
>>> org.apache.catalina.cluster.session.DeltaManager st
>>> art
>>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element
>>> Host with
>>> name localhost
>>> Feb 14, 2006 6:33:31 PM
>>> org.apache.catalina.cluster.session.DeltaManager st
>>> art
>>> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
>>> Feb 14, 2006 6:33:31 PM
>>> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSession 
>>> s
>>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
>>> members
>>> active in cluster group.
>>>
>>> As you can see in the last line cluster member are not found !!!!
>>>
>>> What's the hell ;)
>>>
>>> When i test my application i've always the sequences :
>>>
>>>    This page is rendered on server : *Cluster Node - 01 (One) New
>>> session is
>>> created with saved value ....UserId : 123456
>>>    This page is rendered on server : *Cluster Node - 02 (Two) New
>>> session is
>>> created with saved value ....UserId : 123456
>>>    This page is rendered on server : *Cluster Node - 01 (One) New
>>> session is
>>> created with saved value ....UserId : 123456
>>>
>>> So the request is well balanced but a new session is alway
>>> created !!!!!
>>>
>>> Some ideas ...
>>>
>>> Thank you guys
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
Yes MULTICAST is enabled i see that by too fact :

first,
ifconfig eth0 :

eth0      Link encap:Ethernet  HWaddr 00:13:D4:45:A6:3F
          inet addr:192.168.2.102  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST  MTU:1500
Metric:1
          RX packets:264493 errors:0 dropped:0 overruns:0 frame:0
          TX packets:292063 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:98079150 (93.5 Mb)  TX bytes:41007393 (39.1 Mb)

ALLMULTI and MULTICAST is enabled on two serveur interface.

second,

as you see in my first post tcpdump track the UDP messages send between
server.


For sticky_session=true i' m not agree with you.
In the connector documentation (see
http://tomcat.apache.org/connectors-doc/config/workers.html)
=> Set sticky_session to *False* when Tomcat is using a Session Manager
which can persist session data across multiple instances of Tomcat
It' s my situation.

So i' m alway in the trouble by thanks a lot for the verification ;)


On 2/15/06, Peter Rossbach <pr...@objektpark.de> wrote:
>
> Hey,
>
> 1)      Clustering need sticky_session=true and is only design for
> failover (see servlet spec).
> 2)      Are your sure that MULTICAST is enabled at eth0?
>
> regards
> Peter
> pr@objektpark.de
>
>
>
> Am 15.02.2006 um 02:26 schrieb David Avenante:
>
> > Hi,
> >
> > I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
> > configuration and test
> > i seems to be on limit of my all possibilities ;)
> >
> > I try to use two tomcat in cluster with apache web server and
> > mod_jk as
> > connector.
> >
> > my Apache configuration look like :
> >
> >
> > # workers.properties
> >
> > ps=/
> >
> > # List the workers name
> > worker.list=loadbalancer
> >
> > # ----------------
> > # First worker
> > # ----------------
> > worker.node01.port=8009
> > worker.node01.host=agnes
> > worker.node01.type=ajp13
> > worker.node01.lbfactor=1
> > #worker.node01.domain=cluster1
> > # ----------------
> > # Second worker
> > # ----------------
> > worker.node02.port=9009
> > worker.node02.host=ovea-inspiron
> > worker.node02.type=ajp13
> > worker.node02.lbfactor=1
> > #worker.node02.domain=cluster1
> > # ----------------------
> > # Load Balancer worker
> > # ----------------------
> > worker.loadbalancer.type=lb
> > worker.loadbalancer.sticky_session=false
> > worker.loadbalancer.balanced_workers=node01,node02
> >
> > As you can see i use two server ('agnes' IP : 192.168.2.102 and
> > 'ovea-inspiron' IP : 192.168.2.103)
> > I' ve coded a little aplication who read un file and create a
> > sessions if
> > session not exist.
> >
> > If i use the system in mod load balancing (with no cluster mod
> > activate)
> > all is great (my config is of course
> > worker.loadbalancer.sticky_session=true
> > )
> >
> > So system run with session affinitu but the two server are
> > accessible ;)
> >
> > Now i try to configure as cluster mode with session replication
> > (my config is now worker.loadbalancer.sticky_session=3Dfalse)
> >
> > I configure my to server.xml like that :
> > agnes (IP : 192.168.2.102)
> >
> > <Server port="8005" shutdown="SHUTDOWN">
> >   <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" maxHttpHeaderSize="8192"
> >                       maxThreads="150" minSpareThreads="25"
> >                       maxSpareThreads="75"
> >                       enableLookups="false" redirectPort="8443"
> > acceptCount="100"
> >                       connectionTimeout="20000"
> > disableUploadTimeout="true"
> > />
> >
> >     <Connector port="8009" enableLookups="false"
> >                       redirectPort="8443" protocol="AJP/1.3" />
> >
> >     <Engine name="Catalina" defaultHost="localhost"
> > jvmRoute="node01" >
> >
> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >                    resourceName="UserDatabase" />
> >
> >       <Host name="localhost" appBase="webapps"
> >                unpackWARs="true" autoDeploy="true"
> >                xmlValidation="false" xmlNamespaceAware="false">
> >      <Cluster
> > className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >                   doClusterLog="true"
> >                   clusterLogName="clusterlog"
> >                   manager.className="
> > org.apache.catalina.cluster.session.DeltaManager"
> >                   manager.expireSessionsOnShutdown="false"
> >                   manager.notifyListenersOnReplication="true"
> >                   manager.notifySessionListenersOnReplication="true"
> >                   manager.sendAllSessions="true"
> >                   manager.sendAllSessionsSize="500"
> >                   manager.sendAllSessionsWaitTime="20">
> >
> >         <Membership className="
> > org.apache.catalina.cluster.mcast.McastService"
> >                              mcastBindAddress="192.168.2.102"
> >                              mcastAddr="224.0.0.1"
> >                              mcastPort="45564"
> >                              mcastFrequency="1000"
> >                              mcastDropTime="30000"/>
> >
> >         <Receiver className="
> > org.apache.catalina.cluster.tcp.ReplicationListener"
> >                          tcpListenAddress="192.168.2.102"
> >                          tcpListenPort="4000"
> >                          tcpSelectorTimeout="100"
> >                          tcpThreadCount="6" />
> >
> >         <Sender className="
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >                       replicationMode="fastasyncqueue"
> >                       doTransmitterProcessingStats="true"
> >                       doProcessingStats="true"
> >                       doWaitAckStats="true"
> >                       queueTimeWait="true"
> >                       queueDoStats="true"
> >                       queueCheckLock="true"
> >                       ackTimeout="15000"
> >                       waitForAck="true"
> >                       keepAliveTimeout="80000"
> >                       keepAliveMaxRequestCount="-1" />
> >
> >       </Host>
> >     </Engine>
> >   </Service>
> > </Server>
> >
> >
> > ovea-inspiron (IP : 192.168.2.103)
> > <Server port="9005" shutdown="SHUTDOWN">
> >
> >   <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="9080" maxHttpHeaderSize="8192"
> >                      maxThreads="150" minSpareThreads="25"
> >                      maxSpareThreads="75"
> >                      enableLookups="false" redirectPort="8443"
> >                      acceptCount="100"
> >                      connectionTimeout="20000"
> > disableUploadTimeout="true"
> > />
> >
> >    <Connector port="9009" enableLookups="false"
> >                      redirectPort="8443" protocol="AJP/1.3" />
> >
> >    <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02" >
> >      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >                   resourceName="UserDatabase"/>
> >
> >      <Host name="localhost" appBase="webapps"
> >               unpackWARs="true" autoDeploy="true"
> >               xmlValidation="false" xmlNamespaceAware="false">
> >
> >      <Cluster
> > className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >                   doClusterLog="true"
> >                   clusterLogName="clusterlog"
> >                   manager.className="
> > org.apache.catalina.cluster.session.DeltaManager"
> >                   manager.expireSessionsOnShutdown="false"
> >                   manager.notifyListenersOnReplication="true"
> >                   manager.notifySessionListenersOnReplication="true"
> >                   manager.sendAllSessions="true"
> >                   manager.sendAllSessionsSize="500"
> >                   manager.sendAllSessionsWaitTime="20">
> >
> >         <Membership className="
> > org.apache.catalina.cluster.mcast.McastService"
> >                              mcastBindAddress="192.168.2.103"
> >                              mcastAddr="224.0.0.1"
> >                              mcastPort="45564"
> >                              mcastFrequency="1000"
> >                              mcastDropTime="30000"/>
> >
> >         <Receiver className="
> > org.apache.catalina.cluster.tcp.ReplicationListener"
> >                         tcpListenAddress="192.168.2.103"
> >                         tcpListenPort="4000"
> >                         tcpSelectorTimeout="100"
> >                         tcpThreadCount="6" />
> >
> >         <Sender className="
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >                       replicationMode="fastasyncqueue"
> >                       doTransmitterProcessingStats="true"
> >                       doProcessingStats="true"
> >                       doWaitAckStats="true"
> >                       queueTimeWait="true"
> >                       queueDoStats="true"
> >                       queueCheckLock="true"
> >                       ackTimeout="15000"
> >                       waitForAck="true"
> >                       keepAliveTimeout="80000"
> >                       keepAliveMaxRequestCount="-1" />
> >
> >       </Host>
> >     </Engine>
> >   </Service>
> > </Server>
> >
> >
> > I'm user linux so i've compiled my kernel with multicat kernel option
> > I add the rout like rooute add -host 224.0.0.1 dev eth0
> >
> > N.B : why 224.0.0.1 => http://www.iana.org/assignments/multicast-
> > addresses
> >
> > So route is :
> > ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
> > 192.168.2.0     *              255.255.255.0     U      0
> > 0        0
> > eth0
> > loopback        *               255.0.0.0            U      0      0
> >  0 lo
> > default         .                  0.0.0.0               UG
> > 0      0
> >    0 eth0
> >
> > now i start the two tomcat with the same application in webapp
> > directories
> > with tcpdump i verify the multicasting btewen my server .. so :
> >
> > 19:39:17.809978 IP 192.168.2.102.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:18.546034 IP ovea-inspiron.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.
> > 45564UDP,
> > length 56
> > 19:39:19.790470 IP ovea-inspiron.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:19.818691 IP 192.168.2.102.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:20.826650 IP 192.168.2.102.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:20.943933 IP ovea-inspiron.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:21.806813 arp who-has . tell 192.168.2.102
> > 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
> > 19:39:21.831048 IP 192.168.2.102.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:22.164812 IP ovea-inspiron.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> > 19:39:22.835240 IP 192.168.2.102.45564 > all-systems.mcast.net.
> > 45564:UDP,
> > length 56
> >
> > So all semms to be OK but i've
> >
> > Feb 14, 2006 6:33:26 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpCluster st
> > art
> > INFO: Cluster is about to start
> > Feb 14, 2006 6:33:26 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterVa
> > lves
> > INFO: Add Default ClusterValves at cluster localhost
> > Feb 14, 2006 6:33:26 PM
> > org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterLi
> > stener
> > INFO: Add Default ClusterListener at cluster localhost
> > Feb 14, 2006 6:33:26 PM
> > org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> > INFO: Start ClusterSender at cluster
> > Catalina:type=3DCluster,host=3Dlocalhost
> > with name Catalina:type=3DClusterSender,host=3Dlocalhost
> > Feb 14, 2006 6:33:26 PM
> > org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
> > INFO: Setting multihome multicast interface to:/192.168.2.102
> > Feb 14, 2006 6:33:26 PM
> > org.apache.catalina.cluster.mcast.McastService start
> > INFO: Sleeping for 4000 secs to establish cluster membership
> > Feb 14, 2006 6:33:30 PM
> > org.apache.catalina.cluster.mcast.McastServiceregisterMBean
> > INFO: membership mbean registered
> > (Catalina:type=3DClusterMembership,host=3Dlocalhost)
> > Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig
> > deployWAR
> > INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> > Feb 14, 2006 6:33:31 PM
> > org.apache.catalina.cluster.session.DeltaManager st
> > art
> > INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element
> > Host with
> > name localhost
> > Feb 14, 2006 6:33:31 PM
> > org.apache.catalina.cluster.session.DeltaManager st
> > art
> > INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> > Feb 14, 2006 6:33:31 PM
> > org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
> > INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> > members
> > active in cluster group.
> >
> > As you can see in the last line cluster member are not found !!!!
> >
> > What's the hell ;)
> >
> > When i test my application i've always the sequences :
> >
> >    This page is rendered on server : *Cluster Node - 01 (One) New
> > session is
> > created with saved value ....UserId : 123456
> >    This page is rendered on server : *Cluster Node - 02 (Two) New
> > session is
> > created with saved value ....UserId : 123456
> >    This page is rendered on server : *Cluster Node - 01 (One) New
> > session is
> > created with saved value ....UserId : 123456
> >
> > So the request is well balanced but a new session is alway
> > created !!!!!
> >
> > Some ideas ...
> >
> > Thank you guys
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
I try it and the multicast seems OK ?

On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> It is a multicast problem, your second box is not receiving any
> multicast messages, only from itself.
>
> To run this test properly, you will need to shutdown your tomcats, then
> run MCaster on both machines at the same time,
> if both machines are not receiving messages from each other (like your
> example below) then you have a multicast problem
>
> Filip
>
>
> David Avenante wrote:
> > Thank you very much for the toolkit ;)
> > My feeling was also on my multicast support.
> > But i' ve read more documentation for my Linux
> > and i think that my servers support MULTICAST like
> > explaned on my first message (compile kernel support
> > and add route + test with tcpdump)
> >
> > So this toolkit seems confirme the fact that my servers support
> multicast.
> > When i test on agnes with target ovea-inspiron i've:
> >
> > java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
> > Usage MCaster [address port message]
> > BEGIN TO RECEIVE
> > SENT:ovea-inspiron1
> > RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
> > SENT:ovea-inspiron2
> > BEGIN TO RECEIVE
> > RECEIVED:(gtcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
> > SENT:ovea-inspiron3
> > BEGIN TO RECEIVE
> > RECEIVED:(ftcp://192.168.2.102:400catalina FROM /192.168.2.102:45564
> > SENT:ovea-inspiron4
> > BEGIN TO RECEIVE
> > RECEIVED:(gtcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
> >
> > And when i test on ovea-inspiron with target agnes i've:
> > java -cp tomcat-replication.jar MCaster 224.0.0.1 <http://228.1.2.3/>
> 45566
> > agnes
> >  Usage MCaster [address port message]
> > BEGIN TO RECEIVE
> > SENT:agnes1
> > RECEIVED:agnes1 FROM /192.168.2.103:45566
> > SENT:agnes2
> > BEGIN TO RECEIVE
> > RECEIVED:agnes2 FROM /192.168.2.103:45566
> > SENT:agnes3
> > BEGIN TO RECEIVE
> > RECEIVED:agnes3 FROM /192.168.2.103:45566
> > SENT:agnes4
> > BEGIN TO RECEIVE
> > RECEIVED:agnes4 FROM /192.168.2.103:45566
> > SENT:agnes5
> > BEGIN TO RECEIVE
> > RECEIVED:agnes5 FROM /192.168.2.103:45566
> > SENT:agnes6
> > BEGIN TO RECEIVE
> > RECEIVED:agnes6 FROM /192.168.2.103:45566
> > SENT:agnes7
> > BEGIN TO RECEIVE
> > RECEIVED:agnes7 FROM /192.168.2.103:45566
> >
> > So it's not a multicast probleme but most a configuration probleme.
> > ovea-inspiron sent is ok but the received is empty ?
> > Some suggestion(s) ?
> >
> > Thank's for the progress
> >
> > On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
> >
> >>> 1)    Clustering need sticky_session=true and is only design for
> >>>
> >> failover (see servlet spec).
> >>
> >> Not true for Tomcat, using replicationMode="pooled" and
> >> waitForAck="true", you can do round robin non sticky load balancing as
> >> long as you don't have more than one thread accessing the session at
> any
> >> point in time.
> >>
> >>
> >>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> >>>
> >> members active in cluster group.
> >>
> >> yes, your multicast isn't working, or it should have said that you had
> a
> >> member.
> >> Take a look at the bottom of the page and run the MCaster test included
> >> in a super old version of Tomcat 4 clustering.
> >> http://people.apache.org/~fhanik/
> >>
> >> On multihomed hosts, it can get a little tricky to get multicasting
> >> working and you might have to setup some routes to help. Check with
> your
> >> sysadmin.
> >>
> >> Filip
> >>
> >>
> >>
> >> Peter Rossbach wrote:
> >>
> >>> Hey,
> >>>
> >>> 1)    Clustering need sticky_session=true and is only design for
> >>> failover (see servlet spec).
> >>> 2)    Are your sure that MULTICAST is enabled at eth0?
> >>>
> >>> regards
> >>> Peter
> >>> pr@objektpark.de
> >>>
> >>>
> >>>
> >>> Am 15.02.2006 um 02:26 schrieb David Avenante:
> >>>
> >>>
> >>>> Hi,
> >>>>
> >>>> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
> >>>> configuration and test
> >>>> i seems to be on limit of my all possibilities ;)
> >>>>
> >>>> I try to use two tomcat in cluster with apache web server and mod_jk
> as
> >>>> connector.
> >>>>
> >>>> my Apache configuration look like :
> >>>>
> >>>>
> >>>> # workers.properties
> >>>>
> >>>> ps=/
> >>>>
> >>>> # List the workers name
> >>>> worker.list=loadbalancer
> >>>>
> >>>> # ----------------
> >>>> # First worker
> >>>> # ----------------
> >>>> worker.node01.port=8009
> >>>> worker.node01.host=agnes
> >>>> worker.node01.type=ajp13
> >>>> worker.node01.lbfactor=1
> >>>> #worker.node01.domain=cluster1
> >>>> # ----------------
> >>>> # Second worker
> >>>> # ----------------
> >>>> worker.node02.port=9009
> >>>> worker.node02.host=ovea-inspiron
> >>>> worker.node02.type=ajp13
> >>>> worker.node02.lbfactor=1
> >>>> #worker.node02.domain=cluster1
> >>>> # ----------------------
> >>>> # Load Balancer worker
> >>>> # ----------------------
> >>>> worker.loadbalancer.type=lb
> >>>> worker.loadbalancer.sticky_session=false
> >>>> worker.loadbalancer.balanced_workers=node01,node02
> >>>>
> >>>> As you can see i use two server ('agnes' IP : 192.168.2.102 and
> >>>> 'ovea-inspiron' IP : 192.168.2.103)
> >>>> I' ve coded a little aplication who read un file and create a
> >>>> sessions if
> >>>> session not exist.
> >>>>
> >>>> If i use the system in mod load balancing (with no cluster mod
> >>>>
> >> activate)
> >>
> >>>> all is great (my config is of course
> >>>> worker.loadbalancer.sticky_session=true
> >>>> )
> >>>>
> >>>> So system run with session affinitu but the two server are accessible
> >>>>
> >> ;)
> >>
> >>>> Now i try to configure as cluster mode with session replication
> >>>> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
> >>>>
> >>>> I configure my to server.xml like that :
> >>>> agnes (IP : 192.168.2.102)
> >>>>
> >>>> <Server port="8005" shutdown="SHUTDOWN">
> >>>>   <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" maxHttpHeaderSize="8192"
> >>>>                       maxThreads="150" minSpareThreads="25"
> >>>>                       maxSpareThreads="75"
> >>>>                       enableLookups="false" redirectPort="8443"
> >>>> acceptCount="100"
> >>>>                       connectionTimeout="20000"
> >>>> disableUploadTimeout="true"
> >>>> />
> >>>>
> >>>>     <Connector port="8009" enableLookups="false"
> >>>>                       redirectPort="8443" protocol="AJP/1.3" />
> >>>>
> >>>>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="node01"
> >
> >>>>
> >>>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>>>                    resourceName="UserDatabase" />
> >>>>
> >>>>       <Host name="localhost" appBase="webapps"
> >>>>                unpackWARs="true" autoDeploy="true"
> >>>>                xmlValidation="false" xmlNamespaceAware="false">
> >>>>      <Cluster
> >>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >>>>                   doClusterLog="true"
> >>>>                   clusterLogName="clusterlog"
> >>>>                   manager.className="
> >>>> org.apache.catalina.cluster.session.DeltaManager"
> >>>>                   manager.expireSessionsOnShutdown="false"
> >>>>                   manager.notifyListenersOnReplication="true"
> >>>>                   manager.notifySessionListenersOnReplication="true"
> >>>>                   manager.sendAllSessions="true"
> >>>>                   manager.sendAllSessionsSize="500"
> >>>>                   manager.sendAllSessionsWaitTime="20">
> >>>>
> >>>>         <Membership className="
> >>>> org.apache.catalina.cluster.mcast.McastService"
> >>>>                              mcastBindAddress="192.168.2.102"
> >>>>                              mcastAddr="224.0.0.1"
> >>>>                              mcastPort="45564"
> >>>>                              mcastFrequency="1000"
> >>>>                              mcastDropTime="30000"/>
> >>>>
> >>>>         <Receiver className="
> >>>> org.apache.catalina.cluster.tcp.ReplicationListener"
> >>>>                          tcpListenAddress="192.168.2.102"
> >>>>                          tcpListenPort="4000"
> >>>>                          tcpSelectorTimeout="100"
> >>>>                          tcpThreadCount="6" />
> >>>>
> >>>>         <Sender className="
> >>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >>>>                       replicationMode="fastasyncqueue"
> >>>>                       doTransmitterProcessingStats="true"
> >>>>                       doProcessingStats="true"
> >>>>                       doWaitAckStats="true"
> >>>>                       queueTimeWait="true"
> >>>>                       queueDoStats="true"
> >>>>                       queueCheckLock="true"
> >>>>                       ackTimeout="15000"
> >>>>                       waitForAck="true"
> >>>>                       keepAliveTimeout="80000"
> >>>>                       keepAliveMaxRequestCount="-1" />
> >>>>
> >>>>       </Host>
> >>>>     </Engine>
> >>>>   </Service>
> >>>> </Server>
> >>>>
> >>>>
> >>>> ovea-inspiron (IP : 192.168.2.103)
> >>>> <Server port="9005" shutdown="SHUTDOWN">
> >>>>
> >>>>   <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="9080" maxHttpHeaderSize="8192"
> >>>>                      maxThreads="150" minSpareThreads="25"
> >>>>                      maxSpareThreads="75"
> >>>>                      enableLookups="false" redirectPort="8443"
> >>>>                      acceptCount="100"
> >>>>                      connectionTimeout="20000"
> >>>> disableUploadTimeout="true"
> >>>> />
> >>>>
> >>>>    <Connector port="9009" enableLookups="false"
> >>>>                      redirectPort="8443" protocol="AJP/1.3" />
> >>>>
> >>>>    <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02"
> >
> >>>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>>>                   resourceName="UserDatabase"/>
> >>>>
> >>>>      <Host name="localhost" appBase="webapps"
> >>>>               unpackWARs="true" autoDeploy="true"
> >>>>               xmlValidation="false" xmlNamespaceAware="false">
> >>>>
> >>>>      <Cluster
> >>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >>>>                   doClusterLog="true"
> >>>>                   clusterLogName="clusterlog"
> >>>>                   manager.className="
> >>>> org.apache.catalina.cluster.session.DeltaManager"
> >>>>                   manager.expireSessionsOnShutdown="false"
> >>>>                   manager.notifyListenersOnReplication="true"
> >>>>                   manager.notifySessionListenersOnReplication="true"
> >>>>                   manager.sendAllSessions="true"
> >>>>                   manager.sendAllSessionsSize="500"
> >>>>                   manager.sendAllSessionsWaitTime="20">
> >>>>
> >>>>         <Membership className="
> >>>> org.apache.catalina.cluster.mcast.McastService"
> >>>>                              mcastBindAddress="192.168.2.103"
> >>>>                              mcastAddr="224.0.0.1"
> >>>>                              mcastPort="45564"
> >>>>                              mcastFrequency="1000"
> >>>>                              mcastDropTime="30000"/>
> >>>>
> >>>>         <Receiver className="
> >>>> org.apache.catalina.cluster.tcp.ReplicationListener"
> >>>>                         tcpListenAddress="192.168.2.103"
> >>>>                         tcpListenPort="4000"
> >>>>                         tcpSelectorTimeout="100"
> >>>>                         tcpThreadCount="6" />
> >>>>
> >>>>         <Sender className="
> >>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >>>>                       replicationMode="fastasyncqueue"
> >>>>                       doTransmitterProcessingStats="true"
> >>>>                       doProcessingStats="true"
> >>>>                       doWaitAckStats="true"
> >>>>                       queueTimeWait="true"
> >>>>                       queueDoStats="true"
> >>>>                       queueCheckLock="true"
> >>>>                       ackTimeout="15000"
> >>>>                       waitForAck="true"
> >>>>                       keepAliveTimeout="80000"
> >>>>                       keepAliveMaxRequestCount="-1" />
> >>>>
> >>>>       </Host>
> >>>>     </Engine>
> >>>>   </Service>
> >>>> </Server>
> >>>>
> >>>>
> >>>> I'm user linux so i've compiled my kernel with multicat kernel option
> >>>> I add the rout like rooute add -host 224.0.0.1 dev eth0
> >>>>
> >>>> N.B : why 224.0.0.1 =>
> >>>> http://www.iana.org/assignments/multicast-addresses
> >>>>
> >>>> So route is :
> >>>> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
> >>>> 192.168.2.0     *              255.255.255.0     U      0
> >>>> 0        0
> >>>> eth0
> >>>> loopback        *               255.0.0.0            U      0      0
> >>>>  0 lo
> >>>> default         .                  0.0.0.0
> UG    0      0
> >>>>    0 eth0
> >>>>
> >>>> now i start the two tomcat with the same application in webapp
> >>>> directories
> >>>> with tcpdump i verify the multicasting btewen my server .. so :
> >>>>
> >>>> 19:39:17.809978 IP 192.168.2.102.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:18.546034 IP ovea-inspiron.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:18.814418 IP 192.168.2.102.45564 >
> all-systems.mcast.net.45564UDP
> >>>>
> >> ,
> >>
> >>>> length 56
> >>>> 19:39:19.790470 IP ovea-inspiron.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:19.818691 IP 192.168.2.102.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:20.826650 IP 192.168.2.102.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:20.943933 IP ovea-inspiron.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:21.806813 arp who-has . tell 192.168.2.102
> >>>> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
> >>>> 19:39:21.831048 IP 192.168.2.102.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:22.164812 IP ovea-inspiron.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>> 19:39:22.835240 IP 192.168.2.102.45564 >
> >>>> all-systems.mcast.net.45564:UDP,
> >>>> length 56
> >>>>
> >>>> So all semms to be OK but i've
> >>>>
> >>>> Feb 14, 2006 6:33:26 PM
> >>>> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
> >>>> art
> >>>> INFO: Cluster is about to start
> >>>> Feb 14, 2006 6:33:26 PM
> >>>>
> >>>>
> >>
> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterValves
> >>
> >>>> INFO: Add Default ClusterValves at cluster localhost
> >>>> Feb 14, 2006 6:33:26 PM
> >>>>
> >>>>
> >>
> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterListener
> >>
> >>>> INFO: Add Default ClusterListener at cluster localhost
> >>>> Feb 14, 2006 6:33:26 PM
> >>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> >>>> INFO: Start ClusterSender at cluster
> >>>> Catalina:type=3DCluster,host=3Dlocalhost
> >>>> with name Catalina:type=3DClusterSender,host=3Dlocalhost
> >>>> Feb 14, 2006 6:33:26 PM
> >>>> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
> >>>> INFO: Setting multihome multicast interface to:/192.168.2.102
> >>>> Feb 14, 2006 6:33:26 PM
> >>>> org.apache.catalina.cluster.mcast.McastService start
> >>>> INFO: Sleeping for 4000 secs to establish cluster membership
> >>>> Feb 14, 2006 6:33:30 PM
> >>>> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
> >>>> INFO: membership mbean registered
> >>>> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
> >>>> Feb 14, 2006 6:33:31 PM
> org.apache.catalina.startup.HostConfigdeployWAR
> >>>> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> >>>> Feb 14, 2006 6:33:31 PM
> >>>> org.apache.catalina.cluster.session.DeltaManager st
> >>>> art
> >>>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> >>>> with
> >>>> name localhost
> >>>> Feb 14, 2006 6:33:31 PM
> >>>> org.apache.catalina.cluster.session.DeltaManager st
> >>>> art
> >>>> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> >>>> Feb 14, 2006 6:33:31 PM
> >>>> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
> >>>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> >>>> members
> >>>> active in cluster group.
> >>>>
> >>>> As you can see in the last line cluster member are not found !!!!
> >>>>
> >>>> What's the hell ;)
> >>>>
> >>>> When i test my application i've always the sequences :
> >>>>
> >>>>    This page is rendered on server : *Cluster Node - 01 (One) New
> >>>> session is
> >>>> created with saved value ....UserId : 123456
> >>>>    This page is rendered on server : *Cluster Node - 02 (Two) New
> >>>> session is
> >>>> created with saved value ....UserId : 123456
> >>>>    This page is rendered on server : *Cluster Node - 01 (One) New
> >>>> session is
> >>>> created with saved value ....UserId : 123456
> >>>>
> >>>> So the request is well balanced but a new session is alway created
> >>>>
> >> !!!!!
> >>
> >>>> Some ideas ...
> >>>>
> >>>> Thank you guys
> >>>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
It is a multicast problem, your second box is not receiving any 
multicast messages, only from itself.

To run this test properly, you will need to shutdown your tomcats, then 
run MCaster on both machines at the same time,
if both machines are not receiving messages from each other (like your 
example below) then you have a multicast problem

Filip


David Avenante wrote:
> Thank you very much for the toolkit ;)
> My feeling was also on my multicast support.
> But i' ve read more documentation for my Linux
> and i think that my servers support MULTICAST like
> explaned on my first message (compile kernel support
> and add route + test with tcpdump)
>
> So this toolkit seems confirme the fact that my servers support multicast.
> When i test on agnes with target ovea-inspiron i've:
>
> java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
> Usage MCaster [address port message]
> BEGIN TO RECEIVE
> SENT:ovea-inspiron1
> RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
> SENT:ovea-inspiron2
> BEGIN TO RECEIVE
> RECEIVED:(gtcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
> SENT:ovea-inspiron3
> BEGIN TO RECEIVE
> RECEIVED:(ftcp://192.168.2.102:400catalina FROM /192.168.2.102:45564
> SENT:ovea-inspiron4
> BEGIN TO RECEIVE
> RECEIVED:(gtcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
>
> And when i test on ovea-inspiron with target agnes i've:
> java -cp tomcat-replication.jar MCaster 224.0.0.1 <http://228.1.2.3/> 45566
> agnes
>  Usage MCaster [address port message]
> BEGIN TO RECEIVE
> SENT:agnes1
> RECEIVED:agnes1 FROM /192.168.2.103:45566
> SENT:agnes2
> BEGIN TO RECEIVE
> RECEIVED:agnes2 FROM /192.168.2.103:45566
> SENT:agnes3
> BEGIN TO RECEIVE
> RECEIVED:agnes3 FROM /192.168.2.103:45566
> SENT:agnes4
> BEGIN TO RECEIVE
> RECEIVED:agnes4 FROM /192.168.2.103:45566
> SENT:agnes5
> BEGIN TO RECEIVE
> RECEIVED:agnes5 FROM /192.168.2.103:45566
> SENT:agnes6
> BEGIN TO RECEIVE
> RECEIVED:agnes6 FROM /192.168.2.103:45566
> SENT:agnes7
> BEGIN TO RECEIVE
> RECEIVED:agnes7 FROM /192.168.2.103:45566
>
> So it's not a multicast probleme but most a configuration probleme.
> ovea-inspiron sent is ok but the received is empty ?
> Some suggestion(s) ?
>
> Thank's for the progress
>
> On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>   
>>> 1)    Clustering need sticky_session=true and is only design for
>>>       
>> failover (see servlet spec).
>>
>> Not true for Tomcat, using replicationMode="pooled" and
>> waitForAck="true", you can do round robin non sticky load balancing as
>> long as you don't have more than one thread accessing the session at any
>> point in time.
>>
>>     
>>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
>>>       
>> members active in cluster group.
>>
>> yes, your multicast isn't working, or it should have said that you had a
>> member.
>> Take a look at the bottom of the page and run the MCaster test included
>> in a super old version of Tomcat 4 clustering.
>> http://people.apache.org/~fhanik/
>>
>> On multihomed hosts, it can get a little tricky to get multicasting
>> working and you might have to setup some routes to help. Check with your
>> sysadmin.
>>
>> Filip
>>
>>
>>
>> Peter Rossbach wrote:
>>     
>>> Hey,
>>>
>>> 1)    Clustering need sticky_session=true and is only design for
>>> failover (see servlet spec).
>>> 2)    Are your sure that MULTICAST is enabled at eth0?
>>>
>>> regards
>>> Peter
>>> pr@objektpark.de
>>>
>>>
>>>
>>> Am 15.02.2006 um 02:26 schrieb David Avenante:
>>>
>>>       
>>>> Hi,
>>>>
>>>> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
>>>> configuration and test
>>>> i seems to be on limit of my all possibilities ;)
>>>>
>>>> I try to use two tomcat in cluster with apache web server and mod_jk as
>>>> connector.
>>>>
>>>> my Apache configuration look like :
>>>>
>>>>
>>>> # workers.properties
>>>>
>>>> ps=/
>>>>
>>>> # List the workers name
>>>> worker.list=loadbalancer
>>>>
>>>> # ----------------
>>>> # First worker
>>>> # ----------------
>>>> worker.node01.port=8009
>>>> worker.node01.host=agnes
>>>> worker.node01.type=ajp13
>>>> worker.node01.lbfactor=1
>>>> #worker.node01.domain=cluster1
>>>> # ----------------
>>>> # Second worker
>>>> # ----------------
>>>> worker.node02.port=9009
>>>> worker.node02.host=ovea-inspiron
>>>> worker.node02.type=ajp13
>>>> worker.node02.lbfactor=1
>>>> #worker.node02.domain=cluster1
>>>> # ----------------------
>>>> # Load Balancer worker
>>>> # ----------------------
>>>> worker.loadbalancer.type=lb
>>>> worker.loadbalancer.sticky_session=false
>>>> worker.loadbalancer.balanced_workers=node01,node02
>>>>
>>>> As you can see i use two server ('agnes' IP : 192.168.2.102 and
>>>> 'ovea-inspiron' IP : 192.168.2.103)
>>>> I' ve coded a little aplication who read un file and create a
>>>> sessions if
>>>> session not exist.
>>>>
>>>> If i use the system in mod load balancing (with no cluster mod
>>>>         
>> activate)
>>     
>>>> all is great (my config is of course
>>>> worker.loadbalancer.sticky_session=true
>>>> )
>>>>
>>>> So system run with session affinitu but the two server are accessible
>>>>         
>> ;)
>>     
>>>> Now i try to configure as cluster mode with session replication
>>>> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
>>>>
>>>> I configure my to server.xml like that :
>>>> agnes (IP : 192.168.2.102)
>>>>
>>>> <Server port="8005" shutdown="SHUTDOWN">
>>>>   <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" maxHttpHeaderSize="8192"
>>>>                       maxThreads="150" minSpareThreads="25"
>>>>                       maxSpareThreads="75"
>>>>                       enableLookups="false" redirectPort="8443"
>>>> acceptCount="100"
>>>>                       connectionTimeout="20000"
>>>> disableUploadTimeout="true"
>>>> />
>>>>
>>>>     <Connector port="8009" enableLookups="false"
>>>>                       redirectPort="8443" protocol="AJP/1.3" />
>>>>
>>>>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="node01" >
>>>>
>>>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>>>                    resourceName="UserDatabase" />
>>>>
>>>>       <Host name="localhost" appBase="webapps"
>>>>                unpackWARs="true" autoDeploy="true"
>>>>                xmlValidation="false" xmlNamespaceAware="false">
>>>>      <Cluster
>>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>>>                   doClusterLog="true"
>>>>                   clusterLogName="clusterlog"
>>>>                   manager.className="
>>>> org.apache.catalina.cluster.session.DeltaManager"
>>>>                   manager.expireSessionsOnShutdown="false"
>>>>                   manager.notifyListenersOnReplication="true"
>>>>                   manager.notifySessionListenersOnReplication="true"
>>>>                   manager.sendAllSessions="true"
>>>>                   manager.sendAllSessionsSize="500"
>>>>                   manager.sendAllSessionsWaitTime="20">
>>>>
>>>>         <Membership className="
>>>> org.apache.catalina.cluster.mcast.McastService"
>>>>                              mcastBindAddress="192.168.2.102"
>>>>                              mcastAddr="224.0.0.1"
>>>>                              mcastPort="45564"
>>>>                              mcastFrequency="1000"
>>>>                              mcastDropTime="30000"/>
>>>>
>>>>         <Receiver className="
>>>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>>>                          tcpListenAddress="192.168.2.102"
>>>>                          tcpListenPort="4000"
>>>>                          tcpSelectorTimeout="100"
>>>>                          tcpThreadCount="6" />
>>>>
>>>>         <Sender className="
>>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>>>                       replicationMode="fastasyncqueue"
>>>>                       doTransmitterProcessingStats="true"
>>>>                       doProcessingStats="true"
>>>>                       doWaitAckStats="true"
>>>>                       queueTimeWait="true"
>>>>                       queueDoStats="true"
>>>>                       queueCheckLock="true"
>>>>                       ackTimeout="15000"
>>>>                       waitForAck="true"
>>>>                       keepAliveTimeout="80000"
>>>>                       keepAliveMaxRequestCount="-1" />
>>>>
>>>>       </Host>
>>>>     </Engine>
>>>>   </Service>
>>>> </Server>
>>>>
>>>>
>>>> ovea-inspiron (IP : 192.168.2.103)
>>>> <Server port="9005" shutdown="SHUTDOWN">
>>>>
>>>>   <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="9080" maxHttpHeaderSize="8192"
>>>>                      maxThreads="150" minSpareThreads="25"
>>>>                      maxSpareThreads="75"
>>>>                      enableLookups="false" redirectPort="8443"
>>>>                      acceptCount="100"
>>>>                      connectionTimeout="20000"
>>>> disableUploadTimeout="true"
>>>> />
>>>>
>>>>    <Connector port="9009" enableLookups="false"
>>>>                      redirectPort="8443" protocol="AJP/1.3" />
>>>>
>>>>    <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02" >
>>>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>>>                   resourceName="UserDatabase"/>
>>>>
>>>>      <Host name="localhost" appBase="webapps"
>>>>               unpackWARs="true" autoDeploy="true"
>>>>               xmlValidation="false" xmlNamespaceAware="false">
>>>>
>>>>      <Cluster
>>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>>>                   doClusterLog="true"
>>>>                   clusterLogName="clusterlog"
>>>>                   manager.className="
>>>> org.apache.catalina.cluster.session.DeltaManager"
>>>>                   manager.expireSessionsOnShutdown="false"
>>>>                   manager.notifyListenersOnReplication="true"
>>>>                   manager.notifySessionListenersOnReplication="true"
>>>>                   manager.sendAllSessions="true"
>>>>                   manager.sendAllSessionsSize="500"
>>>>                   manager.sendAllSessionsWaitTime="20">
>>>>
>>>>         <Membership className="
>>>> org.apache.catalina.cluster.mcast.McastService"
>>>>                              mcastBindAddress="192.168.2.103"
>>>>                              mcastAddr="224.0.0.1"
>>>>                              mcastPort="45564"
>>>>                              mcastFrequency="1000"
>>>>                              mcastDropTime="30000"/>
>>>>
>>>>         <Receiver className="
>>>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>>>                         tcpListenAddress="192.168.2.103"
>>>>                         tcpListenPort="4000"
>>>>                         tcpSelectorTimeout="100"
>>>>                         tcpThreadCount="6" />
>>>>
>>>>         <Sender className="
>>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>>>                       replicationMode="fastasyncqueue"
>>>>                       doTransmitterProcessingStats="true"
>>>>                       doProcessingStats="true"
>>>>                       doWaitAckStats="true"
>>>>                       queueTimeWait="true"
>>>>                       queueDoStats="true"
>>>>                       queueCheckLock="true"
>>>>                       ackTimeout="15000"
>>>>                       waitForAck="true"
>>>>                       keepAliveTimeout="80000"
>>>>                       keepAliveMaxRequestCount="-1" />
>>>>
>>>>       </Host>
>>>>     </Engine>
>>>>   </Service>
>>>> </Server>
>>>>
>>>>
>>>> I'm user linux so i've compiled my kernel with multicat kernel option
>>>> I add the rout like rooute add -host 224.0.0.1 dev eth0
>>>>
>>>> N.B : why 224.0.0.1 =>
>>>> http://www.iana.org/assignments/multicast-addresses
>>>>
>>>> So route is :
>>>> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
>>>> 192.168.2.0     *              255.255.255.0     U      0
>>>> 0        0
>>>> eth0
>>>> loopback        *               255.0.0.0            U      0      0
>>>>  0 lo
>>>> default         .                  0.0.0.0               UG    0      0
>>>>    0 eth0
>>>>
>>>> now i start the two tomcat with the same application in webapp
>>>> directories
>>>> with tcpdump i verify the multicasting btewen my server .. so :
>>>>
>>>> 19:39:17.809978 IP 192.168.2.102.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:18.546034 IP ovea-inspiron.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.45564UDP
>>>>         
>> ,
>>     
>>>> length 56
>>>> 19:39:19.790470 IP ovea-inspiron.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:19.818691 IP 192.168.2.102.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:20.826650 IP 192.168.2.102.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:20.943933 IP ovea-inspiron.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:21.806813 arp who-has . tell 192.168.2.102
>>>> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
>>>> 19:39:21.831048 IP 192.168.2.102.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:22.164812 IP ovea-inspiron.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>> 19:39:22.835240 IP 192.168.2.102.45564 >
>>>> all-systems.mcast.net.45564:UDP,
>>>> length 56
>>>>
>>>> So all semms to be OK but i've
>>>>
>>>> Feb 14, 2006 6:33:26 PM
>>>> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
>>>> art
>>>> INFO: Cluster is about to start
>>>> Feb 14, 2006 6:33:26 PM
>>>>
>>>>         
>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterValves
>>     
>>>> INFO: Add Default ClusterValves at cluster localhost
>>>> Feb 14, 2006 6:33:26 PM
>>>>
>>>>         
>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterListener
>>     
>>>> INFO: Add Default ClusterListener at cluster localhost
>>>> Feb 14, 2006 6:33:26 PM
>>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
>>>> INFO: Start ClusterSender at cluster
>>>> Catalina:type=3DCluster,host=3Dlocalhost
>>>> with name Catalina:type=3DClusterSender,host=3Dlocalhost
>>>> Feb 14, 2006 6:33:26 PM
>>>> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
>>>> INFO: Setting multihome multicast interface to:/192.168.2.102
>>>> Feb 14, 2006 6:33:26 PM
>>>> org.apache.catalina.cluster.mcast.McastService start
>>>> INFO: Sleeping for 4000 secs to establish cluster membership
>>>> Feb 14, 2006 6:33:30 PM
>>>> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
>>>> INFO: membership mbean registered
>>>> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
>>>> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfigdeployWAR
>>>> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
>>>> Feb 14, 2006 6:33:31 PM
>>>> org.apache.catalina.cluster.session.DeltaManager st
>>>> art
>>>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
>>>> with
>>>> name localhost
>>>> Feb 14, 2006 6:33:31 PM
>>>> org.apache.catalina.cluster.session.DeltaManager st
>>>> art
>>>> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
>>>> Feb 14, 2006 6:33:31 PM
>>>> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
>>>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
>>>> members
>>>> active in cluster group.
>>>>
>>>> As you can see in the last line cluster member are not found !!!!
>>>>
>>>> What's the hell ;)
>>>>
>>>> When i test my application i've always the sequences :
>>>>
>>>>    This page is rendered on server : *Cluster Node - 01 (One) New
>>>> session is
>>>> created with saved value ....UserId : 123456
>>>>    This page is rendered on server : *Cluster Node - 02 (Two) New
>>>> session is
>>>> created with saved value ....UserId : 123456
>>>>    This page is rendered on server : *Cluster Node - 01 (One) New
>>>> session is
>>>> created with saved value ....UserId : 123456
>>>>
>>>> So the request is well balanced but a new session is alway created
>>>>         
>> !!!!!
>>     
>>>> Some ideas ...
>>>>
>>>> Thank you guys
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>     
>
>   


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


Re: Tomcat 5.5.15 Clustering ?

Posted by David Avenante <d....@gmail.com>.
Thank you very much for the toolkit ;)
My feeling was also on my multicast support.
But i' ve read more documentation for my Linux
and i think that my servers support MULTICAST like
explaned on my first message (compile kernel support
and add route + test with tcpdump)

So this toolkit seems confirme the fact that my servers support multicast.
When i test on agnes with target ovea-inspiron i've:

java -cp tomcat-replication.jar MCaster 224.0.0.1 45564 ovea-inspiron
Usage MCaster [address port message]
BEGIN TO RECEIVE
SENT:ovea-inspiron1
RECEIVED:ovea-inspiron1 FROM /192.168.2.102:45564
SENT:ovea-inspiron2
BEGIN TO RECEIVE
RECEIVED:(gtcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564
SENT:ovea-inspiron3
BEGIN TO RECEIVE
RECEIVED:(ftcp://192.168.2.102:400catalina FROM /192.168.2.102:45564
SENT:ovea-inspiron4
BEGIN TO RECEIVE
RECEIVED:(gtcp://192.168.2.103:400cluster1 FROM /192.168.2.103:45564

And when i test on ovea-inspiron with target agnes i've:
java -cp tomcat-replication.jar MCaster 224.0.0.1 <http://228.1.2.3/> 45566
agnes
 Usage MCaster [address port message]
BEGIN TO RECEIVE
SENT:agnes1
RECEIVED:agnes1 FROM /192.168.2.103:45566
SENT:agnes2
BEGIN TO RECEIVE
RECEIVED:agnes2 FROM /192.168.2.103:45566
SENT:agnes3
BEGIN TO RECEIVE
RECEIVED:agnes3 FROM /192.168.2.103:45566
SENT:agnes4
BEGIN TO RECEIVE
RECEIVED:agnes4 FROM /192.168.2.103:45566
SENT:agnes5
BEGIN TO RECEIVE
RECEIVED:agnes5 FROM /192.168.2.103:45566
SENT:agnes6
BEGIN TO RECEIVE
RECEIVED:agnes6 FROM /192.168.2.103:45566
SENT:agnes7
BEGIN TO RECEIVE
RECEIVED:agnes7 FROM /192.168.2.103:45566

So it's not a multicast probleme but most a configuration probleme.
ovea-inspiron sent is ok but the received is empty ?
Some suggestion(s) ?

Thank's for the progress

On 2/15/06, Filip Hanik - Dev Lists <de...@hanik.com> wrote:
>
> >1)    Clustering need sticky_session=true and is only design for
> failover (see servlet spec).
>
> Not true for Tomcat, using replicationMode="pooled" and
> waitForAck="true", you can do round robin non sticky load balancing as
> long as you don't have more than one thread accessing the session at any
> point in time.
>
> >INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> members active in cluster group.
>
> yes, your multicast isn't working, or it should have said that you had a
> member.
> Take a look at the bottom of the page and run the MCaster test included
> in a super old version of Tomcat 4 clustering.
> http://people.apache.org/~fhanik/
>
> On multihomed hosts, it can get a little tricky to get multicasting
> working and you might have to setup some routes to help. Check with your
> sysadmin.
>
> Filip
>
>
>
> Peter Rossbach wrote:
> > Hey,
> >
> > 1)    Clustering need sticky_session=true and is only design for
> > failover (see servlet spec).
> > 2)    Are your sure that MULTICAST is enabled at eth0?
> >
> > regards
> > Peter
> > pr@objektpark.de
> >
> >
> >
> > Am 15.02.2006 um 02:26 schrieb David Avenante:
> >
> >> Hi,
> >>
> >> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
> >> configuration and test
> >> i seems to be on limit of my all possibilities ;)
> >>
> >> I try to use two tomcat in cluster with apache web server and mod_jk as
> >> connector.
> >>
> >> my Apache configuration look like :
> >>
> >>
> >> # workers.properties
> >>
> >> ps=/
> >>
> >> # List the workers name
> >> worker.list=loadbalancer
> >>
> >> # ----------------
> >> # First worker
> >> # ----------------
> >> worker.node01.port=8009
> >> worker.node01.host=agnes
> >> worker.node01.type=ajp13
> >> worker.node01.lbfactor=1
> >> #worker.node01.domain=cluster1
> >> # ----------------
> >> # Second worker
> >> # ----------------
> >> worker.node02.port=9009
> >> worker.node02.host=ovea-inspiron
> >> worker.node02.type=ajp13
> >> worker.node02.lbfactor=1
> >> #worker.node02.domain=cluster1
> >> # ----------------------
> >> # Load Balancer worker
> >> # ----------------------
> >> worker.loadbalancer.type=lb
> >> worker.loadbalancer.sticky_session=false
> >> worker.loadbalancer.balanced_workers=node01,node02
> >>
> >> As you can see i use two server ('agnes' IP : 192.168.2.102 and
> >> 'ovea-inspiron' IP : 192.168.2.103)
> >> I' ve coded a little aplication who read un file and create a
> >> sessions if
> >> session not exist.
> >>
> >> If i use the system in mod load balancing (with no cluster mod
> activate)
> >> all is great (my config is of course
> >> worker.loadbalancer.sticky_session=true
> >> )
> >>
> >> So system run with session affinitu but the two server are accessible
> ;)
> >>
> >> Now i try to configure as cluster mode with session replication
> >> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
> >>
> >> I configure my to server.xml like that :
> >> agnes (IP : 192.168.2.102)
> >>
> >> <Server port="8005" shutdown="SHUTDOWN">
> >>   <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" maxHttpHeaderSize="8192"
> >>                       maxThreads="150" minSpareThreads="25"
> >>                       maxSpareThreads="75"
> >>                       enableLookups="false" redirectPort="8443"
> >> acceptCount="100"
> >>                       connectionTimeout="20000"
> >> disableUploadTimeout="true"
> >> />
> >>
> >>     <Connector port="8009" enableLookups="false"
> >>                       redirectPort="8443" protocol="AJP/1.3" />
> >>
> >>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="node01" >
> >>
> >>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>                    resourceName="UserDatabase" />
> >>
> >>       <Host name="localhost" appBase="webapps"
> >>                unpackWARs="true" autoDeploy="true"
> >>                xmlValidation="false" xmlNamespaceAware="false">
> >>      <Cluster
> >> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >>                   doClusterLog="true"
> >>                   clusterLogName="clusterlog"
> >>                   manager.className="
> >> org.apache.catalina.cluster.session.DeltaManager"
> >>                   manager.expireSessionsOnShutdown="false"
> >>                   manager.notifyListenersOnReplication="true"
> >>                   manager.notifySessionListenersOnReplication="true"
> >>                   manager.sendAllSessions="true"
> >>                   manager.sendAllSessionsSize="500"
> >>                   manager.sendAllSessionsWaitTime="20">
> >>
> >>         <Membership className="
> >> org.apache.catalina.cluster.mcast.McastService"
> >>                              mcastBindAddress="192.168.2.102"
> >>                              mcastAddr="224.0.0.1"
> >>                              mcastPort="45564"
> >>                              mcastFrequency="1000"
> >>                              mcastDropTime="30000"/>
> >>
> >>         <Receiver className="
> >> org.apache.catalina.cluster.tcp.ReplicationListener"
> >>                          tcpListenAddress="192.168.2.102"
> >>                          tcpListenPort="4000"
> >>                          tcpSelectorTimeout="100"
> >>                          tcpThreadCount="6" />
> >>
> >>         <Sender className="
> >> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >>                       replicationMode="fastasyncqueue"
> >>                       doTransmitterProcessingStats="true"
> >>                       doProcessingStats="true"
> >>                       doWaitAckStats="true"
> >>                       queueTimeWait="true"
> >>                       queueDoStats="true"
> >>                       queueCheckLock="true"
> >>                       ackTimeout="15000"
> >>                       waitForAck="true"
> >>                       keepAliveTimeout="80000"
> >>                       keepAliveMaxRequestCount="-1" />
> >>
> >>       </Host>
> >>     </Engine>
> >>   </Service>
> >> </Server>
> >>
> >>
> >> ovea-inspiron (IP : 192.168.2.103)
> >> <Server port="9005" shutdown="SHUTDOWN">
> >>
> >>   <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="9080" maxHttpHeaderSize="8192"
> >>                      maxThreads="150" minSpareThreads="25"
> >>                      maxSpareThreads="75"
> >>                      enableLookups="false" redirectPort="8443"
> >>                      acceptCount="100"
> >>                      connectionTimeout="20000"
> >> disableUploadTimeout="true"
> >> />
> >>
> >>    <Connector port="9009" enableLookups="false"
> >>                      redirectPort="8443" protocol="AJP/1.3" />
> >>
> >>    <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02" >
> >>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>                   resourceName="UserDatabase"/>
> >>
> >>      <Host name="localhost" appBase="webapps"
> >>               unpackWARs="true" autoDeploy="true"
> >>               xmlValidation="false" xmlNamespaceAware="false">
> >>
> >>      <Cluster
> >> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
> >>                   doClusterLog="true"
> >>                   clusterLogName="clusterlog"
> >>                   manager.className="
> >> org.apache.catalina.cluster.session.DeltaManager"
> >>                   manager.expireSessionsOnShutdown="false"
> >>                   manager.notifyListenersOnReplication="true"
> >>                   manager.notifySessionListenersOnReplication="true"
> >>                   manager.sendAllSessions="true"
> >>                   manager.sendAllSessionsSize="500"
> >>                   manager.sendAllSessionsWaitTime="20">
> >>
> >>         <Membership className="
> >> org.apache.catalina.cluster.mcast.McastService"
> >>                              mcastBindAddress="192.168.2.103"
> >>                              mcastAddr="224.0.0.1"
> >>                              mcastPort="45564"
> >>                              mcastFrequency="1000"
> >>                              mcastDropTime="30000"/>
> >>
> >>         <Receiver className="
> >> org.apache.catalina.cluster.tcp.ReplicationListener"
> >>                         tcpListenAddress="192.168.2.103"
> >>                         tcpListenPort="4000"
> >>                         tcpSelectorTimeout="100"
> >>                         tcpThreadCount="6" />
> >>
> >>         <Sender className="
> >> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
> >>                       replicationMode="fastasyncqueue"
> >>                       doTransmitterProcessingStats="true"
> >>                       doProcessingStats="true"
> >>                       doWaitAckStats="true"
> >>                       queueTimeWait="true"
> >>                       queueDoStats="true"
> >>                       queueCheckLock="true"
> >>                       ackTimeout="15000"
> >>                       waitForAck="true"
> >>                       keepAliveTimeout="80000"
> >>                       keepAliveMaxRequestCount="-1" />
> >>
> >>       </Host>
> >>     </Engine>
> >>   </Service>
> >> </Server>
> >>
> >>
> >> I'm user linux so i've compiled my kernel with multicat kernel option
> >> I add the rout like rooute add -host 224.0.0.1 dev eth0
> >>
> >> N.B : why 224.0.0.1 =>
> >> http://www.iana.org/assignments/multicast-addresses
> >>
> >> So route is :
> >> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
> >> 192.168.2.0     *              255.255.255.0     U      0
> >> 0        0
> >> eth0
> >> loopback        *               255.0.0.0            U      0      0
> >>  0 lo
> >> default         .                  0.0.0.0               UG    0      0
> >>    0 eth0
> >>
> >> now i start the two tomcat with the same application in webapp
> >> directories
> >> with tcpdump i verify the multicasting btewen my server .. so :
> >>
> >> 19:39:17.809978 IP 192.168.2.102.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:18.546034 IP ovea-inspiron.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.45564UDP
> ,
> >> length 56
> >> 19:39:19.790470 IP ovea-inspiron.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:19.818691 IP 192.168.2.102.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:20.826650 IP 192.168.2.102.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:20.943933 IP ovea-inspiron.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:21.806813 arp who-has . tell 192.168.2.102
> >> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
> >> 19:39:21.831048 IP 192.168.2.102.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:22.164812 IP ovea-inspiron.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >> 19:39:22.835240 IP 192.168.2.102.45564 >
> >> all-systems.mcast.net.45564:UDP,
> >> length 56
> >>
> >> So all semms to be OK but i've
> >>
> >> Feb 14, 2006 6:33:26 PM
> >> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
> >> art
> >> INFO: Cluster is about to start
> >> Feb 14, 2006 6:33:26 PM
> >>
> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterValves
> >>
> >> INFO: Add Default ClusterValves at cluster localhost
> >> Feb 14, 2006 6:33:26 PM
> >>
> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterListener
> >>
> >> INFO: Add Default ClusterListener at cluster localhost
> >> Feb 14, 2006 6:33:26 PM
> >> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> >> INFO: Start ClusterSender at cluster
> >> Catalina:type=3DCluster,host=3Dlocalhost
> >> with name Catalina:type=3DClusterSender,host=3Dlocalhost
> >> Feb 14, 2006 6:33:26 PM
> >> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
> >> INFO: Setting multihome multicast interface to:/192.168.2.102
> >> Feb 14, 2006 6:33:26 PM
> >> org.apache.catalina.cluster.mcast.McastService start
> >> INFO: Sleeping for 4000 secs to establish cluster membership
> >> Feb 14, 2006 6:33:30 PM
> >> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
> >> INFO: membership mbean registered
> >> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
> >> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfigdeployWAR
> >> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> >> Feb 14, 2006 6:33:31 PM
> >> org.apache.catalina.cluster.session.DeltaManager st
> >> art
> >> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host
> >> with
> >> name localhost
> >> Feb 14, 2006 6:33:31 PM
> >> org.apache.catalina.cluster.session.DeltaManager st
> >> art
> >> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> >> Feb 14, 2006 6:33:31 PM
> >> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
> >> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No
> >> members
> >> active in cluster group.
> >>
> >> As you can see in the last line cluster member are not found !!!!
> >>
> >> What's the hell ;)
> >>
> >> When i test my application i've always the sequences :
> >>
> >>    This page is rendered on server : *Cluster Node - 01 (One) New
> >> session is
> >> created with saved value ....UserId : 123456
> >>    This page is rendered on server : *Cluster Node - 02 (Two) New
> >> session is
> >> created with saved value ....UserId : 123456
> >>    This page is rendered on server : *Cluster Node - 01 (One) New
> >> session is
> >> created with saved value ....UserId : 123456
> >>
> >> So the request is well balanced but a new session is alway created
> !!!!!
> >>
> >> Some ideas ...
> >>
> >> Thank you guys
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 5.5.15 Clustering ?

Posted by Peter Rossbach <pr...@objektpark.de>.
Am 15.02.2006 um 15:11 schrieb Filip Hanik - Dev Lists:

> >1)    Clustering need sticky_session=true and is only design for  
> failover (see servlet spec).
>
> Not true for Tomcat, using replicationMode="pooled" and  
> waitForAck="true", you can do round robin non sticky load balancing  
> as long as you don't have more than one thread accessing the  
> session at any point in time.
>
OK, yes, for special application we support it, but normaly  
sticky_session is true. See Servlet Spec (SRV 7.7).

Peter

> >INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No  
> members active in cluster group.
>
> yes, your multicast isn't working, or it should have said that you  
> had a member.
> Take a look at the bottom of the page and run the MCaster test  
> included in a super old version of Tomcat 4 clustering.
> http://people.apache.org/~fhanik/
>
> On multihomed hosts, it can get a little tricky to get multicasting  
> working and you might have to setup some routes to help. Check with  
> your sysadmin.

> Filip
>
>
>
> Peter Rossbach wrote:
>> Hey,
>>
>> 1)    Clustering need sticky_session=true and is only design for  
>> failover (see servlet spec).
>> 2)    Are your sure that MULTICAST is enabled at eth0?
>>
>> regards
>> Peter
>> pr@objektpark.de
>>
>>
>>
>> Am 15.02.2006 um 02:26 schrieb David Avenante:
>>
>>> Hi,
>>>
>>> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some  
>>> work on
>>> configuration and test
>>> i seems to be on limit of my all possibilities ;)
>>>
>>> I try to use two tomcat in cluster with apache web server and  
>>> mod_jk as
>>> connector.
>>>
>>> my Apache configuration look like :
>>>
>>>
>>> # workers.properties
>>>
>>> ps=/
>>>
>>> # List the workers name
>>> worker.list=loadbalancer
>>>
>>> # ----------------
>>> # First worker
>>> # ----------------
>>> worker.node01.port=8009
>>> worker.node01.host=agnes
>>> worker.node01.type=ajp13
>>> worker.node01.lbfactor=1
>>> #worker.node01.domain=cluster1
>>> # ----------------
>>> # Second worker
>>> # ----------------
>>> worker.node02.port=9009
>>> worker.node02.host=ovea-inspiron
>>> worker.node02.type=ajp13
>>> worker.node02.lbfactor=1
>>> #worker.node02.domain=cluster1
>>> # ----------------------
>>> # Load Balancer worker
>>> # ----------------------
>>> worker.loadbalancer.type=lb
>>> worker.loadbalancer.sticky_session=false
>>> worker.loadbalancer.balanced_workers=node01,node02
>>>
>>> As you can see i use two server ('agnes' IP : 192.168.2.102 and
>>> 'ovea-inspiron' IP : 192.168.2.103)
>>> I' ve coded a little aplication who read un file and create a  
>>> sessions if
>>> session not exist.
>>>
>>> If i use the system in mod load balancing (with no cluster mod  
>>> activate)
>>> all is great (my config is of course  
>>> worker.loadbalancer.sticky_session=true
>>> )
>>>
>>> So system run with session affinitu but the two server are  
>>> accessible ;)
>>>
>>> Now i try to configure as cluster mode with session replication
>>> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
>>>
>>> I configure my to server.xml like that :
>>> agnes (IP : 192.168.2.102)
>>>
>>> <Server port="8005" shutdown="SHUTDOWN">
>>>   <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" maxHttpHeaderSize="8192"
>>>                       maxThreads="150" minSpareThreads="25"
>>>                       maxSpareThreads="75"
>>>                       enableLookups="false" redirectPort="8443"
>>> acceptCount="100"
>>>                       connectionTimeout="20000"  
>>> disableUploadTimeout="true"
>>> />
>>>
>>>     <Connector port="8009" enableLookups="false"
>>>                       redirectPort="8443" protocol="AJP/1.3" />
>>>
>>>     <Engine name="Catalina" defaultHost="localhost"  
>>> jvmRoute="node01" >
>>>
>>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>>                    resourceName="UserDatabase" />
>>>
>>>       <Host name="localhost" appBase="webapps"
>>>                unpackWARs="true" autoDeploy="true"
>>>                xmlValidation="false" xmlNamespaceAware="false">
>>>      <Cluster  
>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>>                   doClusterLog="true"
>>>                   clusterLogName="clusterlog"
>>>                   manager.className="
>>> org.apache.catalina.cluster.session.DeltaManager"
>>>                   manager.expireSessionsOnShutdown="false"
>>>                   manager.notifyListenersOnReplication="true"
>>>                   manager.notifySessionListenersOnReplication="true"
>>>                   manager.sendAllSessions="true"
>>>                   manager.sendAllSessionsSize="500"
>>>                   manager.sendAllSessionsWaitTime="20">
>>>
>>>         <Membership className="
>>> org.apache.catalina.cluster.mcast.McastService"
>>>                              mcastBindAddress="192.168.2.102"
>>>                              mcastAddr="224.0.0.1"
>>>                              mcastPort="45564"
>>>                              mcastFrequency="1000"
>>>                              mcastDropTime="30000"/>
>>>
>>>         <Receiver className="
>>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>>                          tcpListenAddress="192.168.2.102"
>>>                          tcpListenPort="4000"
>>>                          tcpSelectorTimeout="100"
>>>                          tcpThreadCount="6" />
>>>
>>>         <Sender className="
>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>>                       replicationMode="fastasyncqueue"
>>>                       doTransmitterProcessingStats="true"
>>>                       doProcessingStats="true"
>>>                       doWaitAckStats="true"
>>>                       queueTimeWait="true"
>>>                       queueDoStats="true"
>>>                       queueCheckLock="true"
>>>                       ackTimeout="15000"
>>>                       waitForAck="true"
>>>                       keepAliveTimeout="80000"
>>>                       keepAliveMaxRequestCount="-1" />
>>>
>>>       </Host>
>>>     </Engine>
>>>   </Service>
>>> </Server>
>>>
>>>
>>> ovea-inspiron (IP : 192.168.2.103)
>>> <Server port="9005" shutdown="SHUTDOWN">
>>>
>>>   <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="9080" maxHttpHeaderSize="8192"
>>>                      maxThreads="150" minSpareThreads="25"
>>>                      maxSpareThreads="75"
>>>                      enableLookups="false" redirectPort="8443"
>>>                      acceptCount="100"
>>>                      connectionTimeout="20000"  
>>> disableUploadTimeout="true"
>>> />
>>>
>>>    <Connector port="9009" enableLookups="false"
>>>                      redirectPort="8443" protocol="AJP/1.3" />
>>>
>>>    <Engine name="Catalina" defaultHost="localhost"  
>>> jvmRoute="node02" >
>>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>>                   resourceName="UserDatabase"/>
>>>
>>>      <Host name="localhost" appBase="webapps"
>>>               unpackWARs="true" autoDeploy="true"
>>>               xmlValidation="false" xmlNamespaceAware="false">
>>>
>>>      <Cluster  
>>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>>                   doClusterLog="true"
>>>                   clusterLogName="clusterlog"
>>>                   manager.className="
>>> org.apache.catalina.cluster.session.DeltaManager"
>>>                   manager.expireSessionsOnShutdown="false"
>>>                   manager.notifyListenersOnReplication="true"
>>>                   manager.notifySessionListenersOnReplication="true"
>>>                   manager.sendAllSessions="true"
>>>                   manager.sendAllSessionsSize="500"
>>>                   manager.sendAllSessionsWaitTime="20">
>>>
>>>         <Membership className="
>>> org.apache.catalina.cluster.mcast.McastService"
>>>                              mcastBindAddress="192.168.2.103"
>>>                              mcastAddr="224.0.0.1"
>>>                              mcastPort="45564"
>>>                              mcastFrequency="1000"
>>>                              mcastDropTime="30000"/>
>>>
>>>         <Receiver className="
>>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>>                         tcpListenAddress="192.168.2.103"
>>>                         tcpListenPort="4000"
>>>                         tcpSelectorTimeout="100"
>>>                         tcpThreadCount="6" />
>>>
>>>         <Sender className="
>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>>                       replicationMode="fastasyncqueue"
>>>                       doTransmitterProcessingStats="true"
>>>                       doProcessingStats="true"
>>>                       doWaitAckStats="true"
>>>                       queueTimeWait="true"
>>>                       queueDoStats="true"
>>>                       queueCheckLock="true"
>>>                       ackTimeout="15000"
>>>                       waitForAck="true"
>>>                       keepAliveTimeout="80000"
>>>                       keepAliveMaxRequestCount="-1" />
>>>
>>>       </Host>
>>>     </Engine>
>>>   </Service>
>>> </Server>
>>>
>>>
>>> I'm user linux so i've compiled my kernel with multicat kernel  
>>> option
>>> I add the rout like rooute add -host 224.0.0.1 dev eth0
>>>
>>> N.B : why 224.0.0.1 => http://www.iana.org/assignments/multicast- 
>>> addresses
>>>
>>> So route is :
>>> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
>>> 192.168.2.0     *              255.255.255.0     U      0       
>>> 0        0
>>> eth0
>>> loopback        *               255.0.0.0            U      0      0
>>>  0 lo
>>> default         .                  0.0.0.0               UG     
>>> 0      0
>>>    0 eth0
>>>
>>> now i start the two tomcat with the same application in webapp  
>>> directories
>>> with tcpdump i verify the multicasting btewen my server .. so :
>>>
>>> 19:39:17.809978 IP 192.168.2.102.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:18.546034 IP ovea-inspiron.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net. 
>>> 45564UDP,
>>> length 56
>>> 19:39:19.790470 IP ovea-inspiron.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:19.818691 IP 192.168.2.102.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:20.826650 IP 192.168.2.102.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:20.943933 IP ovea-inspiron.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:21.806813 arp who-has . tell 192.168.2.102
>>> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
>>> 19:39:21.831048 IP 192.168.2.102.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:22.164812 IP ovea-inspiron.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>> 19:39:22.835240 IP 192.168.2.102.45564 > all-systems.mcast.net. 
>>> 45564:UDP,
>>> length 56
>>>
>>> So all semms to be OK but i've
>>>
>>> Feb 14, 2006 6:33:26 PM  
>>> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
>>> art
>>> INFO: Cluster is about to start
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultCluster 
>>> Valves
>>> INFO: Add Default ClusterValves at cluster localhost
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultCluster 
>>> Listener
>>> INFO: Add Default ClusterListener at cluster localhost
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
>>> INFO: Start ClusterSender at cluster  
>>> Catalina:type=3DCluster,host=3Dlocalhost
>>> with name Catalina:type=3DClusterSender,host=3Dlocalhost
>>> Feb 14, 2006 6:33:26 PM
>>> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
>>> INFO: Setting multihome multicast interface to:/192.168.2.102
>>> Feb 14, 2006 6:33:26 PM  
>>> org.apache.catalina.cluster.mcast.McastService start
>>> INFO: Sleeping for 4000 secs to establish cluster membership
>>> Feb 14, 2006 6:33:30 PM
>>> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
>>> INFO: membership mbean registered
>>> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
>>> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig  
>>> deployWAR
>>> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
>>> Feb 14, 2006 6:33:31 PM  
>>> org.apache.catalina.cluster.session.DeltaManager st
>>> art
>>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element  
>>> Host with
>>> name localhost
>>> Feb 14, 2006 6:33:31 PM  
>>> org.apache.catalina.cluster.session.DeltaManager st
>>> art
>>> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
>>> Feb 14, 2006 6:33:31 PM
>>> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSession 
>>> s
>>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer.  
>>> No members
>>> active in cluster group.
>>>
>>> As you can see in the last line cluster member are not found !!!!
>>>
>>> What's the hell ;)
>>>
>>> When i test my application i've always the sequences :
>>>
>>>    This page is rendered on server : *Cluster Node - 01 (One) New  
>>> session is
>>> created with saved value ....UserId : 123456
>>>    This page is rendered on server : *Cluster Node - 02 (Two) New  
>>> session is
>>> created with saved value ....UserId : 123456
>>>    This page is rendered on server : *Cluster Node - 01 (One) New  
>>> session is
>>> created with saved value ....UserId : 123456
>>>
>>> So the request is well balanced but a new session is alway  
>>> created !!!!!
>>>
>>> Some ideas ...
>>>
>>> Thank you guys
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: Tomcat 5.5.15 Clustering ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
 >1)    Clustering need sticky_session=true and is only design for 
failover (see servlet spec).

Not true for Tomcat, using replicationMode="pooled" and 
waitForAck="true", you can do round robin non sticky load balancing as 
long as you don't have more than one thread accessing the session at any 
point in time.

 >INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No 
members active in cluster group.

yes, your multicast isn't working, or it should have said that you had a 
member.
Take a look at the bottom of the page and run the MCaster test included 
in a super old version of Tomcat 4 clustering.
http://people.apache.org/~fhanik/

On multihomed hosts, it can get a little tricky to get multicasting 
working and you might have to setup some routes to help. Check with your 
sysadmin.

Filip



Peter Rossbach wrote:
> Hey,
>
> 1)    Clustering need sticky_session=true and is only design for 
> failover (see servlet spec).
> 2)    Are your sure that MULTICAST is enabled at eth0?
>
> regards
> Peter
> pr@objektpark.de
>
>
>
> Am 15.02.2006 um 02:26 schrieb David Avenante:
>
>> Hi,
>>
>> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
>> configuration and test
>> i seems to be on limit of my all possibilities ;)
>>
>> I try to use two tomcat in cluster with apache web server and mod_jk as
>> connector.
>>
>> my Apache configuration look like :
>>
>>
>> # workers.properties
>>
>> ps=/
>>
>> # List the workers name
>> worker.list=loadbalancer
>>
>> # ----------------
>> # First worker
>> # ----------------
>> worker.node01.port=8009
>> worker.node01.host=agnes
>> worker.node01.type=ajp13
>> worker.node01.lbfactor=1
>> #worker.node01.domain=cluster1
>> # ----------------
>> # Second worker
>> # ----------------
>> worker.node02.port=9009
>> worker.node02.host=ovea-inspiron
>> worker.node02.type=ajp13
>> worker.node02.lbfactor=1
>> #worker.node02.domain=cluster1
>> # ----------------------
>> # Load Balancer worker
>> # ----------------------
>> worker.loadbalancer.type=lb
>> worker.loadbalancer.sticky_session=false
>> worker.loadbalancer.balanced_workers=node01,node02
>>
>> As you can see i use two server ('agnes' IP : 192.168.2.102 and
>> 'ovea-inspiron' IP : 192.168.2.103)
>> I' ve coded a little aplication who read un file and create a 
>> sessions if
>> session not exist.
>>
>> If i use the system in mod load balancing (with no cluster mod activate)
>> all is great (my config is of course 
>> worker.loadbalancer.sticky_session=true
>> )
>>
>> So system run with session affinitu but the two server are accessible ;)
>>
>> Now i try to configure as cluster mode with session replication
>> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
>>
>> I configure my to server.xml like that :
>> agnes (IP : 192.168.2.102)
>>
>> <Server port="8005" shutdown="SHUTDOWN">
>>   <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" maxHttpHeaderSize="8192"
>>                       maxThreads="150" minSpareThreads="25"
>>                       maxSpareThreads="75"
>>                       enableLookups="false" redirectPort="8443"
>> acceptCount="100"
>>                       connectionTimeout="20000" 
>> disableUploadTimeout="true"
>> />
>>
>>     <Connector port="8009" enableLookups="false"
>>                       redirectPort="8443" protocol="AJP/1.3" />
>>
>>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="node01" >
>>
>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>                    resourceName="UserDatabase" />
>>
>>       <Host name="localhost" appBase="webapps"
>>                unpackWARs="true" autoDeploy="true"
>>                xmlValidation="false" xmlNamespaceAware="false">
>>      <Cluster 
>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>                   doClusterLog="true"
>>                   clusterLogName="clusterlog"
>>                   manager.className="
>> org.apache.catalina.cluster.session.DeltaManager"
>>                   manager.expireSessionsOnShutdown="false"
>>                   manager.notifyListenersOnReplication="true"
>>                   manager.notifySessionListenersOnReplication="true"
>>                   manager.sendAllSessions="true"
>>                   manager.sendAllSessionsSize="500"
>>                   manager.sendAllSessionsWaitTime="20">
>>
>>         <Membership className="
>> org.apache.catalina.cluster.mcast.McastService"
>>                              mcastBindAddress="192.168.2.102"
>>                              mcastAddr="224.0.0.1"
>>                              mcastPort="45564"
>>                              mcastFrequency="1000"
>>                              mcastDropTime="30000"/>
>>
>>         <Receiver className="
>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>                          tcpListenAddress="192.168.2.102"
>>                          tcpListenPort="4000"
>>                          tcpSelectorTimeout="100"
>>                          tcpThreadCount="6" />
>>
>>         <Sender className="
>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>                       replicationMode="fastasyncqueue"
>>                       doTransmitterProcessingStats="true"
>>                       doProcessingStats="true"
>>                       doWaitAckStats="true"
>>                       queueTimeWait="true"
>>                       queueDoStats="true"
>>                       queueCheckLock="true"
>>                       ackTimeout="15000"
>>                       waitForAck="true"
>>                       keepAliveTimeout="80000"
>>                       keepAliveMaxRequestCount="-1" />
>>
>>       </Host>
>>     </Engine>
>>   </Service>
>> </Server>
>>
>>
>> ovea-inspiron (IP : 192.168.2.103)
>> <Server port="9005" shutdown="SHUTDOWN">
>>
>>   <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="9080" maxHttpHeaderSize="8192"
>>                      maxThreads="150" minSpareThreads="25"
>>                      maxSpareThreads="75"
>>                      enableLookups="false" redirectPort="8443"
>>                      acceptCount="100"
>>                      connectionTimeout="20000" 
>> disableUploadTimeout="true"
>> />
>>
>>    <Connector port="9009" enableLookups="false"
>>                      redirectPort="8443" protocol="AJP/1.3" />
>>
>>    <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02" >
>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>                   resourceName="UserDatabase"/>
>>
>>      <Host name="localhost" appBase="webapps"
>>               unpackWARs="true" autoDeploy="true"
>>               xmlValidation="false" xmlNamespaceAware="false">
>>
>>      <Cluster 
>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>                   doClusterLog="true"
>>                   clusterLogName="clusterlog"
>>                   manager.className="
>> org.apache.catalina.cluster.session.DeltaManager"
>>                   manager.expireSessionsOnShutdown="false"
>>                   manager.notifyListenersOnReplication="true"
>>                   manager.notifySessionListenersOnReplication="true"
>>                   manager.sendAllSessions="true"
>>                   manager.sendAllSessionsSize="500"
>>                   manager.sendAllSessionsWaitTime="20">
>>
>>         <Membership className="
>> org.apache.catalina.cluster.mcast.McastService"
>>                              mcastBindAddress="192.168.2.103"
>>                              mcastAddr="224.0.0.1"
>>                              mcastPort="45564"
>>                              mcastFrequency="1000"
>>                              mcastDropTime="30000"/>
>>
>>         <Receiver className="
>> org.apache.catalina.cluster.tcp.ReplicationListener"
>>                         tcpListenAddress="192.168.2.103"
>>                         tcpListenPort="4000"
>>                         tcpSelectorTimeout="100"
>>                         tcpThreadCount="6" />
>>
>>         <Sender className="
>> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>                       replicationMode="fastasyncqueue"
>>                       doTransmitterProcessingStats="true"
>>                       doProcessingStats="true"
>>                       doWaitAckStats="true"
>>                       queueTimeWait="true"
>>                       queueDoStats="true"
>>                       queueCheckLock="true"
>>                       ackTimeout="15000"
>>                       waitForAck="true"
>>                       keepAliveTimeout="80000"
>>                       keepAliveMaxRequestCount="-1" />
>>
>>       </Host>
>>     </Engine>
>>   </Service>
>> </Server>
>>
>>
>> I'm user linux so i've compiled my kernel with multicat kernel option
>> I add the rout like rooute add -host 224.0.0.1 dev eth0
>>
>> N.B : why 224.0.0.1 => 
>> http://www.iana.org/assignments/multicast-addresses
>>
>> So route is :
>> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
>> 192.168.2.0     *              255.255.255.0     U      0      
>> 0        0
>> eth0
>> loopback        *               255.0.0.0            U      0      0
>>  0 lo
>> default         .                  0.0.0.0               UG    0      0
>>    0 eth0
>>
>> now i start the two tomcat with the same application in webapp 
>> directories
>> with tcpdump i verify the multicasting btewen my server .. so :
>>
>> 19:39:17.809978 IP 192.168.2.102.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:18.546034 IP ovea-inspiron.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net.45564UDP,
>> length 56
>> 19:39:19.790470 IP ovea-inspiron.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:19.818691 IP 192.168.2.102.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:20.826650 IP 192.168.2.102.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:20.943933 IP ovea-inspiron.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:21.806813 arp who-has . tell 192.168.2.102
>> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
>> 19:39:21.831048 IP 192.168.2.102.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:22.164812 IP ovea-inspiron.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>> 19:39:22.835240 IP 192.168.2.102.45564 > 
>> all-systems.mcast.net.45564:UDP,
>> length 56
>>
>> So all semms to be OK but i've
>>
>> Feb 14, 2006 6:33:26 PM 
>> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
>> art
>> INFO: Cluster is about to start
>> Feb 14, 2006 6:33:26 PM
>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterValves 
>>
>> INFO: Add Default ClusterValves at cluster localhost
>> Feb 14, 2006 6:33:26 PM
>> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterListener 
>>
>> INFO: Add Default ClusterListener at cluster localhost
>> Feb 14, 2006 6:33:26 PM
>> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
>> INFO: Start ClusterSender at cluster 
>> Catalina:type=3DCluster,host=3Dlocalhost
>> with name Catalina:type=3DClusterSender,host=3Dlocalhost
>> Feb 14, 2006 6:33:26 PM
>> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
>> INFO: Setting multihome multicast interface to:/192.168.2.102
>> Feb 14, 2006 6:33:26 PM 
>> org.apache.catalina.cluster.mcast.McastService start
>> INFO: Sleeping for 4000 secs to establish cluster membership
>> Feb 14, 2006 6:33:30 PM
>> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
>> INFO: membership mbean registered
>> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
>> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig deployWAR
>> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
>> Feb 14, 2006 6:33:31 PM 
>> org.apache.catalina.cluster.session.DeltaManager st
>> art
>> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element Host 
>> with
>> name localhost
>> Feb 14, 2006 6:33:31 PM 
>> org.apache.catalina.cluster.session.DeltaManager st
>> art
>> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
>> Feb 14, 2006 6:33:31 PM
>> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
>> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No 
>> members
>> active in cluster group.
>>
>> As you can see in the last line cluster member are not found !!!!
>>
>> What's the hell ;)
>>
>> When i test my application i've always the sequences :
>>
>>    This page is rendered on server : *Cluster Node - 01 (One) New 
>> session is
>> created with saved value ....UserId : 123456
>>    This page is rendered on server : *Cluster Node - 02 (Two) New 
>> session is
>> created with saved value ....UserId : 123456
>>    This page is rendered on server : *Cluster Node - 01 (One) New 
>> session is
>> created with saved value ....UserId : 123456
>>
>> So the request is well balanced but a new session is alway created !!!!!
>>
>> Some ideas ...
>>
>> Thank you guys
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: Tomcat 5.5.15 Clustering ?

Posted by Peter Rossbach <pr...@objektpark.de>.
Hey,

1)	Clustering need sticky_session=true and is only design for  
failover (see servlet spec).
2)	Are your sure that MULTICAST is enabled at eth0?

regards
Peter
pr@objektpark.de



Am 15.02.2006 um 02:26 schrieb David Avenante:

> Hi,
>
> I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on
> configuration and test
> i seems to be on limit of my all possibilities ;)
>
> I try to use two tomcat in cluster with apache web server and  
> mod_jk as
> connector.
>
> my Apache configuration look like :
>
>
> # workers.properties
>
> ps=/
>
> # List the workers name
> worker.list=loadbalancer
>
> # ----------------
> # First worker
> # ----------------
> worker.node01.port=8009
> worker.node01.host=agnes
> worker.node01.type=ajp13
> worker.node01.lbfactor=1
> #worker.node01.domain=cluster1
> # ----------------
> # Second worker
> # ----------------
> worker.node02.port=9009
> worker.node02.host=ovea-inspiron
> worker.node02.type=ajp13
> worker.node02.lbfactor=1
> #worker.node02.domain=cluster1
> # ----------------------
> # Load Balancer worker
> # ----------------------
> worker.loadbalancer.type=lb
> worker.loadbalancer.sticky_session=false
> worker.loadbalancer.balanced_workers=node01,node02
>
> As you can see i use two server ('agnes' IP : 192.168.2.102 and
> 'ovea-inspiron' IP : 192.168.2.103)
> I' ve coded a little aplication who read un file and create a  
> sessions if
> session not exist.
>
> If i use the system in mod load balancing (with no cluster mod  
> activate)
> all is great (my config is of course  
> worker.loadbalancer.sticky_session=true
> )
>
> So system run with session affinitu but the two server are  
> accessible ;)
>
> Now i try to configure as cluster mode with session replication
> (my config is now worker.loadbalancer.sticky_session=3Dfalse)
>
> I configure my to server.xml like that :
> agnes (IP : 192.168.2.102)
>
> <Server port="8005" shutdown="SHUTDOWN">
>   <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" maxHttpHeaderSize="8192"
>                       maxThreads="150" minSpareThreads="25"
>                       maxSpareThreads="75"
>                       enableLookups="false" redirectPort="8443"
> acceptCount="100"
>                       connectionTimeout="20000"  
> disableUploadTimeout="true"
> />
>
>     <Connector port="8009" enableLookups="false"
>                       redirectPort="8443" protocol="AJP/1.3" />
>
>     <Engine name="Catalina" defaultHost="localhost"  
> jvmRoute="node01" >
>
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>                    resourceName="UserDatabase" />
>
>       <Host name="localhost" appBase="webapps"
>                unpackWARs="true" autoDeploy="true"
>                xmlValidation="false" xmlNamespaceAware="false">
>      <Cluster  
> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>                   doClusterLog="true"
>                   clusterLogName="clusterlog"
>                   manager.className="
> org.apache.catalina.cluster.session.DeltaManager"
>                   manager.expireSessionsOnShutdown="false"
>                   manager.notifyListenersOnReplication="true"
>                   manager.notifySessionListenersOnReplication="true"
>                   manager.sendAllSessions="true"
>                   manager.sendAllSessionsSize="500"
>                   manager.sendAllSessionsWaitTime="20">
>
>         <Membership className="
> org.apache.catalina.cluster.mcast.McastService"
>                              mcastBindAddress="192.168.2.102"
>                              mcastAddr="224.0.0.1"
>                              mcastPort="45564"
>                              mcastFrequency="1000"
>                              mcastDropTime="30000"/>
>
>         <Receiver className="
> org.apache.catalina.cluster.tcp.ReplicationListener"
>                          tcpListenAddress="192.168.2.102"
>                          tcpListenPort="4000"
>                          tcpSelectorTimeout="100"
>                          tcpThreadCount="6" />
>
>         <Sender className="
> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                       replicationMode="fastasyncqueue"
>                       doTransmitterProcessingStats="true"
>                       doProcessingStats="true"
>                       doWaitAckStats="true"
>                       queueTimeWait="true"
>                       queueDoStats="true"
>                       queueCheckLock="true"
>                       ackTimeout="15000"
>                       waitForAck="true"
>                       keepAliveTimeout="80000"
>                       keepAliveMaxRequestCount="-1" />
>
>       </Host>
>     </Engine>
>   </Service>
> </Server>
>
>
> ovea-inspiron (IP : 192.168.2.103)
> <Server port="9005" shutdown="SHUTDOWN">
>
>   <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="9080" maxHttpHeaderSize="8192"
>                      maxThreads="150" minSpareThreads="25"
>                      maxSpareThreads="75"
>                      enableLookups="false" redirectPort="8443"
>                      acceptCount="100"
>                      connectionTimeout="20000"  
> disableUploadTimeout="true"
> />
>
>    <Connector port="9009" enableLookups="false"
>                      redirectPort="8443" protocol="AJP/1.3" />
>
>    <Engine name="Catalina" defaultHost="localhost" jvmRoute="node02" >
>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>                   resourceName="UserDatabase"/>
>
>      <Host name="localhost" appBase="webapps"
>               unpackWARs="true" autoDeploy="true"
>               xmlValidation="false" xmlNamespaceAware="false">
>
>      <Cluster  
> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>                   doClusterLog="true"
>                   clusterLogName="clusterlog"
>                   manager.className="
> org.apache.catalina.cluster.session.DeltaManager"
>                   manager.expireSessionsOnShutdown="false"
>                   manager.notifyListenersOnReplication="true"
>                   manager.notifySessionListenersOnReplication="true"
>                   manager.sendAllSessions="true"
>                   manager.sendAllSessionsSize="500"
>                   manager.sendAllSessionsWaitTime="20">
>
>         <Membership className="
> org.apache.catalina.cluster.mcast.McastService"
>                              mcastBindAddress="192.168.2.103"
>                              mcastAddr="224.0.0.1"
>                              mcastPort="45564"
>                              mcastFrequency="1000"
>                              mcastDropTime="30000"/>
>
>         <Receiver className="
> org.apache.catalina.cluster.tcp.ReplicationListener"
>                         tcpListenAddress="192.168.2.103"
>                         tcpListenPort="4000"
>                         tcpSelectorTimeout="100"
>                         tcpThreadCount="6" />
>
>         <Sender className="
> org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                       replicationMode="fastasyncqueue"
>                       doTransmitterProcessingStats="true"
>                       doProcessingStats="true"
>                       doWaitAckStats="true"
>                       queueTimeWait="true"
>                       queueDoStats="true"
>                       queueCheckLock="true"
>                       ackTimeout="15000"
>                       waitForAck="true"
>                       keepAliveTimeout="80000"
>                       keepAliveMaxRequestCount="-1" />
>
>       </Host>
>     </Engine>
>   </Service>
> </Server>
>
>
> I'm user linux so i've compiled my kernel with multicat kernel option
> I add the rout like rooute add -host 224.0.0.1 dev eth0
>
> N.B : why 224.0.0.1 => http://www.iana.org/assignments/multicast- 
> addresses
>
> So route is :
> ALL-SYSTEMS.MCA *     255.255.255.255 UH    0      0        0 eth0
> 192.168.2.0     *              255.255.255.0     U      0       
> 0        0
> eth0
> loopback        *               255.0.0.0            U      0      0
>  0 lo
> default         .                  0.0.0.0               UG     
> 0      0
>    0 eth0
>
> now i start the two tomcat with the same application in webapp  
> directories
> with tcpdump i verify the multicasting btewen my server .. so :
>
> 19:39:17.809978 IP 192.168.2.102.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:18.546034 IP ovea-inspiron.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:18.814418 IP 192.168.2.102.45564 > all-systems.mcast.net. 
> 45564UDP,
> length 56
> 19:39:19.790470 IP ovea-inspiron.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:19.818691 IP 192.168.2.102.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:20.826650 IP 192.168.2.102.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:20.943933 IP ovea-inspiron.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:21.806813 arp who-has . tell 192.168.2.102
> 19:39:21.806972 arp reply . is-at 00:04:e2:b6:65:0a (oui Unknown)
> 19:39:21.831048 IP 192.168.2.102.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:22.164812 IP ovea-inspiron.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
> 19:39:22.835240 IP 192.168.2.102.45564 > all-systems.mcast.net. 
> 45564:UDP,
> length 56
>
> So all semms to be OK but i've
>
> Feb 14, 2006 6:33:26 PM  
> org.apache.catalina.cluster.tcp.SimpleTcpCluster st
> art
> INFO: Cluster is about to start
> Feb 14, 2006 6:33:26 PM
> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterVa 
> lves
> INFO: Add Default ClusterValves at cluster localhost
> Feb 14, 2006 6:33:26 PM
> org.apache.catalina.cluster.tcp.SimpleTcpClustercreateDefaultClusterLi 
> stener
> INFO: Add Default ClusterListener at cluster localhost
> Feb 14, 2006 6:33:26 PM
> org.apache.catalina.cluster.tcp.ReplicationTransmitter start
> INFO: Start ClusterSender at cluster  
> Catalina:type=3DCluster,host=3Dlocalhost
> with name Catalina:type=3DClusterSender,host=3Dlocalhost
> Feb 14, 2006 6:33:26 PM
> org.apache.catalina.cluster.mcast.McastServiceImplsetupSocket
> INFO: Setting multihome multicast interface to:/192.168.2.102
> Feb 14, 2006 6:33:26 PM  
> org.apache.catalina.cluster.mcast.McastService start
> INFO: Sleeping for 4000 secs to establish cluster membership
> Feb 14, 2006 6:33:30 PM
> org.apache.catalina.cluster.mcast.McastServiceregisterMBean
> INFO: membership mbean registered
> (Catalina:type=3DClusterMembership,host=3Dlocalhost)
> Feb 14, 2006 6:33:31 PM org.apache.catalina.startup.HostConfig  
> deployWAR
> INFO: Deploying web application archive cluster-1.0-SNAPSHOT.war
> Feb 14, 2006 6:33:31 PM  
> org.apache.catalina.cluster.session.DeltaManager st
> art
> INFO: Register manager /cluster-1.0-SNAPSHOT to cluster element  
> Host with
> name localhost
> Feb 14, 2006 6:33:31 PM  
> org.apache.catalina.cluster.session.DeltaManager st
> art
> INFO: Starting clustering manager at /cluster-1.0-SNAPSHOT
> Feb 14, 2006 6:33:31 PM
> org.apache.catalina.cluster.session.DeltaManagergetAllClusterSessions
> INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No  
> members
> active in cluster group.
>
> As you can see in the last line cluster member are not found !!!!
>
> What's the hell ;)
>
> When i test my application i've always the sequences :
>
>    This page is rendered on server : *Cluster Node - 01 (One) New  
> session is
> created with saved value ....UserId : 123456
>    This page is rendered on server : *Cluster Node - 02 (Two) New  
> session is
> created with saved value ....UserId : 123456
>    This page is rendered on server : *Cluster Node - 01 (One) New  
> session is
> created with saved value ....UserId : 123456
>
> So the request is well balanced but a new session is alway  
> created !!!!!
>
> Some ideas ...
>
> Thank you guys


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