pgd group set-leader v5.7

Synopsis

The pgd group set-leader command is used to set the write leader of a group in the EDB Postgres Distributed cluster.

This command performs a switchover operation.

Syntax

pgd group <GROUP_NAME> set-leader [OPTIONS] <LEADER>

Where <GROUP_NAME> is the name of the group for which you want to set the write leader and <LEADER> is the name of the node that you want to set as the write leader.

Options

The following table lists the options available for the pgd group set-leader command:

ShortLongDescription
--strictStrict method (default).
--timeoutTimeout period when method is strict. (Defaults to 30s (30 seconds))
--fastFast method.

Strict method is the default method. The strict method waits for the new leader to be in sync with the old leader before switching the leader. The fast method is immediate as it does not wait for the new leader to be in sync with the old leader before switching the leader, ignoring route_write_max_lag.

See also Global Options.

Examples

Setting the write leader of a group

pgd group dc1_subgroup set-leader kaboom
Output
Command executed successfully

Setting the write leader when node is already the leader

pgd group dc1_subgroup set-leader kaboom
Output
Node kaboom is already the write leader