Red Hat Training

A Red Hat training course is available for RHEL 8

6.13. フェンスデバイスの作成

フェンスデバイスを作成するには、以下の手順を実施します。

ほとんどのデフォルト設定では、GCP インスタンス名と RHEL ホスト名が同じである点に注意してください。

手順

  1. GCP インスタンス名を取得します。次のコマンドの出力には、インスタンスの内部 ID も表示されることに注意してください。

    # fence_gce --zone us-west1-b --project=rhel-ha-on-gcp -o list

    例:

    [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
  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