【RHEL 7】High Availability アドオンのフェンス機能の設定

インフラサーバ

ここでは Red Hat Enterprise Linux 7 における HA アドオンを使用したクラスタ構築について、フェンス機能の設定に関する内容を記載します。
こちらの記事の続きの位置付けです

作業環境

以下の 2 ノードでクラスタを構成していることとします。

  • ノード1
    • OS:Red Hat Enterprise Linux 7.3
    • ホスト名:ha01
    • IP アドレス:192.168.139.133
  • ノード2
    • OS:Red Hat Enterprise Linux 7.3
    • ホスト名:ha02
    • IP アドレス:192.168.139.134

フェンスデバイスについては手元に使用できそうなものがないため以下では設定例だけ記載します。

フェンス機能の設定

クラスタ内のどれかの 1 つのノードで以下作業を実施する

フェンスエージェントの確認

■参考ページ

第5章 フェンス機能: STONITH の設定 Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

利用できるフェンスエージェント一覧を確認します。

pcs stonith list
# pcs stonith list
fence_amt_ws - Fence agent for AMT (WS)
fence_apc - Fence agent for APC over telnet/ssh
fence_apc_snmp - Fence agent for APC, Tripplite PDU over SNMP
fence_bladecenter - Fence agent for IBM BladeCenter
fence_brocade - Fence agent for HP Brocade over telnet/ssh
fence_cisco_mds - Fence agent for Cisco MDS
fence_cisco_ucs - Fence agent for Cisco UCS
fence_compute - Fence agent for the automatic resurrection of OpenStack compute instances
fence_drac5 - Fence agent for Dell DRAC CMC/5
fence_eaton_snmp - Fence agent for Eaton over SNMP
fence_emerson - Fence agent for Emerson over SNMP
fence_eps - Fence agent for ePowerSwitch
fence_evacuate - Fence agent for the automatic resurrection of OpenStack compute instances
fence_heuristics_ping - Fence agent for ping-heuristic based fencing
fence_hpblade - Fence agent for HP BladeSystem
fence_ibmblade - Fence agent for IBM BladeCenter over SNMP
fence_idrac - Fence agent for IPMI
fence_ifmib - Fence agent for IF MIB
fence_ilo - Fence agent for HP iLO
fence_ilo2 - Fence agent for HP iLO
fence_ilo3 - Fence agent for IPMI
fence_ilo3_ssh - Fence agent for HP iLO over SSH
fence_ilo4 - Fence agent for IPMI
fence_ilo4_ssh - Fence agent for HP iLO over SSH
fence_ilo5 - Fence agent for IPMI
fence_ilo5_ssh - Fence agent for HP iLO over SSH
fence_ilo_moonshot - Fence agent for HP Moonshot iLO
fence_ilo_mp - Fence agent for HP iLO MP
fence_ilo_ssh - Fence agent for HP iLO over SSH
fence_imm - Fence agent for IPMI
fence_intelmodular - Fence agent for Intel Modular
fence_ipdu - Fence agent for iPDU over SNMP
fence_ipmilan - Fence agent for IPMI
fence_kdump - fencing agent for use with kdump crash recovery service
fence_mpath - Fence agent for multipath persistent reservation
fence_redfish - I/O Fencing agent for Redfish
fence_rhevm - Fence agent for RHEV-M REST API
fence_rsa - Fence agent for IBM RSA
fence_rsb - I/O Fencing agent for Fujitsu-Siemens RSB
fence_sbd - Fence agent for sbd
fence_scsi - Fence agent for SCSI persistent reservation
fence_virt - Fence agent for virtual machines
fence_vmware_rest - Fence agent for VMware REST API
fence_vmware_soap - Fence agent for VMWare over SOAP API
fence_wti - Fence agent for WTI
fence_xvm - Fence agent for virtual machines

フェンスデバイスの一般的なプロパティ

■参考ページ

5.2. フェンスデバイスの一般的なプロパティー Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

