12.5.4. Procedure – Configuring Heartbeat resources

Configuring Heartbeat resources has two main steps: creating the resource scripts and adding these resources to the Heartbeat component in MC. The general procedure is as follows.

  1. Create a resource script, or modify an existing one. Heartbeat resource scripts have to be placed into the /etc/ha.d/resource.d/ directory — this directory contains a number of resource script samples that cover the most commonly used scripts. You only have to edit the parameters of the selected script.

    The resource scripts installed by default are described in Step 3.

  2. Adding new Heartbeat resources

    Figure 12.21. Adding new Heartbeat resources

    Navigate to the Heartbeat component of the cluster. Resources can be managed in the Resources section of the panel. Click on New to add a new resource.

  3. Configuring Heartbeat resources

    Figure 12.22. Configuring Heartbeat resources

    Enter a name for the resource — this has to be the name of the resource script.

    The following resource scripts are available by default (see the actual scripts in the /etc/ha.d/resource.d directory of the nodes for details):

    • IPaddr: Adds/removes an alias IP address (that is, the Service IP).

      Note

      If only an IP address is specified as the resource name, it is automatically considered as an IPaddr resource.

    • IPsrcaddr: Manages the preferred source address associated with packets which originate on the localhost and are routed through the default route.

    • MailTo: Sends an e-mail to the system administrator whenever a takeover occurs.

    • SendArp: An alternative to the IPaddr resource to send gratuitous arp for an IP address on a given interface without adding the address to that interface. It should be used if for some reason you want to send gratuitous arp for addresses managed by IPaddr on an additional interface.

  4. The node on which the resource is active by default can be selected using the Master/Slave radio buttons.