JGroups Protocol RELAY2: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:
RELAY2 protocol was introduced to allow relaying (bridging) messages between two or more clusters.  
RELAY2 protocol was introduced to allow relaying (bridging) messages between two or more clusters.  


The relaying mechanism works by establishing a "bridging cluster" between the participating local clusters. Each local cluster is "represented" by its coordinator, which is the only node in the local cluster that forwards messages to the coordinators of other clusters participating in the relaying process. In order to achieve this, each coordinator joins a parallel JGroups group, by using a different JGroups stack, initialized and started in addition to its main (local) JGroups stack.
The relaying mechanism works by establishing a "bridging cluster" between the participating local clusters. Each local cluster is "represented" in the bridging cluster by its coordinator, which is the only node in the local cluster that forwards messages to the coordinators of other clusters participating in the relaying process. The only members of the bridging cluster are the local group coordinators. A message sent to the bridging cluster reaches all its member, hence all participating clusters.  


A message sent to the bridging cluster reaches all its member, hence all participating clusters.
For two local clusters ("blue" and "red"), relaying works in both directions: messages passing between the members of cluster "blue" will be forwarded to cluster "red", eventually reaching all its members, while messages passing between the members of the cluster "red" will be forwarded to the cluster "blue"


For two local clusters ("blue" and "red"), relaying works in both directions: messages passing between the members of cluster "blue" will be forwarded to cluster "red", eventually reaching all its members, while messages passing between the members of the cluster "red" will be forwarded to the cluster "blue"
The relaying mechanism is implemented at JGroups level by adding a RELAY2 protocol at the top of the stack. The RELAY2 protocol instantiates and starts a new JGroups channel, which is used to join the bridging cluster. Thus, the coordinator instance will run two parallel JGroups stacks. The bridging clusters typically use the TCP transport.
 
In case a local coordinator dies, the next local member takes over as coordinator, joins the bridging cluster in the process, and continues relaying messages.
 
=The <tt>site</tt> Property=
 
The RELAY2 <tt>site</tt> property must be set consistently on all members of a local cluster:


In case a local coordinator dies <font color=red>TODO</font>.
<pre>
<relay.RELAY2 site="cell-1" config=".../relay2.xml" relay_multicasts="false"/>
</pre>


=Configuration=
=Configuration=

Revision as of 20:56, 7 June 2016

External

Internal

Overview

RELAY2 protocol was introduced to allow relaying (bridging) messages between two or more clusters.

The relaying mechanism works by establishing a "bridging cluster" between the participating local clusters. Each local cluster is "represented" in the bridging cluster by its coordinator, which is the only node in the local cluster that forwards messages to the coordinators of other clusters participating in the relaying process. The only members of the bridging cluster are the local group coordinators. A message sent to the bridging cluster reaches all its member, hence all participating clusters.

For two local clusters ("blue" and "red"), relaying works in both directions: messages passing between the members of cluster "blue" will be forwarded to cluster "red", eventually reaching all its members, while messages passing between the members of the cluster "red" will be forwarded to the cluster "blue"

The relaying mechanism is implemented at JGroups level by adding a RELAY2 protocol at the top of the stack. The RELAY2 protocol instantiates and starts a new JGroups channel, which is used to join the bridging cluster. Thus, the coordinator instance will run two parallel JGroups stacks. The bridging clusters typically use the TCP transport.

In case a local coordinator dies, the next local member takes over as coordinator, joins the bridging cluster in the process, and continues relaying messages.

The site Property

The RELAY2 site property must be set consistently on all members of a local cluster:

<relay.RELAY2 site="cell-1" config=".../relay2.xml" relay_multicasts="false"/>

Configuration

This is an example of how to configure two Infinispan clusters to relay to each other:

Bridge Two Infinsipan Clustered Caches with RELAY2