7.3. フェンシングの設定
注記
cluster.conf
を設定します。
fencedevices
セクションでは、fencedevice
要素とフェンスデバイス従属属性を使用して各フェンスデバイスを指定します。例7.3「cluster.conf
に追加された APC フェンスデバイス」 は APC フェンスデバイスを追加した設定ファイルの例を示しています。clusternodes
セクションでは、各clusternode
セクションのfence
要素内でノードの各フェンスメソッドを指定します。method
属性である、name
を使用してフェンスメソッドの名前を指定します。device
要素とその属性である、name
とフェンスデバイス特有のパラメーターを使用して各フェンスメソッド用のフェンスデバイスを指定します。例7.4「cluster.conf
に追加されたフェンスメソッド」 はクラスター内の各ノード用に 1 つのフェンスデバイスを持つフェンスメソッドの例を示しています。- パワーフェンス以外のメソッド (つまり、SAN/ストレージフェンシング) 用には、
clusternodes
セクションでunfence
セクションを追加します。これにより、フェンス済みのノードは再起動されるまでは再度有効になりません。アンフェンシングを必要とするデバイスを設定する際には、最初にクラスターを停止し、デバイスおよびアンフェンシングを含むすべての設定をクラスターが開始される前に追加する必要があります。ノードのアンフェンシングに関する詳細は、fence_node
(8) の man ページを参照してください。unfence
セクションは、fence
セクションとは異なり、method
セクションが含まれていませんが、device
参照を直接含んでいます。これはfence
の該当するデバイスセクションをミラーし、"on" 又は "enable" の明示的なアクション (action
) がはっきりと追加されています。fence
とunfence
device
の行によって同じfencedevice
が参照され、同じノード毎の引数が繰り返されます。action
属性を "on" 又は "enable" に指定すると、再起動時にノードを有効にします。例7.4「cluster.conf
に追加されたフェンスメソッド」 と 例7.5「cluster.conf
: ノード毎に複数のフェンスメソッド」 にはunfence
の要素と属性の例が含まれています。unfence
についての詳細は、fence_node
の man ページを参照してください。 - 値を増加することにより
config_version
属性を更新します (例えば、config_version="2"
からconfig_version="3">
へ変更)。 /etc/cluster/cluster.conf
を保存します。- (オプション)
ccs_config_validate
コマンドを実行することでクラスタースキーマ (cluster.rng
) に対して更新されたファイルを検証します。例えば:[root@example-01 ~]#
ccs_config_validate
Configuration validates cman_tool version -r
コマンドを実行してクラスターノードの他の部分に設定を伝播します。このコマンドは追加の検証も実行します。更新されたクラスターの設定情報を伝播できるようにするには、各ノード内でricci
が稼働している必要があります。- 更新した設定ファイルが伝播されたことを確認します。
- 「フェイルオーバードメインの設定」 へ進んでください。
fenced
は次のメソッドを試行し、1 つが成功するまでメソッド群を繰り返します。
fenced
は各フェンス/デバイス行に対してフェンスエージェントを 1 回実行しますが、フェンシングが成功と見なされるにはすべてが成功しなければなりません。
fence_apc
の man ページ) でご覧になれます。さらには、付録A フェンスデバイスパラメーター ではフェンシングパラメーターの情報、/usr/sbin/
ではフェンスエージェントの情報、/usr/share/cluster/cluster.rng
ではクラスタースキーマの情報、/usr/share/doc/cman-X.Y.ZZ/cluster_conf.html
(例えば、/usr/share/doc/cman-3.0.12/cluster_conf.html
) では注釈付きスキーマの情報を取得できます。
フェンシング設定の例
注記
例7.3 cluster.conf
に追加された APC フェンスデバイス
<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
) は fencedevices
要素に追加されています。また、フェンスエージェント (agent
) を fence_apc
として、IP アドレス (ipaddr
) を apc_ip_example
として、ログイン (login
) を login_example
として、フェンスデバイス名 (name
) を apc
として、パスワード (passwd
) を password_example
として指定しています。
例7.4 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
) が各ノードに追加されています。各ノードのフェンスメソッド名 (name
) は APC
です。各ノードのフェンスメソッドのデバイス (device
) は、名前 (name
) を apc
及び各ノード用に一意の APC スイッチパワーポート番号 (port
) として指定します。ここでは例として、node-01.example.com のポート番号を 1
(port="1"
) とします。各ノードのデバイス名 (device name="apc"
) は、fencedevices
要素のこの行にあるapc
の名前 apc
によってフェンスデバイスをポイントします: fencedevice agent="fence_apc"
ipaddr="apc_ip_example" login="login_example"
name="apc" passwd="password_example"
例7.5 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> <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>
例7.6 cluster.conf
: マルチパス複数ポートのフェンシング
<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>
例7.7 cluster.conf
: デュアル電源供給を持つノードのフェンシング
<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>
このページには機械翻訳が使用されている場合があります (詳細はこちら)。