repmgr standby switchoverrepmgr standby switchoverrepmgr standby switchoverpromote a standby to primary and demote the existing primary to a standbyDescription
Promotes a standby to primary and demotes the existing primary to a standby.
This command must be run on the standby to be promoted, and requires a
passwordless SSH connection to the current primary.
If other standbys are connected to the demotion candidate, &repmgr; can instruct
these to follow the new primary if the option --siblings-follow
is specified.
Options
Promote standby to primary, even if it is behind original primary
(original primary will be shut down in any case).
Check prerequisites but don't actually execute a switchover.
Ignore warnings and continue anyway.
Use pg_rewind to reintegrate the old primary if necessary
(PostgreSQL 9.5 and later).
System username for remote SSH operations (defaults to local system user).
Have standbys attached to the old primary follow the new primary.
Execution
Execute with the --dry-run option to test the switchover as far as
possible without actually changing the status of either node.
repmgrd should not be active on any nodes while a switchover is being
executed. This restriction may be lifted in a later version.
Event notificationsstandby_switchover and standby_promote
event notifications will be generated for the new primary,
and a node_rejoin event notification for the former primary (new standby).
If using an event notification script, standby_switchover
will populate the placeholder parameter %p with the node ID of
the former standby.
See also
For more details see the section .