0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【ProxmoxVE】偶数ノードクラスタでのlast_man_standing検証

Last updated at Posted at 2024-08-26

ProxmoxVEで4ノード構成とした場合に半分の2ノードまで故障を許容させる方法の1つとして、last_man_standingを設定した場合のノード障害発生時の動作について検証した。

設定ファイル:/etc/pve/corosync.conf
last_man_standingについて:RedHat Documentation - クォーラムオプションの設定

結果と結論

4ノード構成でlast_man_standingを設定した場合、クォーラムオプションの説明にある通り、Expected votes・Total votes・Quorumが調整され、最終的に2ノードの状態になった場合でもExpected votes 2、Total votes 2、Quoram 2となりクラスタは稼働を継続した。

スプリットブレイン対策としては機能しないlast_man_standingだが、経験上NWが冗長化された環境でスプリットブレインが発生する可能性は非常に低いため、リソース設計次第ではあるが4ノード構成をとる場合には有効な設定だと思う。

また、本記事作成時に気づいた点として、クォーラムオプションの説明によると「last_man_standing設定時はwait_for_allも有効にする必要がある」との記載があるが、wait_for_allを明示的には有効化しない状態で検証し機能していた。
wait_for_allは「auto_tie_breaker が無効になっている場合に自動的に有効になる」とのことなので、明示しなくても有効になっていた可能性がある。
(wait_for_allを明示的に有効化した際は、pvecm statusコマンド結果のVotequoram informationにて「Flags: Quorate WaitForAll LastManStanding」と表示される。)

検証環境

1台のPC内にProxmoxVE4台と、共有ストレージ用のTrueNAS等を構築。
ProxmoxのバージョンはProxmoxVE 8.2-1を使用している。
PVE検証イメージ図.png

last_man_standing設定は/etc/pve/corosync.confのquorumブロックを以下のように記述。

quorum {
  provider: corosync_votequorum
  last_man_standing: 1
}
/etc/pve/corosync.conf全体
root@pve101:~# cat /etc/pve/corosync.conf 
logging {
  debug: off
  to_syslog: yes
}

nodelist {
  node {
    name: pve101
    nodeid: 1
    quorum_votes: 1
    ring0_addr: 192.168.100.211
  }
  node {
    name: pve102
    nodeid: 2
    quorum_votes: 1
    ring0_addr: 192.168.100.212
  }
  node {
    name: pve103
    nodeid: 3
    quorum_votes: 1
    ring0_addr: 192.168.100.213
  }
  node {
    name: pve104
    nodeid: 4
    quorum_votes: 1
    ring0_addr: 192.168.100.214
  }
}

quorum {
  provider: corosync_votequorum
  last_man_standing: 1
}

totem {
  cluster_name: pve-cluster
  config_version: 4
  interface {
    linknumber: 0
  }
  ip_version: ipv4-6
  link_mode: passive
  secauth: on
  version: 2
}

root@pve101:~#

4ノードすべて稼働している状態のpvecm status実行結果。

Votequorum information
----------------------
Expected votes:   4
Highest expected: 4
Total votes:      4
Quorum:           3  
Flags:            Quorate LastManStanding 

Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.100.211 (local)
0x00000002          1 192.168.100.212
0x00000003          1 192.168.100.213
0x00000004          1 192.168.100.214

【検証1】ノード4・3を停止

ノード4を停止した際のpvecm status。
Expected votes 3、Total votes 3、Quorum 2に調整されている。

Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2  
Flags:            Quorate LastManStanding 

Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.100.211 (local)
0x00000002          1 192.168.100.212
0x00000003          1 192.168.100.213

ノード4を停止後、ノード3を停止した際のpvecm status。
Expected votes 2、Total votes 2に調整されている。Quorumは2が最小のため2のまま。

Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      2
Quorum:           2  
Flags:            Quorate LastManStanding 

Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.100.211 (local)
0x00000002          1 192.168.100.212

【検証2】ノード1・2を停止

auto_tie_breakerとの比較として、ノード1・2の停止も試してみる。
ノード1を停止した際のpvecm status。
Quoram等の調整はノード4停止時と同じ。

Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2  
Flags:            Quorate LastManStanding 

Membership information
----------------------
    Nodeid      Votes Name
0x00000002          1 192.168.100.212
0x00000003          1 192.168.100.213 (local)
0x00000004          1 192.168.100.214

ノード1停止後、ノード2も停止した際のpvecm status。
Quorate等の調整はノード3・4停止時と同じ。

Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      2
Quorum:           2  
Flags:            Quorate LastManStanding 

Membership information
----------------------
    Nodeid      Votes Name
0x00000003          1 192.168.100.213 (local)
0x00000004          1 192.168.100.214
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?