Show Table of Contents
4.10. 配置 Fencing 等级
Pacemaker 通过名为 fencing 拓扑功能支持包含多个设备的 fencing 节点。要实施拓扑,请以常规方式创建独立的设备,然后再配置文件的 fencing-topology 部分,定义一个或多个 fencing 等级。
- 会按数字升序顺序尝试各个等级,从等级 1 开始。
- 如果某个设备失败,则会终止当前等级进程。不会对那个等级中的设备进行进一步操作,而是尝试下一个等级。
- 如果成功隔离所有设备,那么已成功应用该等级,且不会再试其他等级。
- 该等级通过(成功)后操作即完成。
使用以下命令为节点添加 fencing 等级。为这些设备给出用逗号分开的 stonith id 列表,代表该节点在那个等级中要尝试的 id。
pcs stonith level add level node devices
以下命令列出当前配置的所有 fencing 等级。
pcs stonith level
在下面的示例中,为节点
rh7-2 配置两个 fence 设备:一个是名为 my_ilo 的 ilo fence 设备,一个是名为 my_apc 的 apc fence 设备。这些命令设定 fence 等级,以便设备 my_ilo 失败,且无法隔离该节点时,Pacemaker 会尝试使用设备 my_apc。这个实例还显示配置这些等级后的 pcs stonith level 命令输出结果。
#pcs stonith level add 1 rh7-2 my_ilo#pcs stonith level add 2 rh7-2 my_apc#pcs stonith levelNode: rh7-2 Level 1 - my_ilo Level 2 - my_apc
以下命令删除指定节点和设备的隔离等级。如果没有指定节点或设备,则会删除该隔离等级。
pcs stonith level remove level [node_id] [stonith_id] ... [stonith_id]
以下命令清除指定节点或 stonith id 的隔离等级。如果未指定节点或 stonith id,则会删除所有隔离等级。
pcs stonith level clear [node|stonith_id(s)]
如果指定一个以上 stonith id,则必须使用逗号将其分开,且不能添加空格,如下例所示。
# pcs stonith level clear dev_a,dev_b
以下命令确认在 fence 等级中指定的所有 fence 设备和节点。
pcs stonith level verify

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.