pgd raft set-leader v6.3.0

Synopsis

The pgd raft set-leader command manually triggers a leadership transfer within a Raft group. It instructs the current leader to step down and facilitates the election of the specified target node as the new Raft leader.

Syntax

pgd raft set-leader [OPTIONS] <LEADER>

Arguments

ArgumentDescription
<LEADER>The name of the node to become the new Raft leader.

Options

The following options are available for the pgd raft set-leader command:

ShortLongDescription
--groupThe name of the group in which to change the leader. If omitted, the global group is used.
--wait-for-completionIf set, the CLI will block and monitor the cluster state until the target node successfully assumes leadership or the operation times out.

See Global Options for common global options.

Examples

Change the leader of the global group

pgd raft set-leader kaboom
Output
Command submitted successfully

Attempt to set a node that is already the leader

pgd raft set-leader kaftan --group dc1_subgroup
Output
Node kaftan is already the raft leader

Change the leader and wait for completion

Using the --wait-for-completion flag sets a 60-second statement timeout. The CLI will attempt to verify the new leader using the existing connection, or retry with a new connection if a proxy (like Connection Manager) reroutes the traffic.

pgd raft set-leader kaolin --group dc1_subgroup --wait-for-completion
Output
Command executed successfully