Node management v5.6
List of node states
State | Description |
---|---|
NONE | Node state is unset when the worker starts, expected to be set quickly to the current known state. |
CREATED | bdr.create_node() was executed, but the node isn't 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 finished but hasn't yet started to broadcast changes. All joins spend some time in this state, but if defined as a logical standby, the node continues in this state. |
PROMOTE | Node was a logical standby and bdr.promote_node was just called 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 PGD node is in progress. |
ACTIVE | The node is a full PGD node and is currently ACTIVE . This is the most common node status. |
PART_START | Node was ACTIVE or STANDBY and bdr.part_node was just called 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 | Nonparting 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.
Node-management commands
PGD also provides a command-line utility for adding nodes to the PGD group using a
physical copy (pg_basebackup
) of an existing node.
bdr_init_physical
This is a regular command that's added to PostgreSQL's bin directory.
You must specify a data directory. If this data directory is empty,
use pg_basebackup -X stream
to fill the directory
using a fast block-level copy operation.
If the specified data directory isn't empty, it's used as the base for the
new node. Initially, it waits for catchup and then promotes to a master node
before joining the PGD group. The --standby
option, if used, turns it into a
logical standby node.
This command drops all PostgreSQL-native logical replication
subscriptions from the database (or disables them when the -S
option is
used) as well as any replication origins and slots.
Synopsis
Options
General options
-D, --pgdata=DIRECTORY
— The data directory to use for the new node. It can be either an empty or nonexistent directory or a directory populated using thepg_basebackup -X stream
command (required).-l, --log-file=FILE
— Use FILE for logging. The default isbdr_init_physical_postgres.log
.-n, --node-name=NAME
— The name of the newly created node (required).--replication-sets=SETS
— The name of a comma-separated list of replication set names to use. All replication sets are used if not specified.--standby
— Create a logical standby (receive-only node) rather than full send/receive node.--node-group-name
— Group to join. Defaults to the same group as source node.-s, --stop