mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
In some circumstances, e.g. while performing a switchover, it is essential
that repmgrd does not take any kind of failover action, as this will put
the cluster into an incorrect state.
Previously it was necessary to stop repmgrd on all nodes (or at least
those nodes which repmgrd would consider as promotion candidates), however
this is a cumbersome and potentially risk-prone operation, particularly if the
replication cluster contains more than a couple of servers.
To prevent this issue from occurring, this patch introduces the ability
to "pause" repmgrd on all nodes wth a single command ("repmgr daemon pause")
which notifies repmgrd not to take any failover action until the node
is "unpaused" ("repmgr daemon unpause").
"repmgr daemon status" provides an overview of each node and whether repmgrd
is running, and if so whether it is paused.
"repmgr standby switchover" has been modified to automatically pause repmgrd
while carrying out the switchover.
See documentation for further details.
110 lines
3.3 KiB
Plaintext
110 lines
3.3 KiB
Plaintext
<refentry id="repmgr-daemon-pause">
|
|
<indexterm>
|
|
<primary>repmgr daemon pause</primary>
|
|
</indexterm>
|
|
|
|
<refmeta>
|
|
<refentrytitle>repmgr daemon pause</refentrytitle>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>repmgr daemon pause</refname>
|
|
<refpurpose>Instruct all <application>repmgrd</application> instances in the replication cluster to pause failover operations</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
This command can be run on any active node in the replication cluster to instruct all
|
|
running <application>repmgrd</application> instances to "pause" themselves, i.e. take no
|
|
action (such as promoting themselves or following a new primary) if a failover event is detected.
|
|
</para>
|
|
<para>
|
|
This functionality is useful for performing maintenance operations, such as switchovers
|
|
or upgrades, which might otherwise trigger a failover if <application>repmgrd</application>
|
|
is running normally.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
It's important to wait a few seconds after restarting PostgreSQL on any node before running
|
|
<command>repmgr daemon pause</command>, as the <application>repmgrd</application> instance
|
|
on the restarted node will take a second or two before it has updated its status.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
<xref linkend="repmgr-daemon-unpause"> will instruct all previously paused <application>repmgrd</application>
|
|
instances to resume normal failover operation.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Execution</title>
|
|
<para>
|
|
<command>repmgr daemon pause</command> can be executed on any active node in the
|
|
replication cluster. A valid <filename>repmgr.conf</filename> file is required.
|
|
It will have no effect on previously paused nodes.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Example</title>
|
|
<para>
|
|
<programlisting>
|
|
$ repmgr -f /etc/repmgr.conf daemon pause
|
|
NOTICE: node 1 (node1) paused
|
|
NOTICE: node 2 (node2) paused
|
|
NOTICE: node 3 (node3) paused</programlisting>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Options</title>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><option>--dry-run</option></term>
|
|
<listitem>
|
|
<para>
|
|
Check if nodes are reachable but don't pause <application>repmgrd</application>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Exit codes</title>
|
|
<para>
|
|
Following exit codes can be emitted by <command>repmgr daemon unpause</command>:
|
|
</para>
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
<term><option>SUCCESS (0)</option></term>
|
|
<listitem>
|
|
<para>
|
|
<application>repmgrd</application> could be paused on all nodes.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>ERR_REPMGRD_PAUSE (26)</option></term>
|
|
<listitem>
|
|
<para>
|
|
<application>repmgrd</application> could not be paused on one or mode nodes.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>See also</title>
|
|
<para>
|
|
<xref linkend="repmgr-daemon-unpause">, <xref linkend="repmgr-daemon-status">
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|