Show Table of Contents
1.3. 隔離配置
您必須為叢集中的各個節點配置隔離裝置。欲取得更多有關於配置隔離裝置上的一般資訊,請參閱《Red Hat Enterprise Linux 7 High Availability Add-On 參考指南》。
注意
當配置隔離裝置時,您應確認您的隔離裝置未與它所控制的節點共享電源。
此範例使用了 APC 電源切換器(主機名稱為
zapc.example.com)來隔離節點,並且它使用了 fence_apc_snmp 隔離代理程式。因為這兩個節點將會被相同的隔離代理程式所隔離,您可藉由使用 pcmk_host_map 和 pcmk_host_list 選項來將這兩個隔離裝置作為單一資源來配置。
您可藉由
pcs stonith create 指令以透過將裝置配置為 stonith 資源來建立隔離裝置。下列指令將配置名為 myapc 的 stonith 資源,這項資源將在 z1.example.com 和 z2.example.com 節點上使用 fence_apc_snmp 隔離代理程式。pcmk_host_map 選項會將 z1.example.com 對映到連接埠 1 上,並將 z2.example.com 對映到連接埠 2 上。APC 裝置的登錄值與密碼皆為 apc。就預設值,此裝置將會針對各個節點使用一個 60 秒的監控間隔。
請注意,您能在為節點指定主機名稱時使用一組 IP 位址。
[root@z1 ~]#pcs stonith create myapc fence_apc_snmp params\ipaddr="zapc.example.com" pcmk_host_map="z1.example.com:1;z2.example.com:2"\pcmk_host_check="static-list" pcmk_host_list="z1.example.com,z2.example.com"\login="apc" passwd="apc"
注意
當您建立一個
fence_apc_snmp stonith 裝置時,您可能會看見下列警告訊息,您可安全地忽略此訊息:
Warning: missing required option(s): 'port, action' for resource type: stonith:fence_apc_snmp
下列指令顯示了一個既有的 STONITH 裝置的參數。
[root@rh7-1 ~]# pcs stonith show myapc
Resource: myapc (class=stonith type=fence_apc_snmp)
Attributes: ipaddr=zapc.example.com pcmk_host_map=z1.example.com:1;z2.example.com:2 pcmk_host_check=static-list pcmk_host_list=z1.example.com,z2.example.com login=apc passwd=apc
Operations: monitor interval=60s (myapc-monitor-interval-60s)
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.