repmgr standby follow repmgr standby follow repmgr standby follow attach a running standby to a new upstream node Description Attaches the standby ("follow candidate") to a new upstream node ("follow target"). Typically this will be the primary, but this command can also be used to attach the standby to another standby. This command requires a valid repmgr.conf file for the standby, either specified explicitly with -f/--config-file or located in a default location; no additional arguments are required. By default &repmgr; will attempt to attach the standby to the current primary. If is provided, &repmgr; will attempt to attach the standby to the specified node, which can be another standby. This command will force a restart of the standby server, which must be running. To re-add an inactive node to the replication cluster, use . repmgr standby follow will wait up to standby_follow_timeout seconds (default: 30) to verify the standby has actually connected to the new upstream node. If is set for the standby, it will not attach to the new upstream node until it has replayed available WAL. Conversely, if the standby is attached follows another standby with set, that standby's replay state may actually be behind that of its new downstream node. Example $ repmgr -f /etc/repmgr.conf standby follow INFO: setting node 3's primary to node 2 NOTICE: restarting server using "pg_ctl -l /var/log/postgres/startup.log -w -D '/var/lib/postgres/data' restart" waiting for server to shut down........ done server stopped waiting for server to start.... done server started NOTICE: STANDBY FOLLOW successful DETAIL: node 3 is now attached to node 2 Options Check prerequisites but don't actually follow a new upstream node. This will also verify whether the standby is capable of following the new upstream node. If a standby was turned into a primary by removing recovery.conf (PostgreSQL 12 and later: standby.signal), &repmgr; will not be able to determine whether that primary's timeline has diverged from the timeline of the standby ("follow candidate"). We recommend always to use repmgr standby promote to promote a standby to primary, as this will ensure that the new primary will perform a timeline switch (making it practical to check for timeline divergence) and also that &repmgr; metadata is updated correctly. Node ID of the new upstream node ("follow target"). If not provided, &repmgr; will attempt to follow the current primary node. Note that when using repmgrd, should always be configured; see Automatic failover configuration for details. Wait for a primary to appear. &repmgr; will wait for up to primary_follow_timeout seconds (default: 60 seconds) to verify that the standby is following the new primary. This value can be defined in repmgr.conf. Exit codes One of the following exit codes will be emitted by repmgr standby follow: The follow operation succeeded; or if was provided, no issues were detected which would prevent the follow operation. A configuration issue was detected which prevented &repmgr; from continuing with the follow operation. The node could not be restarted. &repmgr; was unable to establish a database connection to one of the nodes. &repmgr; was unable to complete the follow command. Event notifications A standby_follow event notification will be generated. If provided, &repmgr; will substitute the placeholders %p with the node ID of the primary being followed, %c with its conninfo string, and %a with its node name. See also