第 10 章 在 Red Hat High Availability 集群中配置隔离功能

不响应的节点可能仍然在访问数据。确定您的数据安全的唯一方法是使用 STONITH 保护节点。STONITH 是"Shoot The Other Node In The Head"的缩写,它保护您的数据不受有问题的节点或并发访问的影响。使用 STONITH 可以确保,在允许从另一个节点访问数据前确定节点真正离线。

当无法停止集群的服务时,STONITH 也会有意义。在这种情况下,集群使用 STONITH 来强制整个节点离线,从而使在其他位置可以安全地启动该服务。

有关隔离的一般信息及其在红帽高可用性集群中的重要性,请参阅 红帽高可用性集群中的隔离

您可以在 Pacemaker 集群中为集群的节点配置隔离设备,从而在 Pacemaker 集群中实施 STONITH。

10.1. 显示可用的隔离代理及其选项

以下命令可用于查看可用的隔离代理和特定隔离代理的可用选项。

注意

您的系统硬件决定了用于集群的隔离设备的类型。有关支持的平台和架构以及不同的隔离设备的详情,请参考 RHEL 高可用性集群中的支持策略 文章的 集群平台和架构 部分。

运行以下命令列出所有可用的隔离代理。当您指定过滤器时,这个命令只会显示与过滤器匹配的隔离代理。

pcs stonith list [filter]

运行以下命令显示指定隔离代理的选项。

pcs stonith describe [stonith_agent]

例如:以下命令显示 APC 通过 telnet/SSH 的隔离代理的选项。

# pcs stonith describe fence_apc
Stonith options for: fence_apc
  ipaddr (required): IP Address or Hostname
  login (required): Login Name
  passwd: Login password or passphrase
  passwd_script: Script to retrieve password
  cmd_prompt: Force command prompt
  secure: SSH connection
  port (required): Physical plug number or name of virtual machine
  identity_file: Identity file for ssh
  switch: Physical switch number on device
  inet4_only: Forces agent to use IPv4 addresses only
  inet6_only: Forces agent to use IPv6 addresses only
  ipport: TCP port to use for connection with device
  action (required): Fencing Action
  verbose: Verbose mode
  debug: Write debug information to given file
  version: Display version information and exit
  help: Display help and exit
  separator: Separator for CSV created by operation list
  power_timeout: Test X seconds for status change after ON/OFF
  shell_timeout: Wait X seconds for cmd prompt after issuing command
  login_timeout: Wait X seconds for cmd prompt after login
  power_wait: Wait X seconds after issuing ON/OFF
  delay: Wait X seconds before fencing is started
  retry_on: Count of attempts to retry power on
警告

对于提供 method 选项的隔离代理,不支持 cycle 值,且不应指定,因为它可能导致数据损坏。