JGroupsGossipRouter

Here's a brief FAQ on the Gossip Router

 

Q. When do I need to use a GossipRouter/GossipServer?

 

The Gossip Router is intended for cases when there're firewalls in between cluster nodes that will block the TCP traffic. Let's say you have 10 members each in a different network spread accross the world. You're likely to have a Firewall in between each node and the world. UDP is out of question and with TCP, each member would need 9 permanent connections to the rest of members. With Gossip Router, you just need one connection, to the router, so you go from N connections to just 1 connection, where N is the number of members in the cluster. Also, firewals do not generally accept incoming connections from outside. By having the Gossip Router, the connection established between the node and the router is used to send back data from other nodes avoiding other nodes opening connections with the firewall to access the node behing it.

 

Q. Do we setup 2 different partitions, or just one (or does it not matter since on different networks)?

 

No, one partition. Members of the same cluster must have the same partition name, otherwise they won't see each others messages.

 

Q. Do we use a Gossip Server or a Gossip Router? Both?

 

We only use Gossip Router now. Gossip Server has been phased out and it's no longer present from JGroups 2.4 onwards.

 

Q. How many Gossip Routers do we startup and which network(s) should it be on? A gossip router on each network?

 

The most common setup is having a single Gossip Router which is connected to cluster members that are behing a firewall. This router should be located in the network segment providing best connectivity to all cluster members.

 

Q. What happens when the Gossip Router crashes? How do you achieve fault tolerance?

 

As far as the Gossip Router is concerned, it's a single point of failure and currently TUNNEL does not allow to have multiple Gossip Router settings which is not a trivial feature to implement. Regarding the Gossip Router detecting the failure of a node, we use a Lease-based mechanism. Each member needs to re-register periodically with the Gossip Router. If the Gossip Router doesn't receive a registration, it will remove that member from its table.

 

Q. What is the resource allocation for a Gossip Router. Should it run on its own hardware? What are the recommended JVM startup parameters (heap size, garbage collection strategy, etc.)?

 

 

A Gossip Router's roles is to forward messages, so performance and throughput are paramount while memory consumption is not that important. Therefore, your settings should oriented at avoiding full Garbage Collections which bring the JVM to a halt. So, you want Eden to be big enough so that the majority of the objects get garbaged collected there.

 

Another important characteristic would be at the connectivity level between this machine and the cluster members, making bandwith and high capacity switches very important.

 

Q. How to run Gossip Router?

 

You need commons-logging.jar and jgroups.jar to run Gossip Router. Copy these jars from your JBoss installation.

 

java -classpath commons-logging.jar:jgroups.jar org.jgroups.stack.GossipRouter -port 12001