switchover v5.6

Switches over to new write leader.

Synopsis

Switches over to new write leader. Use switchover method fast for immediate switchover. Use strict to wait until lag is less than route_writer_max_lag on the given target node.

If switchover fails due to timeout or any other issue, BDR might elect a write leader that's different from the given target node.

pgd switchover [flags]

Options

Flag                    ValueDescription
--group-namestringGroup name
--methodstringSwitchover method (strict, fast)
strict - waits until lag on given node is less than route_writer_max_lag
fast - immediate switchover, route_writer_max_lag is ignored (default "strict")
--node-namestringNode name
--timeoutintervalTimeout period when switchover method is strict (default 10s)

See global options for global options.

Examples

Using defaults

Running the command with only required arguments. The default method is strict and default timeout is 10s.

$ pgd switchover --group-name group_a --node-name bdr-a1
Output
switchover is complete

Using optional arguments

Running the command with optional arguments.

$ pgd switchover --group-name group_a --node-name bdr-a1 --method strict --timeout 15s
Output
switchover is complete

Immediate switchover

Running the command with fast method for immediate switchover.

$ pgd switchover --group-name group_a --node-name bdr-a1 --method fast
Output
switchover is complete