JBoss.org Community Documentation

19.4.1. PING

PING is a discovery protocol that works by either multicasting PING requests to an IP multicast address or connecting to a gossip router. As such, PING normally sits on top of the UDP or TUNNEL transport protocols. Each node responds with a packet {C, A}, where C=coordinator's address and A=own address. After timeout milliseconds or num_initial_members replies, the joiner determines the coordinator from the responses, and sends a JOIN request to it (handled by). If nobody responds, we assume we are the first member of a group.

Here is an example PING configuration for IP multicast.

<PING timeout="2000"
    num_initial_members="2"
    down_thread="false" up_thread="false"/>
                

Here is another example PING configuration for contacting a Gossip Router.

	
<PING gossip_host="localhost"
      gossip_port="1234"
	      timeout="3000" 
	      num_initial_members="3"
	      down_thread="false" up_thread="false"/>

The available attributes in the PING element are listed below.

  • timeout specifies the maximum number of milliseconds to wait for any responses. The default is 3000.

  • num_initial_members specifies the maximum number of responses to wait for unless timeout has expired. The default is 2.

  • gossip_host specifies the host on which the GossipRouter is running.

  • gossip_port specifies the port on which the GossipRouter is listening on.

  • gossip_refresh specifies the interval (in milliseconds) for the lease from the GossipRouter. The default is 20000.

  • initial_hosts is a comma-seperated list of addresses (e.g., host1[12345],host2[23456]), which are pinged for discovery.

If both gossip_host and gossip_port are defined, the cluster uses the GossipRouter for the initial discovery. If the initial_hosts is specified, the cluster pings that static list of addresses for discovery. Otherwise, the cluster uses IP multicasting for discovery.

Note

The discovery phase returns when the timeout ms have elapsed or the num_initial_members responses have been received.