2.3.4. Configuring a Node with Redundant Power
If your cluster is configured with redundant power supplies for your nodes, you must be sure to configure fencing so that your nodes fully shut down when they need to be fenced. If you configure each power supply as a separate fence method, each power supply will be fenced separately; the second power supply will allow the system to continue running when the first power supply is fenced and the system will not be fenced at all. To configure a system with dual power supplies, you must configure your fence devices so that both power supplies are shut off and the system is taken completely down. This requires that you configure two instances within a single fencing method, and that for each instance you configure both fence devices with an
action
attribute of off
before configuring each of the devices with an action
attribute of on
.
To configure fencing for a node with dual power supplies, follow the steps in this section.
- Before you can configure fencing for a node with redundant power, you must configure each of the power switches as a fence device for the cluster. For information on configuring fence devices, see Section 2.1, “Configuring Fence Devices”.To print a list of fence devices currently configured for your cluster, execute the following command:
ccs -h host --lsfencedev
- Add a fence method for the node, providing a name for the fence method.
ccs -h host --addmethod method node
For example, to configure a fence method namedAPC-dual
for the nodenode-01.example.com
in the configuration file on the cluster nodenode-01.example.com
, execute the following command:ccs -h node01.example.com --addmethod APC-dual node01.example.com
- Add a fence instance for the first power supply to the fence 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. At this point you configure the
action
attribute asoff
.ccs -h host --addfenceinst fencedevicename node method [options] action=off
For example, to configure a fence instance in the configuration file on the cluster nodenode-01.example.com
that uses the APC switch power port 1 on the fence device namedapc1
to fence cluster nodenode-01.example.com
using the method namedAPC-dual
, and setting theaction
attribute tooff
, execute the following command:ccs -h node01.example.com --addfenceinst apc1 node01.example.com APC-dual port=1 action=off
- Add a fence instance for the second power supply to the fence 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. At this point you configure the
action
attribute asoff
for this instance as well:ccs -h host --addfenceinst fencedevicename node method [options] action=off
For example, to configure a second fence instance in the configuration file on the cluster nodenode-01.example.com
that uses the APC switch power port 1 on the fence device namedapc2
to fence cluster nodenode-01.example.com
using the same method as you specified for the first instance namedAPC-dual
, and setting theaction
attribute tooff
, execute the following command:ccs -h node01.example.com --addfenceinst apc2 node01.example.com APC-dual port=1 action=off
- At this point, add another fence instance for the first power supply to the fence method, configuring the
action
attribute ason
. 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, and specifying theaction
attribute ason
:ccs -h host --addfenceinst fencedevicename node method [options] action=on
For example, to configure a fence instance in the configuration file on the cluster nodenode-01.example.com
that uses the APC switch power port 1 on the fence device namedapc1
to fence cluster nodenode-01.example.com
using the method namedAPC-dual
, and setting theaction
attribute toon
, execute the following command:ccs -h node01.example.com --addfenceinst apc1 node01.example.com APC-dual port=1 action=on
- Add another fence instance for second power supply to the fence method, specifying the
action
attribute ason
for this instance. 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 as well as theaction
attribute ofon
.ccs -h host --addfenceinst fencedevicename node method [options] action=on
For example, to configure a second fence instance in the configuration file on the cluster nodenode-01.example.com
that uses the APC switch power port 1 on the fence device namedapc2
to fence cluster nodenode-01.example.com
using the same method as you specified for the first instance namedAPC-dual
and setting theaction
attribute toon
, execute the following command:ccs -h node01.example.com --addfenceinst apc2 node01.example.com APC-dual port=1 action=on
Example 2.4, “
cluster.conf
After Adding Dual-Power Fencing ” shows a cluster.conf
configuration file after you have added fencing for two power supplies for each node in a cluster.
Example 2.4. cluster.conf
After Adding Dual-Power Fencing
<cluster name="mycluster" config_version="3"> <clusternodes> <clusternode name="node-01.example.com" nodeid="1"> <fence> <method name="APC-dual"> <device name="apc1" port="1"action="off"/> <device name="apc2" port="1"action="off"/> <device name="apc1" port="1"action="on"/> <device name="apc2" port="1"action="on"/> </method> </fence> </clusternode> <clusternode name="node-02.example.com" nodeid="2"> <fence> <method name="APC-dual"> <device name="apc1" port="2"action="off"/> <device name="apc2" port="2"action="off"/> <device name="apc1" port="2"action="on"/> <device name="apc2" port="2"action="on"/> </method> </fence> </clusternode> <clusternode name="node-03.example.com" nodeid="3"> <fence> <method name="APC-dual"> <device name="apc1" port="3"action="off"/> <device name="apc2" port="3"action="off"/> <device name="apc1" port="3"action="on"/> <device name="apc2" port="3"action="on"/> </method> </fence> </clusternode> </clusternodes> <fencedevices> <fencedevice agent="fence_apc" ipaddr="apc_ip_example" login="login_example" name="apc1" passwd="password_example"/> <fencedevice agent="fence_apc" ipaddr="apc_ip_example" login="login_example" name="apc2" passwd="password_example"/> </fencedevices> <rm> </rm> </cluster>
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.