Product SiteDocumentation Site

9.3.3. Moving Resources Due to Connectivity Changes

Setting up the cluster to move resources when external connectivity is lost, is a two-step process.

9.3.3.1. Tell Pacemaker to monitor connectivity

To do this, you need to add a ping resource to the cluster. The ping resource uses the system utility of the same name to a test if list of machines (specified by DNS hostname or IPv4/ IPv6 address) are reachable and uses the results to maintain a node attribute normally called pingd. [10]

Note

Older versions of Heartbeat required users to add ping nodes to ha.cf - this is no longer required.

Important

Older versions of Pacemaker used a custom binary called pingd for this functionality, this is now deprecated in favor of ping. If your version of Pacemaker does not contain the ping agent, you can download the latest version from: http://hg.clusterlabs.org/pacemaker/stable-1.0/raw-file/tip/extra/resources/ping
Normally the resource will run on all cluster nodes, which means that you'll need to create a clone. A template for this can be found below along with a description of the most interesting parameters.
Table 9.3. Common Options for a 'ping' Resource
Field Description
dampen The time to wait (dampening) for further changes occur. Use this to prevent a resource from bouncing around the cluster when cluster nodes notice the loss of connectivity at slightly different times.
multiplier The number by which to multiply the number of connected ping nodes by. Useful when there are multiple ping nodes configured.
host_list The machines to contact in order to determine the current connectivity status. Allowed values include resolvable DNS hostnames, IPv4 and IPv6 addresses.

Example 9.2. An example ping cluster resource, checks node connectivity once every minute

  <clone id="Connected">
   <primitive id="ping" provider="pacemaker" class="ocf" type="ping">
    <instance_attributes id="ping-attrs">
      <nvpair id="pingd-dampen" name="dampen" value="5s"/>
      <nvpair id="pingd-multiplier" name="multiplier" value="1000"/>
      <nvpair id="pingd-hosts" name="host_list" value="my.gateway.com www.bigcorp.com"/>
    </instance_attributes>
    <operations>
      <op id="ping-monitor-60s" interval="60s" name="monitor"/>
    </operations>
   </primitive>
  </clone>


Important

You're only half done. The next section deals with telling Pacemaker how to deal with the connectivity status that ocf:pacemaker:ping is recording.


[10] The attribute name is customizable which allows multiple ping groups to be defined