show-raft¶
Shows BDR Raft (consensus protocol) details.
Synopsis¶
Shows BDR Raft (consensus protocol) details such as Raft state (leader, follower), Raft election id, and number of voting nodes.
Note: In some cases such as network partition, output may vary based on the node to which the CLI is connected.
pgd show-raft [flags]
Examples¶
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
Options¶
-h, --help help for show-raft
Options inherited from parent commands¶
-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