HTTP Session Replication - Buddy Replication
Buddy Replication Buddy replication is where pairs of nodes in the cluster become “buddies” and state replication is only done between the buddies. The configuration can be made to have more than one buddy, so it can be something other than a pair of nodes, but the default is to have one node as a buddy thereby forming pairs in your cluster. While replication happens between buddies, fail-over can occur over to any node and the session information will be migrated to the new node from a buddy if it isn't present already. The same tested referenced with full replication above with tests using HTTP sessions ranging from 4k to 16k and from 1 to 10 nodes in the cluster were performed with buddy replication. With buddy replication we were actually able to achieve scaling of near 90% of linear! This should be expected since the replication is never to more than one other node in the cluster. Therefore regardless of cluster size, scalability should be very good. Surely now your interest is peeked now so here is how to setup buddy replication. Edit the jboss-cache-manager-jboss-beans.xml in the following directory: jboss-eap-5.1/jboss-as/server/ /deploy/cluster/jboss-cache-manager.sar/META-INF where is either production or all, or your own custom configuration (the default and minimal configurations do not have the clustering configuration or the clustering code deployed). To enable buddy replication, simply modify the buddyReplicationConfig property Illustration 3: Enabling buddy replication in jboss-cache-manager-jboss-beans.xml located at jboss-eap-5.1/jboss-as/server//deploy/cluster/jboss-cache-manager.sar/META-INF That’s all you have to do, the rest is handled by the platform. With Buddy replication, it is recommended to use sticky sessions with your front end load balancer. This way you avoid your incoming requests from being load balanced and served throughout the cluster, thereby causing state replication throughout the whole cluster and removing the benefit of buddy replication.