STONITH is the service used by Heartbeat to protect shared data. Heartbeat is capable of controlling a number of network power switches, and can prevent a potentially faulty node from corrupting shared data by using STONITH to cut the power to that node.
With the STONITH service configured properly, Heartbeat does the following if a node fails:
Notices that the node is not sending “I’m alive” packets out to the cluster.
Sends out pre-stop notifications to the other cluster nodes.
These notifications include messages that the failed node will be powered off.
Instructs the STONITH service to power off the failed node.
Sends post-stop notifications to other cluster nodes after successfully powering off the failed node.
These notifications include messages that the failed node will be powered off.
For Heartbeat, STONITH must be configured as a cluster resource. After reviewing Heartbeat 2 Cluster Resource Configuration in chapter 4, continue with Section 2.7.1, “Configuring STONITH as a Cluster Resource” below.
To configure STONITH as a cluster resource, complete the following steps:
Start the HA Management Client by entering hb_gui at the command line of a Linux server or workstation.
Log in to the cluster by clicking , selecting , then providing the username and password.
If you are running the HA Management Client on Heartbeat cluster server, the server and username fields should already be filled in. If not, specify the server IP address of a cluster server and hacluster as the username.
Click and then , or click the + button.
Choose as the item type.
Specify the name ( ) for the STONITH resource.
In the parameters section of the page, scroll down and select the type of STONITH device that corresponds to your network power switch.
(Conditional) After selecting a STONITH resource type, a line for that resource type might be added to the Parameters section of the screen. If a line is added, click the line once and then click the line again under the heading to open a field where you can add the needed value.
Some STONITH options require you to add parameter values in the parameters section of the page. For example, you may be required to add host names (server names) for each cluster node in your cluster. You can find the hostname for each server using the uname -n command on the server. You can add multiple hostnames in the provided field using a comma or a space to separate the names.
Select the checkbox.
This allows the resource to simultaneously run on multiple cluster nodes.
In the field, enter the number of instances of STONITH that will run on a given node. This value should normally be set to 1.
In the field, enter the number of nodes in the cluster that will run the STONITH service. Be mindful of the number of concurrent connections your STONITH device supports.
Click to add the STONITH resource to the cluster.
Select the resource in the left pane and click + to start the STONITH resource.
After creating the STONITH resource, you must create location constraints for it. Location constraints determine which nodes STONITH can run on in the cluster. See Constraints on the High Availability Linux Web site.
Starting the STONITH resource will cause it to start on the nodes that have been specified with its resource location contraints.