tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: Session replication problem
Date Wed, 11 Feb 2009 03:07:35 GMT
that's easy

 >I need server1.tomcat8080 & server2.tomcat8080 to replicate their 
sessions

make sure 8080 server have <Membership port="X"/>

 >and server1.tomcat8081 & server2.tomcat8081 to replicate their sessions

and <Membership port="Y"/>

http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-membership.html

having a unique port will divide the membership

Filip

Mohamedin wrote:
> Let me give an example:
>
> I have server1 with tomcat8080 & tomcat8081
> server2 also with tomcat8080 & tomcat8081
>
> I need server1.tomcat8080 & server2.tomcat8080 to replicate their 
> sessions
>
> and server1.tomcat8081 & server2.tomcat8081 to replicate their sessions
>
> What I see in the log is all see all sessions e.g.
>
> server1.tomcat8080, server2.tomcat8080, server1.tomcat8081 & 
> server2.tomcat8081 replicate the sessions all together
>
>
> Thanks a lot,
> Mohamedin
> ----- Original Message ----- From: "Filip Hanik - Dev Lists" 
> <devlists@hanik.com>
> To: "Tomcat Users List" <users@tomcat.apache.org>
> Sent: Tuesday, February 10, 2009 4:10 AM
> Subject: Re: Session replication problem
>
>
>> Mohamedin wrote:
>>> I have a problem with Session replication. I am running multible 
>>> tomcat instance on the same server. And I have 4 servers of the same 
>>> configuration (Multible tomcat instances). I have enabled the 
>>> session replication on these 4 servers (In each instance with 
>>> different port).
>>>
>>> The problem is that All instances see each other. while I only need 
>>> similar instances to see each other.
>>>
>> I'm not sure I understand what you are trying to achieve, what do you 
>> mean by "similar"
>>
>> Filip
>>
>>> The config:
>>>
>>>
>>>     <Engine name="Catalina" defaultHost="localhost" 
>>> jvmRoute="myserver">
>>>
>>>          <Cluster 
>>> className="org.apache.catalina.ha.tcp.SimpleTcpCluster" 
>>> channelSendOptions="8">
>>>                  <Manager 
>>> className="org.apache.catalina.ha.session.DeltaManager"
>>>                          expireSessionsOnShutdown="false" 
>>> notifyListenersOnReplication="true"
>>>                          domainReplication="true" />
>>>                  <Channel 
>>> className="org.apache.catalina.tribes.group.GroupChannel">
>>>                          <Sender 
>>> className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> 
>>>
>>>                                  <Transport 
>>> className="org.apache.catalina.tribes.transport.nio.PooledParallelSender" 
>>> />
>>>                          </Sender>
>>>                          <Receiver 
>>> className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>>>                                  address="245.245.245.245" 
>>> port="8888" autoBind="100" selectorTimeout="5000"
>>>                                  maxThreads="6" />
>>>                          <Interceptor 
>>> className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"

>>> />
>>>                          <Interceptor 
>>> className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Intercepto

>>> r" />
>>>                          <Interceptor 
>>> className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor

>>> ">
>>>                                  <Member 
>>> className="org.apache.catalina.tribes.membership.StaticMember"
>>>                                          port="8888" securePort="-1" 
>>> host="245.245.245.246" domain="245.245.245.246" />
>>>                                  <Member 
>>> className="org.apache.catalina.tribes.membership.StaticMember"
>>>                                          port="8888" securePort="-1" 
>>> host="245.245.245.247" domain="245.245.245.247" />
>>>                                  <Member 
>>> className="org.apache.catalina.tribes.membership.StaticMember"
>>>                                          port="8888" securePort="-1" 
>>> host="245.245.245.248" domain="245.245.245.248" />
>>>                          </Interceptor>
>>>                  </Channel>
>>>                  <Valve 
>>> className="org.apache.catalina.ha.tcp.ReplicationValve" filter="" />
>>>                  <ClusterListener 
>>> className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener" 
>>> />
>>>                  <ClusterListener 
>>> className="org.apache.catalina.ha.session.ClusterSessionListener" />
>>>          </Cluster>
>>> .
>>> .
>>> .
>>>
>>> other instances use the same config (Only different port)
>>>
>>>
>>> In the log I see:
>>>
>>> 07.02.2009 18:08:19 org.apache.catalina.core.AprLifecycleListener init
>>> INFO: The APR based Apache Tomcat Native library which allows 
>>> optimal performance in production environments was not found on the 
>>> java.library.path: 
>>> /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/amd64/server:/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/amd64:/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/../lib/amd64

