6.7.2. Configuring a Single Storage-Based Fence Device for a Node
When using non-power fencing methods (that is, SAN/storage fencing) to fence a node, you must configure unfencing for the fence device. This ensures that a fenced node is not re-enabled until the node has been rebooted. When you configure a device that requires unfencing, the cluster must first be stopped and the full configuration including devices and unfencing must be added before the cluster is started.
When you configure unfencing for a node, you specify a device that mirrors the corresponding fence device you have configured for the node with the notable addition of the explicit action of
on or enable.
For more information about unfencing a node, see the
fence_node(8) man page.
Use the following procedure to configure a node with a single storage-based fence device that uses a fence device named
sanswitch1, which uses the fence_sanbox2 fencing agent.
- Add a fence method for the node, providing a name for the fence method.
ccs -h host --addmethod method node
ccs -h host --addmethod method nodeCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to configure a fence method namedSANfor the nodenode-01.example.comin the configuration file on the cluster nodenode-01.example.com, execute the following command:ccs -h node01.example.com --addmethod SAN node01.example.com
ccs -h node01.example.com --addmethod SAN node01.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Add a fence instance for the method. You must specify the fence device to use for the node, the node this instance applies to, the name of the method, and any options for this method that are specific to this node:
ccs -h host --addfenceinst fencedevicename node method [options]
ccs -h host --addfenceinst fencedevicename node method [options]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to configure a fence instance in the configuration file on the cluster nodenode-01.example.comthat uses the SAN switch power port 11 on the fence device namedsanswitch1to fence cluster nodenode-01.example.comusing the method namedSAN, execute the following command:ccs -h node01.example.com --addfenceinst sanswitch1 node01.example.com SAN port=11
ccs -h node01.example.com --addfenceinst sanswitch1 node01.example.com SAN port=11Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To configure unfencing for the storage-based fence device on this node, execute the following command:
ccs -h host --addunfence fencedevicename node action=on|off
ccs -h host --addunfence fencedevicename node action=on|offCopy to Clipboard Copied! Toggle word wrap Toggle overflow
You will need to add a fence method for each node in the cluster. The following commands configure a fence method for each node with the method name
SAN. The device for the fence method specifies sanswitch as the device name, which is a device previously configured with the --addfencedev option, as described in Section 6.5, “Configuring Fence Devices”. Each node is configured with a unique SAN physical port number: The port number for node-01.example.com is 11, the port number for node-02.example.com is 12, and the port number for node-03.example.com is 13.
Example 6.3, “
cluster.conf After Adding Storage-Based Fence Methods ” shows a cluster.conf configuration file after you have added fencing methods, fencing instances, and unfencing to each node in the cluster.
Example 6.3. cluster.conf After Adding Storage-Based Fence Methods
Note that when you have finished configuring all of the components of your cluster, you will need to sync the cluster configuration file to all of the nodes, as described in Section 6.15, “Propagating the Configuration File to the Cluster Nodes”.