Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

4.4. フェンスデバイスを作成する

次のコマンドで stonith デバイスを作成します。
pcs stonith create stonith_id stonith_device_type [stonith_device_options]
# pcs stonith create MyStonith fence_virt pcmk_host_list=f1 op monitor interval=30s 
ノードごと異なるポートを使って複数のノードに一つのフェンスデバイスを使用する場合は各ノードごと別々にデバイスを作成する必要はありません。pcmk_host_map オプションを使ってポートとノードのマッピングを指定することができます。例えば、次のコマンドでは myapc-west-13 と言う名前のフェンスデバイスを一つ作成し、west-apc という名前の APC 電源スイッチを使用、west-13 というノードにポート 15 を使用させます。
# pcs stonith create myapc-west-13 fence_apc pcmk_host_list="west-13" ipaddr="west-apc" login="apc" passwd="apc" port="15"
ただし、次の例では west-apc と言う名前の APC 電源スイッチを使用してノード名 west-13 をポート 15で、ノード名 west-14 をポート 17で、ノード名 west-15 をポート 18 で、ノード名 west-16 をポート 19 でそれぞれ排他処理します。
# pcs stonith create myapc fence_apc pcmk_host_list="west-13,west-14,west-15,west-16" pcmk_host_map="west-13:15;west-14:17;west-15:18;west-16:19" ipaddr="west-apc" login="apc" passwd="apc"