cluster.conf
as follows:
fencedevices
section, specify each fence device, using a fencedevice
element and fence-device dependent attributes. Example 5.3, “APC Fence Device Added to cluster.conf
” shows an example of a configuration file with an APC fence device added to it.
clusternodes
section, within the fence
element of each clusternode
section, specify each fence method of the node. Specify the fence method name, using the method
attribute, name
. Specify the fence device for each fence method, using the device
element and its attributes, name
and fence-device-specific parameters. Example 5.4, “Fence Methods Added to cluster.conf
” shows an example of a fence method with one fence device for each node in the cluster.
clusternodes
section, add an unfence
section. The unfence
section does not contain method
sections like the fence
section does. It contains device
references directly, which mirror the corresponding device sections for fence
, with the notable addition of the explicit action (action
) of "on" or "enable". The same fencedevice
is referenced by both fence
and unfence
device
lines, and the same per-node arguments should be repeated.
action
attribute as "on" or "enable" enables the node when rebooted. Example 5.4, “Fence Methods Added to cluster.conf
” and Example 5.5, “cluster.conf
: Multiple Fence Methods per Node” include examples of the unfence
elements and attributed.
unfence
refer to the fence_node
man page.
config_version
attribute by incrementing its value (for example, changing from config_version="2"
to config_version="3">
).
/etc/cluster/cluster.conf
.
cluster.rng
) by running the ccs_config_validate
command. For example:
[root@example-01 ~]# ccs_config_validate
Configuration validates
cman_tool version -r
command to propagate the configuration to the rest of the cluster nodes.
fenced
, the fence daemon, tries the next method, and continues to cycle through methods until one succeeds.
fenced
runs the fence agent once for each fence-device line; all must succeed for fencing to be considered successful.
fence_apc
). In addition, you can get more information about fencing parameters from Appendix A, Fence Device Parameters, the fence agents in /usr/sbin/
, the cluster schema at /usr/share/cluster/cluster.rng
, and the annotated schema at /usr/share/doc/cman-X.Y.ZZ/cluster_conf.html
(for example, /usr/share/doc/cman-3.0.12/cluster_conf.html
).
cluster.conf
<cluster name="mycluster" config_version="3"> <clusternodes> <clusternode name="node-01.example.com" nodeid="1"> <fence> </fence> </clusternode> <clusternode name="node-02.example.com" nodeid="2"> <fence> </fence> </clusternode> <clusternode name="node-03.example.com" nodeid="3"> <fence> </fence> </clusternode> </clusternodes> <fencedevices> <fencedevice agent="fence_apc" ipaddr="apc_ip_example" login="login_example" name="apc" passwd="password_example"/> </fencedevices> <rm> </rm> </cluster>
fencedevice
) has been added to the fencedevices
element, specifying the fence agent (agent
) as fence_apc
, the IP address (ipaddr
) as apc_ip_example
, the login (login
) as login_example
, the name of the fence device (name
) as apc
, and the password (passwd
) as password_example
.
cluster.conf
<cluster name="mycluster" config_version="3"> <clusternodes> <clusternode name="node-01.example.com" nodeid="1"> <fence> <method name="APC"> <device name="apc" port="1"/> </method> </fence> </clusternode> <clusternode name="node-02.example.com" nodeid="2"> <fence> <method name="APC"> <device name="apc" port="2"/> </method> </fence> </clusternode> <clusternode name="node-03.example.com" nodeid="3"> <fence> <method name="APC"> <device name="apc" port="3"/> </method> </fence> </clusternode> </clusternodes> <fencedevices> <fencedevice agent="fence_apc" ipaddr="apc_ip_example" login="login_example" name="apc" passwd="password_example"/> </fencedevices> <rm> </rm> </cluster>
method
) has been added to each node. The name of the fence method (name
) for each node is APC
. The device (device
) for the fence method in each node specifies the name (name
) as apc
and a unique APC switch power port number (port
) for each node. For example, the port number for node-01.example.com is 1
(port="1"
). The device name for each node (device name="apc"
) points to the fence device by the name (name
) of apc
in this line of the fencedevices
element: fencedevice agent="fence_apc"
ipaddr="apc_ip_example" login="login_example"
name="apc" passwd="password_example"/
.
cluster.conf
: Multiple Fence Methods per Node<cluster name="mycluster" config_version="3"> <clusternodes> <clusternode name="node-01.example.com" nodeid="1"> <fence> <method name="APC"> <device name="apc" port="1"/> </method> <method name="SAN"> <device name="sanswitch1" port="11"/> </method> </fence> <unfence> <device name="sanswitch1" port="11" action="on"/> </unfence </clusternode> <clusternode name="node-02.example.com" nodeid="2"> <fence> <method name="APC"> <device name="apc" port="2"/> </method> <method name="SAN"> <device name="sanswitch1" port="12"/> </method> </fence> <unfence> <device name="sanswitch1" port="12" action="on"/> </unfence </clusternode> <clusternode name="node-03.example.com" nodeid="3"> <fence> <method name="APC"> <device name="apc" port="3"/> </method> <method name="SAN"> <device name="sanswitch1" port="13"/> </method> </fence> <unfence> <device name="sanswitch1" port="13" action="on"/> </unfence </clusternode> </clusternodes> <fencedevices> <fencedevice agent="fence_apc" ipaddr="apc_ip_example" login="login_example" name="apc" passwd="password_example"/> <fencedevice agent="fence_sanbox2" ipaddr="san_ip_example" login="login_example" name="sanswitch1 passwd="password_example" </fencedevices> <rm> </rm> </cluster>
cluster.conf
: Fencing, Multipath Multiple Ports<cluster name="mycluster" config_version="3"> <clusternodes> <clusternode name="node-01.example.com" nodeid="1"> <fence> <method name="SAN-multi"> <device name="sanswitch1" port="11"/> <device name="sanswitch2" port="11"/> </method> </fence> <unfence> <device name="sanswitch1" port="11" action="on"/> <device name="sanswitch2" port="11" action="on"/> </unfence </clusternode> <clusternode name="node-02.example.com" nodeid="2"> <fence> <method name="SAN-multi"> <device name="sanswitch1" port="12"/> <device name="sanswitch2" port="12"/> </method> </fence> <unfence> <device name="sanswitch1" port="12" action="on"/> <device name="sanswitch2" port="12" action="on"/> </unfence </clusternode> <clusternode name="node-03.example.com" nodeid="3"> <fence> <method name="SAN-multi"> <device name="sanswitch1" port="13"/> <device name="sanswitch2" port="13"/> </method> </fence> <unfence> <device name="sanswitch1" port="13" action="on"/> <device name="sanswitch2" port="13" action="on"/> </unfence </clusternode> </clusternodes> <fencedevices> <fencedevice agent="fence_sanbox2" ipaddr="san_ip_example" login="login_example" name="sanswitch1 passwd="password_example" " <fencedevice agent="fence_sanbox2" ipaddr="san_ip_example" login="login_example" name="sanswitch2 passwd="password_example" </fencedevices> <rm> </rm> </cluster>
cluster.conf
: Fencing Nodes with Dual Power Supplies<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>