7.4.1. PING

7.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.

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.