どのフェンスデバイスでも設定できる一般的なプロパティとして以下があります。

項目デフォルト説明
pcmk_host_map例:[node1:1;node2:2,3]
⇒ node1にはポート1を使用、node2にはポート2と3を
使用するようクラスターに指示する
pcmk_host_listデバイスで制御するノードの一覧
pcmk_host_checkdynamic-listデバイスで制御するノードを指定
・dynamic-list ⇒ デバイスに問い合わせ
・static-list ⇒ pcmk_host_list 属性をチェック
・なし ⇒ すべてのデバイスで全マシンのフェンスが可能

フェンスデバイスの固有プロパティ

■参考ページ

5.3. デバイス固有のフェンスオプションの表示 Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

フェンスデバイス固有のオプションを確認する場合は以下コマンドで確認します。

pcs stonith describe "エージェント名"

使用例:fence_apc について確認する場合

# pcs stonith describe fence_apc
fence_apc - Fence agent for APC over telnet/ssh

fence_apc is an I/O Fencing agent which can be used with the APC network power switch. It logs into device via telnet/ssh  and reboots a specified outlet. Lengthy telnet/ssh connections should be avoided while a GFS cluster  is  running  because  the  connection will block any necessary fencing actions.

Stonith options:
  cmd_prompt: Force Python regex for command prompt
  identity_file: Identity file (private key) for SSH
  inet4_only: Forces agent to use IPv4 addresses only
  inet6_only: Forces agent to use IPv6 addresses only
  ipaddr (required): IP address or hostname of fencing device
  ipport: TCP/UDP port to use for connection with device
  login (required): Login name
  passwd: Login password or passphrase
  passwd_script: Script to run to retrieve password
  port: Physical plug number on device, UUID or identification of machine
#(略)

使用例:fence_ilo5 について確認する場合

# pcs stonith describe fence_ilo5
fence_ilo5 - Fence agent for IPMI

