show-nodes v4

Shows all nodes in the EDB Postgres Distributed cluster and their summary.

Synopsis

Shows all nodes in the EDB Postgres Distributed cluster and their summary including name, node id, group, and current/target state.

Node States

  • NONE: Node state is unset when the worker starts, expected to be set quickly to the current known state.
  • CREATED: bdr.create_node() has been executed, but the node is not a member of any EDB Postgres Distributed cluster yet.
  • JOIN_START: bdr.join_node_group() begins to join the local node to an existing EDB Postgres Distributed cluster.
  • JOINING: The node join has started and is currently at the initial sync phase, creating the schema and data on the node.
  • CATCHUP: Initial sync phase is completed; now the join is at the last step of retrieving and applying transactions that were performed on the upstream peer node since the join started.
  • STANDBY: Node join has finished, but not yet started to broadcast changes. All joins spend some time in this state, but if defined as a Logical Standby, the node will continue in this state.
  • PROMOTE: Node was a logical standby and we just called bdr.promote_node to move the node state to ACTIVE. These two PROMOTE states have to be coherent to the fact, that only one node can be with a state higher than STANDBY but lower than ACTIVE.
  • PROMOTING: Promotion from logical standby to full BDR node is in progress.
  • ACTIVE: The node is a full BDR node and is currently ACTIVE. This is the most common node status.
  • PART_START: Node was ACTIVE or STANDBY and we just called bdr.part_node to remove the node from the EDB Postgres Distributed cluster.
  • PARTING: Node disconnects from other nodes and plays no further part in consensus or replication.
  • PART_CATCHUP: Non-parting nodes synchronize any missing data from the recently parted node.
  • PARTED: Node parting operation is now complete on all nodes.

Only one node at a time can be in either of the states PROMOTE or PROMOTING.

Note that the read-only state of a node, as shown in the Current State or in the Target State columns, is indicated as STANDBY.

pgd show-nodes [flags]

Examples

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

  $ pgd show-nodes

  Node   Node ID    Node Group Current State Target State Status      Seq ID
  ----   -------    ---------- ------------- ------------ ------      ------
  bdr-a1 3136956818 bdrgroup   ACTIVE        ACTIVE       Up          1
  bdr-b1 2380210996 bdrgroup   ACTIVE        ACTIVE       Unreachable 2
  bdr-c1 1804769977 bdrgroup   ACTIVE        ACTIVE       Up          3


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

  $ pgd show-nodes

  Node   Node ID    Node Group Current State Target State Status Seq ID
  ----   -------    ---------- ------------- ------------ ------ ------
  bdr-a1 3136956818 bdrgroup   ACTIVE        ACTIVE       Up     1
  bdr-b1 2380210996 bdrgroup   ACTIVE        ACTIVE       Up     2
  bdr-c1 1804769977 bdrgroup   ACTIVE        ACTIVE       Up     3


  Example 3 (cluster with witness, logical standby and subscriber-only nodes)
  Note: In contrast to logical standby, the subscriber-only nodes are fully
  joined node to the cluster

  $ pgd show-nodes

  Node               Node ID    Node Group      Current State Target State Status Seq ID
  ----               -------    ----------      ------------- ------------ ------ ------
  bdr-a1             3136956818 bdrgroup        ACTIVE        ACTIVE       Up     1
  bdr-b1             2380210996 bdrgroup        ACTIVE        ACTIVE       Up     2
  witness-c1         1450365472 bdrgroup        ACTIVE        ACTIVE       Up     3
  logical-standby-a1 1140256918 bdrgroup        STANDBY       STANDBY      Up     4
  logical-standby-b1 3541792022 bdrgroup        STANDBY       STANDBY      Up     5
  subscriber-only-c1 2448841809 subscriber-only ACTIVE        ACTIVE       Up     6

Options

  -h, --help   help for show-nodes

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