>>>
>>> 07.02.2009 18:08:20 org.apache.coyote.http11.Http11Protocol init
>>> INFO: Initializing Coyote HTTP/1.1 on http-8083
>>> 07.02.2009 18:08:20 org.apache.catalina.startup.Catalina load
>>> INFO: Initialization processed in 483 ms
>>> 07.02.2009 18:08:20 org.apache.catalina.core.StandardService start
>>> INFO: Starting service Catalina
>>> 07.02.2009 18:08:20 org.apache.catalina.core.StandardEngine start
>>> INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster start
>>> INFO: Cluster is about to start
>>> 07.02.2009 18:08:20 
>>> org.apache.catalina.tribes.transport.ReceiverBase bind
>>> INFO: Receiver Server Socket bound to:/245.245.245.245:8888
>>> 07.02.2009 18:08:20 
>>> org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>> INFO: Setting cluster mcast soTimeout to 500
>>> 07.02.2009 18:08:20 
>>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>>> INFO: Sleeping for 1000 milliseconds to establish cluster 
>>> membership, start level:4
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://245.245.245.246:8888,245.245.245.246,8888,

>>> alive=0,id={0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }, payload={}, 
>>> command={}, domain={55 54 46 55 53 46 49 55 52 ...(12)}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://245.245.245.247:8888,245.245.245.247,8888,

>>> alive=0,id={0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }, payload={}, 
>>> command={}, domain={55 54 46 55 53 46 49 50 57 ...(13)}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://245.245.245.248:8888,245.245.245.248,8888,