fence_ipmilan is an I/O Fencing agentwhich can be used with machines controlled by IPMI.This agent calls support software ipmitool (http://ipmitool.sf.net/). WARNING! This fence agent might report success before the node is powered off. You should use -m/method onoff if your fence device works correctly with that option.

Stonith options:
  auth: IPMI Lan Auth type.
  cipher: Ciphersuite to use (same as ipmitool -C parameter)
  hexadecimal_kg: Hexadecimal-encoded Kg key for IPMIv2 authentication
  ipaddr: IP address or hostname of fencing device
  ipport: TCP/UDP port to use for connection with device
  lanplus: Use Lanplus to improve security of connection
  login: Login name
  method: Method to fence
  passwd: Login password or passphrase
  passwd_script: Script to run to retrieve password
  port: IP address or hostname of fencing device (together with --port-as-ip)
  privlvl: Privilege level on IPMI device
  target: Bridge IPMI requests to the remote target address
  quiet: Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
  verbose: Verbose mode
  debug: Write debug information to given file
  delay: Wait X seconds before fencing is started
  ipmitool_path: Path to ipmitool binary
  login_timeout: Wait X seconds for cmd prompt after login
  port_as_ip: Make "port/plug" to be an alias to IP address
  power_timeout: Test X seconds for status change after ON/OFF
  power_wait: Wait X seconds after issuing ON/OFF
  shell_timeout: Wait X seconds for cmd prompt after issuing command
  retry_on: Count of attempts to retry power on
  sudo: Use sudo (without password) when calling 3rd party software
  sudo_path: Path to sudo binary
  pcmk_host_map: A mapping of host names to ports numbers for devices that do not support host names. Eg.
                 node1:1;node2:2,3 would tell the cluster to use port 1 for node1 and ports 2 and 3 for node2
  pcmk_host_list: A list of machines controlled by this device (Optional unless pcmk_host_check=static-list).
  pcmk_host_check: How to determine which machines are controlled by the device. Allowed values: dynamic-list (query
                   the device via the 'list' command), static-list (check the pcmk_host_list attribute), status
                   (query the device via the 'status' command), none (assume every device can fence every machine)
  pcmk_delay_max: Enable a random delay for stonith actions and specify the maximum of random delay. This prevents
                  double fencing when using slow devices such as sbd. Use this to enable a random delay for stonith
                  actions. The overall delay is derived from this random delay value adding a static delay so that
                  the sum is kept below the maximum delay.
  pcmk_delay_base: Enable a base delay for stonith actions and specify base delay value. This prevents double fencing
                   when different delays are configured on the nodes. Use this to enable a static delay for stonith
                   actions. The overall delay is derived from a random delay value adding this static delay so that
                   the sum is kept below the maximum delay.
  pcmk_action_limit: The maximum number of actions can be performed in parallel on this device Pengine property
                     concurrent-fencing=true needs to be configured first. Then use this to specify the maximum
                     number of actions can be performed in parallel on this device. -1 is unlimited.

Default operations:
  monitor: interval=60s

フェンスデバイスの作成

■参考ページ

5.4. フェンスデバイスの作成 Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

以下のコマンドでフェンスデバイスを作成します。

pcs stonith create "stonith_id" "stonith_device_type" ["stonith_device_options"]

例として以下のプロパティでフェンスデバイスを作成します。

項目設定値説明
IDmyapcフェンスデバイス ID
フェンスエージェントfence_apc_snmpフェンスエージェント名
pcmk_host_map“ha01:1;ha02:2”一般的なプロパティの一つ
pcmk_host_list“ha01,ha02”一般的なプロパティの一つ
pcmk_host_check“static-list”一般的なプロパティの一つ
ipaddr“192.168.139.200”※フェンスデバイスの固有プロパティ
フェンスデバイスの IP アドレス
login“apc”※フェンスデバイスの固有プロパティ
フェンスデバイスのログインID
passwd“apc”※フェンスデバイスの固有プロパティ
フェンスデバイスのログインパスワード

上のプロパティに基づく設定コマンドは以下の通りです。

pcs stonith create myapc fence_apc_snmp pcmk_host_map="ha01:1;ha02:2" pcmk_host_list="ha01,ha02" pcmk_host_check="static-list" ipaddr="192.168.139.200" login="apc" passwd="apc"

フェンスデバイスの確認

以下のコマンドで設定済みのフェンスデバイスの確認ができます。

pcs stonith show ["stonith_id"] [--full]

  • stonith_id が指定されていると指定されたフェンスデバイスのみについてオプションが表示される
  • --full オプションが指定されているとフェンスデバイスのすべてのオプションが表示される(stonith_id との併用はできない)

使用例

# pcs stonith show myapc
 Resource: myapc (class=stonith type=fence_apc_snmp)
  Attributes: ipaddr=192.168.139.200 login=apc passwd=apc pcmk_host_check=static-list pcmk_host_list=ha01,ha02 pcmk_host_map=ha01:1;ha02:2
  Operations: monitor interval=60s (myapc-monitor-interval-60s)

フェンスデバイスの修正

既存のフェンスデバイスのオプションの修正をする場合は以下のコマンドを使用します。

pcs stonith update "stonith_id" ["stonith_device_options"]

フェンスデバイスの削除

pcs stonith delete "stonith_id"

フェンスデバイスの高度なプロパティ

高度な設定を行う場合のみ以下のページに記載されているプロパティを設定します。

5.8. その他のフェンス設定オプション Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

フェンスデバイスのテスト

以下のページの内容に従いテストを実施します。

5.12. フェンスデバイスのテスト Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

参考ページ

第5章 フェンス機能: STONITH の設定 Red Hat Enterprise Linux 7 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.
第4章 フェンスデバイス Red Hat Enterprise Linux 6 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.
4.14. Hewlett-Packard iLO Red Hat Enterprise Linux 6 | Red Hat Customer Portal
AccessRedHat’sknowledge,guidance,andsupportthroughyoursubscription.

―――――――――――――

タイトルとURLをコピーしました