28.2. クォーラムデバイスの設定
次の手順でクォーラムデバイスを設定し、クラスターに追加します。
この例では、以下のように設定されています。
-
クォーラムデバイスに使用されるノードは
qdevice
です。 クォーラムデバイスモデルは
net
で、これは現在対応している唯一のクォーラムデバイスモデルです。net
モデルは、以下のアルゴリズムに対応します。-
ffsplit
(fifty-fifty split) -これにより、アクティブなノードの数が最も多いパーティションに 1 票が提供されます。 lms
(last-man-standing) -ノードがqnetd
サーバーを確認できるクラスター内に残っている唯一のノードである場合に、1 票が返されます。警告LMS アルゴリズムにより、ノードが 1 つしか残っていなくてもクラスターはクォーラムを維持できますが、number_of_nodes - 1 と同じであるため、クォーラムデバイスの投票力が大きいことを意味します。クォーラムデバイスとの接続が失われると、number_of_nodes - 1 の票が失われます。つまり、(クォーラムデバイスを無効にすることで) すべてのノードがアクティブなクラスターのみがクォーラムに達したままになります。他のクラスターは、クォーラムに達しなくなります。
これらのアルゴリズムの実装の詳細は、man ページの
corosync-qdevice
(8) を参照してください。
-
-
クラスターノードは
node1
とnode2
です。
手順
クォーラムデバイスをホストするために使用するノードで以下のコマンドを使用し、クォーラムデバイスを設定します。このコマンドは、クォーラムデバイスモデルである
net
を設定および開始し、システムの起動時にデバイスが開始するように設定します。[root@qdevice:~]# pcs qdevice setup model net --enable --start Quorum device 'net' initialized quorum device enabled Starting quorum device... quorum device started
クォーラムデバイスの設定後、そのステータスを確認できます。
corosync-qnetd
デーモンが実行中であり、この時点でクライアントが接続されていないことが分かります。--full
コマンドオプションを指定すると詳細が出力されます。[root@qdevice:~]# pcs qdevice status net --full QNetd address: *:5403 TLS: Supported (client certificate required) Connected clients: 0 Connected clusters: 0 Maximum send/receive size: 32768/32768 bytes
以下のコマンドを実行して、
firewalld
でhigh-availability
サービスを有効にして、pcsd
デーモンおよびnet
クォーラムデバイスで必要なファイアウォールのポートを有効にします。[root@qdevice:~]# firewall-cmd --permanent --add-service=high-availability [root@qdevice:~]# firewall-cmd --add-service=high-availability
既存クラスターのいずれかのノードにより、クォーラムデバイスをホストしているノードで
hacluster
ユーザーを認証します。これにより、クラスターのpcs
がqdevice
ホストのpcs
にアクセスできるようになりますが、qdevice
ホストのpcs
は、クラスターのpcs
に接続することを許可しません。[root@node1:~] # pcs host auth qdevice Username: hacluster Password: qdevice: Authorized
クォーラムデバイスをクラスターに追加します。
クォーラムデバイスを追加する前に、後で比較するために、クォーラムデバイスの現在の設定と状況を確認できます。このコマンドの出力から、クラスターがクォーラムデバイスを使用しておらず、各ノードの
Qdevice
メンバーシップのステータスがNR
(登録されていない) であることが分かります。[root@node1:~]# pcs quorum config Options:
[root@node1:~]# pcs quorum status Quorum information ------------------ Date: Wed Jun 29 13:15:36 2016 Quorum provider: corosync_votequorum Nodes: 2 Node ID: 1 Ring ID: 1/8272 Quorate: Yes Votequorum information ---------------------- Expected votes: 2 Highest expected: 2 Total votes: 2 Quorum: 1 Flags: 2Node Quorate Membership information ---------------------- Nodeid Votes Qdevice Name 1 1 NR node1 (local) 2 1 NR node2
以下のコマンドは、作成しておいたクォーラムデバイスをクラスターに追加します。複数のクォーラムデバイスをクラスターで同時に使用することはできません。ただし、複数のクラスターが 1 つのクォーラムデバイスを同時に使用することはできます。以下のコマンド例では、
ffsplit
アルゴリズムを使用するようにクォーラムデバイスを設定します。クォーラムデバイスの設定オプションの詳細は、man ページのcorosync-qdevice
(8) を参照してください。[root@node1:~]# pcs quorum device add model net host=qdevice algorithm=ffsplit Setting up qdevice certificates on nodes... node2: Succeeded node1: Succeeded Enabling corosync-qdevice... node1: corosync-qdevice enabled node2: corosync-qdevice enabled Sending updated corosync.conf to nodes... node1: Succeeded node2: Succeeded Corosync configuration reloaded Starting corosync-qdevice... node1: corosync-qdevice started node2: corosync-qdevice started
クォーラムデバイスの設定状態をチェックします。
クラスター側から以下のコマンドを実行すると、設定の変更内容を確認できます。
pcs quorum config
は、設定されたクォーラムデバイスを表示します。[root@node1:~]# pcs quorum config Options: Device: Model: net algorithm: ffsplit host: qdevice
pcs quorum status
コマンドは、クォーラムデバイスのステータスを表示し、クォーラムデバイスが使用中であることを示します。各クラスターノードのQdevice
メンバーシップ情報のステータス値の意味は以下のとおりです。-
A/NA
- クォーラムデバイスはが有効かどうか、つまりqdevice
とcorosync
の間にハートビートがあるかどうかを示します。この値は常に、クォーラムデバイスが有効でなければなりません。 -
V/NV
- クォーラムデバイスがノードに投票した場合にはV
に設定されます。この例では、相互に通信できるため、両方のノードがV
に設定されます。クラスターを 2 つの単一ノードクラスターに分割する場合には、ノードのいずれかがV
に、他のノードはNV
に設定されます。 MW/NMW
- 内部クォーラムデバイスフラグが設定されている (MW
) か、設定されていない (NMW
) かを示します。デフォルトでは、フラグは設定されず、値はNMW
です。[root@node1:~]# pcs quorum status Quorum information ------------------ Date: Wed Jun 29 13:17:02 2016 Quorum provider: corosync_votequorum Nodes: 2 Node ID: 1 Ring ID: 1/8272 Quorate: Yes Votequorum information ---------------------- Expected votes: 3 Highest expected: 3 Total votes: 3 Quorum: 2 Flags: Quorate Qdevice Membership information ---------------------- Nodeid Votes Qdevice Name 1 1 A,V,NMW node1 (local) 2 1 A,V,NMW node2 0 1 Qdevice
pcs quorum device status
は、クォーラムデバイスのランタイムステータスを表示します。[root@node1:~]# pcs quorum device status Qdevice information ------------------- Model: Net Node ID: 1 Configured node list: 0 Node ID = 1 1 Node ID = 2 Membership node list: 1, 2 Qdevice-net information ---------------------- Cluster name: mycluster QNetd host: qdevice:5403 Algorithm: ffsplit Tie-breaker: Node with lowest node ID State: Connected
クォーラムデバイスから次のコマンドを実行して、
corosync-qnetd
デーモンのステータスを表示できます。[root@qdevice:~]# pcs qdevice status net --full QNetd address: *:5403 TLS: Supported (client certificate required) Connected clients: 2 Connected clusters: 1 Maximum send/receive size: 32768/32768 bytes Cluster "mycluster": Algorithm: ffsplit Tie-breaker: Node with lowest node ID Node ID 2: Client address: ::ffff:192.168.122.122:50028 HB interval: 8000ms Configured node list: 1, 2 Ring ID: 1.2050 Membership node list: 1, 2 TLS active: Yes (client certificate verified) Vote: ACK (ACK) Node ID 1: Client address: ::ffff:192.168.122.121:48786 HB interval: 8000ms Configured node list: 1, 2 Ring ID: 1.2050 Membership node list: 1, 2 TLS active: Yes (client certificate verified) Vote: ACK (ACK)
-