show-raft

BDR Raft(コンセンサスプロトコル)の詳細を表示します。

概要

Raft状態(リーダー、フォロワー)、Raft選挙ID、投票ノード数などのBDR Raft(コンセンサスプロトコル)の詳細を表示します。

注:ネットワークパーティションなどの場合、出力はCLIが接続されているノードによって異なる場合があります。

pgd show-raft [flags]

例

Example 1 (3 node cluster, bdr-a1 and bdr-c1 are up, bdr-b1 is down)

$ pgd show-raft

Node   Raft State    Raft Term Commit Index Nodes Voting Nodes Protocol Version
----   ----------    --------- ------------ ----- ------------ ----------------
bdr-c1 RAFT_FOLLOWER 29        6081272      3     3            4002
bdr-a1 RAFT_LEADER   29        6081272      3     3            4002
bdr-b1

Example 2 (3 node cluster, all nodes are up)

$ pgd show-raft

Node   Raft State    Raft Term Commit Index Nodes Voting Nodes Protocol Version
----   ----------    --------- ------------ ----- ------------ ----------------
bdr-c1 RAFT_FOLLOWER 38        6132327      3     3            4002
bdr-a1 RAFT_LEADER   38        6132331      3     3            4002
bdr-b1 RAFT_FOLLOWER 38        6132336      3     3            4002

Example 3 (3 node cluster, all nodes are up but bdr-a1 is not able to connect
to other nodes; following is the output when cli is connected to bdr-a1)

$ pgd show-raft

Node   Raft State    Raft Term Commit Index Nodes Voting Nodes Protocol Version
----   ----------    --------- ------------ ----- ------------ ----------------
bdr-c1
bdr-a1 RAFT_FOLLOWER 40        6176769      3     3            4002
bdr-b1

Example 4 (cluster with witness, logical standby and subscriber-only nodes)
Note: Unlike full-bdr (or witness node), logical standby and subscriber-only
nodes dont have raft voting rights.

$ pgd show-raft

Node               Raft State    Raft Term Commit Index Nodes Voting Nodes Protocol Version
----               ----------    --------- ------------ ----- ------------ ----------------
bdr-a1             RAFT_LEADER   0         10268        6     3            4003
bdr-b1             RAFT_FOLLOWER 0         10279        6     3            4003
witness-c1         RAFT_FOLLOWER 0         10281        6     3            4003
logical-standby-a1 RAFT_FOLLOWER 0         10281        6     3            4003
logical-standby-b1 RAFT_FOLLOWER 0         10281        6     3            4003
subscriber-only-c1 RAFT_FOLLOWER 0         10281        6     3            4003

オプション

-h, --help   help for show-raft

親コマンドから継承されたオプション

-f, --config-file string   config file; ignored if
                           --dsn flag is present (default "/etc/edb/pgd-config.yml")
    --dsn string           database connection string
                           e.g."host=bdr-a1 port=5432 dbname=bdrdb user=postgres "
-L, --log-level string     logging level: debug, info, warn, error (default "error")
-o, --output string        output format: json, yaml