Product SiteDocumentation Site

9.3.3.2. Tell Pacemaker how to interpret the connectivity data

NOTE: Before reading the following, please make sure you have read and understood Chapter 8, Rules above.
There are a number of ways to use the connectivity data provided by Heartbeat. The most common setup is for people to have a single ping node and want to prevent the cluster from running a resource on any unconnected node.
Example 9.3. Don't run on unconnected nodes

  <rsc_location id="WebServer-no-connectivity" rsc="Webserver">
   <rule id="ping-exclude-rule" score="-INFINITY" >
    <expression id="ping-exclude" attribute="pingd" operation="not_defined"/>
   </rule>
  </rsc_location>


A more complex setup is to have a number of ping nodes configured. You can require the cluster to only run resources on nodes that can connect to all (or a minimum subset) of them
Example 9.4. Run only on nodes connected to 3 or more ping nodes (assumes multiplier is set to 1000)

  <rsc_location id="WebServer-connectivity" rsc="Webserver">
   <rule id="ping-prefer-rule" score="-INFINITY" >
    <expression id="ping-prefer" attribute="pingd" operation="lt" value="3000"/>
   </rule>
  </rsc_location> 


or instead you can tell the cluster only to prefer nodes with the most connectivity. Just be sure to set the multiplier to a value higher than that of resource-stickiness (and don't set either of them to INFINITY).
Example 9.5. Prefer the node with the most connected ping nodes

  <rsc_location id="WebServer-connectivity" rsc="Webserver">
   <rule id="ping-prefer-rule" score-attribute="pingd" >
    <expression id="ping-prefer" attribute="pingd" operation="defined"/>
   </rule>
  </rsc_location> 


It is perhaps easier to think of this in terms of the simple constraints that the cluster translates it into. For example, if sles-1 is connected to all 5 ping nodes but sles-2 is only connected to 2, then it would be as if you instead had the following constraints in your configuration:

  <rsc_location id="ping-1" rsc="Webserver" node="sles-1" score="5000"/>
  <rsc_location id="ping-2" rsc="Webserver" node="sles-2" score="2000"/>

Figure 9.1. How the cluster translates the pingd constraint

The advantage being that you don't have to manually update them whenever your network connectivity changes.
You can also combine the concepts above into something even more complex. The example below shows how you can prefer the node with the most connected ping nodes provided they have connectivity to at least three (assuming multiplier is set to 1000).
Example 9.6. A more complex example of choosing a location based on connectivity

  <rsc_location id="WebServer-connectivity" rsc="Webserver">
   <rule id="ping-exclude-rule" score="-INFINITY" >
    <expression id="ping-exclude" attribute="pingd" operation="lt" value="3000"/>
   </rule>
   <rule id="ping-prefer-rule" score-attribute="pingd" >
    <expression id="ping-prefer" attribute="pingd" operation="defined"/>
   </rule>
  </rsc_location>