views:

216

answers:

1

Hi,

I have a question regarding Clustering (session replication/failover) in tomcat 6 using BackupManager. Reason I chose BackupManager, is because it replicates the session to only one other server.

I am going to run through the example below to try and explain my question.

  • I have 6 nodes setup in a tomcat 6 cluster with BackupManager. The front end is one Apache server using mod_jk with sticky session enabled
  • Each node has 1 session each. node1 has a session from client1 node2 has a session from client2 .. ..
  • Now lets say node1 goes down ; assuming node2 is the backup, node2 now has two sessions (for client2 and client1)
  • The next time client1 makes a request, what exactly happens ? Does Apache "know" that node1 is down and does it send the request directly to node2 ?

    =OR=

    does it try each of the 6 instances and find out the hard way who the backup is ?

+1  A: 

Not too sure about the workings with BackupManager, my reading of this good URL suggests the replication is intelligent enough in identifying the backup.

In-memory session replication, is session data replicated across all Tomcat instances within the cluster, Tomcat offers two solutions, replication across all instances within the cluster or replication to only its backup server, this solution offers a guaranteed session data replication ...

SimpleTcpCluster uses Apache Tribes to maintain communicate with the communications group. Group membership is established and maintained by Apache Tribes, it handles server crashes and recovery. Apache Tribes also offer several levels of guaranteed message delivery between group members. This is achieved updating in-session memory to reflect any session data changes, the replication is done immediately between members ...

You can reduce the amount of data by using the BackupManager (send only to one node, the backup node)

You'll be able to see this from the logs if notifyListenersOnReplication="true" is set.

On the other hand, you could still use DeltaManager and split your cluster into 3 domains of 2 servers each.

Say these will be node 1 <-> node 2, 3 <-> 4 and 5 <-> 6.

In such a case - configuring the domain worker attribute, will ensure that session replication will only happen within the domain.

And mod_jk then definitely knows which server to look on when node1 fails.

http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html states

Currently you can use the domain worker attribute (mod_jk > 1.2.8) to build cluster partitions with the potential of having a more scaleable cluster solution with the DeltaManager(you'll need to configure the domain interceptor for this).

And a better example on this link:

http://people.apache.org/~mturk/docs/article/ftwai.html

See the "Domain Clustering model" section.

JoseK
The only way Apache would "know" who to send it to, is if it gets written in the cookie (same way WebLogic works). Should be easy to figure this one out by looking inside the cookie. Will pass on my findings once I set this up. Thanks.
Kevin

related questions