>>> alive=0,id={0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }, payload={}, 
>>> command={}, domain={55 54 46 55 53 46 49 50 57 ...(13)}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -122}:8885,{245, 245, -127, -122},8885, 
>>> alive=1557715556,id={29 -48 -66 -36 118 -26 73 69 -79 63 -103 66 65 
>>> -97 97 -8 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -121}:8885,{245, 245, -127, -121},8885, 
>>> alive=1557693573,id={-115 69 -89 23 78 58 70 -3 -116 -94 43 -96 -107 
>>> 126 45 104 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -121}:8887,{245, 245, -127, -121},8887, 
>>> alive=458519912,id={33 -39 97 66 -16 -10 74 -55 -97 108 -50 41 -34 
>>> 34 108 -34 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -122}:8886,{245, 245, -127, -122},8886, 
>>> alive=2072192090,id={-97 85 125 -85 -14 18 65 -52 -76 -69 -84 -6 -58 
>>> -90 -7 -51 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -120}:8887,{245, 245, -127, -120},8887, 
>>> alive=458517809,id={101 97 80 78 91 -90 72 17 -67 -64 -67 26 71 46 4 
>>> 26 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -122}:8889,{245, 245, -127, -122},8889, 
>>> alive=1574200,id={124 -98 99 -107 -112 64 79 85 -78 14 -68 67 17 -63 
>>> -102 -96 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -120}:8886,{245, 245, -127, -120},8886, 
>>> alive=2068579927,id={-81 -53 7 47 85 -77 79 -92 -89 -84 66 -81 37 
>>> 122 25 -101 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -122}:8884,{245, 245, -127, -122},8884, 
>>> alive=9774676,id={-100 26 -106 -42 -31 21 79 -27 -98 33 -51 -32 36 
>>> 48 35 -44 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -121}:8889,{245, 245, -127, -121},8889, 
>>> alive=1574134,id={-96 -105 57 16 20 -44 76 -89 -72 33 -72 -115 29 2 
>>> 62 92 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -120}:8885,{245, 245, -127, -120},8885, 
>>> alive=1557675806,id={-69 31 98 -128 106 -114 70 120 -123 10 124 19 
>>> -81 57 -43 50 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -121}:8884,{245, 245, -127, -121},8884, 
>>> alive=9756286,id={-88 54 125 -70 15 -7 74 -128 -106 -76 -65 -117 -46 
>>> 123 -104 -48 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -120}:8884,{245, 245, -127, -120},8884, 
>>> alive=9718820,id={-10 120 -108 36 87 113 64 -122 -75 36 -118 -71 -46 
>>> 23 -74 99 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -121}:8886,{245, 245, -127, -121},8886, 
>>> alive=2070822680,id={74 -87 -120 -79 101 -110 73 -69 -122 21 63 89 
>>> -88 -14 36 -125 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster 
>>> memberAdded
>>> INFO: Replication member 
>>> added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 
>>> 245, -127, -122}:8887,{245, 245, -127, -122},8887, 
>>> alive=343653096,id={-18 11 -10 -124 -3 89 74 47 -69 -92 108 -41 33 
>>> -127 49 -106 }, payload={}, command={}, domain={}, ]
>>> 07.02.2009 18:08:21 
>>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>>> INFO: Done sleeping, membership established, start level:4
>>> 07.02.2009 18:08:21 
>>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>>> INFO: Sleeping for 1000 milliseconds to establish cluster 
>>> membership, start level:8
>>> 07.02.2009 18:08:21 org.apache.catalina.tribes.io.BufferPool 
>>> getBufferPool
>>> INFO: Created a buffer pool with max size:104857600 bytes of 
>>> type:org.apache.catalina.tribes.io.BufferPool15Impl
>>> 07.02.2009 18:08:21 
>>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>>> WARNUNG: Context manager doesn't exist:localhost#/shop
>>> 07.02.2009 18:08:21 
>>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>>> WARNUNG: Context manager doesn't exist:localhost#/shop
>>> 07.02.2009 18:08:22 
>>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>>> WARNUNG: Context manager doesn't exist:localhost#/shop
>>> 07.02.2009 18:08:22 
>>> org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
>>> INFO: Done sleeping, membership established, start level:8
>>> 07.02.2009 18:08:22 
>>> org.apache.catalina.ha.session.ClusterSessionListener messageReceived
>>> WARNUNG: Context manager doesn't exist:localhost#/shop
>>> 07.02.2009 18:08:22 org.apache.catalina.loader.WebappClassLoader 
>>> validateJarFile
>>> 07.02.2009 18:08:22 org.apache.catalina.ha.session.DeltaManager start
>>> INFO: Register manager /shop to cluster element Engine with name 
>>> Catalina
>>> 07.02.2009 18:08:22 org.apache.catalina.ha.session.DeltaManager start
>>> INFO: Starting clustering manager at /shop
>>> 07.02.2009 18:08:22 org.apache.catalina.ha.session.DeltaManager 
>>> getAllClusterSessions
>>> WARNUNG: Manager [localhost#/shop], requesting session state from 
>>> org.apache.catalina.tribes.membership.MemberImpl[tcp://{245, 245, 
>>> -127, -122}:8886,{245, 245, -127, -122},8886, 
>>> alive=2072194104,id={-97 85 125 -85 -14 18 65 -52 -76 -69 -84 -6 -58 
>>> -90 -7 -51 }, payload={}, command={}, domain={}, ]. This operation 
>>> will timeout if no session state has been received within 60 seconds.
>>> 07.02.2009 18:08:23 org.apache.catalina.ha.session.DeltaManager 
>>> waitForSendAllSessions
>>> INFO: Manager [localhost#/shop]; session state send at 07.02.09 
>>> 18:08 received in 421 ms.
>>> 07.02.2009 18:08:23 org.apache.catalina.ha.session.DeltaManager 
>>> getAllClusterSessions
>>> WARNUNG: Manager [localhost#/shop]: Drop message SESSION-MODIFIED 
>>> inside GET_ALL_SESSIONS sync phase start date 07.02.09 18:00 message 
>>> date 07.02.09 18:00
>>>
>>>
>>> Thanks a lot,
>>> Mohamedin
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus 
>> signature database 3840 (20090210) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message