4.14. 创建隔离设备
高可用性(HA)环境需要一个隔离设备,其确保故障的节点被隔离,且集群在停机时仍然可用。
请注意,对于大多数默认配置,GCP 实例名称和 RHEL 主机名是一样的。
步骤
获取 GCP 实例名称。请注意,以下命令的输出还显示实例的内部 ID。
# fence_gce --zone us-west1-b --project=rhel-ha-on-gcp -o list
Example:
[root@rhel81-node-01 ~]# fence_gce --zone us-west1-b --project=rhel-ha-testing-on-gcp -o list 4435801234567893181,InstanceName-3 4081901234567896811,InstanceName-1 7173601234567893341,InstanceName-2
创建隔离设备。
# pcs stonith create FenceDeviceName fence_gce zone=Region-Zone project=MyProject
验证
验证隔离设备是否已启动。
# pcs status
例如:
[root@rhel81-node-01 ~]# pcs status Cluster name: gcp-cluster Stack: corosync Current DC: rhel81-node-02 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum Last updated: Fri Jul 27 12:53:25 2018 Last change: Fri Jul 27 12:51:43 2018 by root via cibadmin on rhel81-node-01 3 nodes configured 3 resources configured Online: [ rhel81-node-01 rhel81-node-02 rhel81-node-03 ] Full list of resources: us-west1-b-fence (stonith:fence_gce): Started rhel81-node-01 Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled