pgd group set-leader#

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.

Users and roles#

Requires the bdr_superuser role. See User roles .

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:

Short

Long

Description

--strict

Strict method (default).

--timeout

Timeout period when method is strict. (Defaults to 30s (30 seconds))

--fast

Fast 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