1<refentry id="repmgr-service-pause">
2  <indexterm>
3    <primary>repmgr service pause</primary>
4  </indexterm>
5
6  <indexterm>
7    <primary>repmgrd</primary>
8    <secondary>pausing</secondary>
9  </indexterm>
10
11  <refmeta>
12    <refentrytitle>repmgr service pause</refentrytitle>
13  </refmeta>
14
15  <refnamediv>
16    <refname>repmgr service pause</refname>
17    <refpurpose>Instruct all &repmgrd; instances in the replication cluster to pause failover operations</refpurpose>
18  </refnamediv>
19
20  <refsect1>
21    <title>Description</title>
22    <para>
23      This command can be run on any active node in the replication cluster to instruct all
24      running &repmgrd; instances to &quot;pause&quot; themselves, i.e. take no
25      action (such as promoting themselves or following a new primary) if a failover event is detected.
26    </para>
27    <para>
28      This functionality is useful for performing maintenance operations, such as switchovers
29      or upgrades, which might otherwise trigger a failover if &repmgrd;
30      is running normally.
31    </para>
32    <note>
33      <para>
34        It's important to wait a few seconds after restarting PostgreSQL on any node before running
35        <command>repmgr service pause</command>, as the &repmgrd; instance
36        on the restarted node will take a second or two before it has updated its status.
37      </para>
38    </note>
39    <para>
40      <xref linkend="repmgr-service-unpause"/> will instruct all previously paused &repmgrd;
41      instances to resume normal failover operation.
42    </para>
43  </refsect1>
44
45  <refsect1>
46    <title>Prerequisites</title>
47    <para>
48      PostgreSQL must be accessible on all nodes (using the <varname>conninfo</varname> string shown by
49      <link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>)
50      from the node where <command>repmgr service pause</command> is executed.
51    </para>
52  </refsect1>
53
54  <refsect1>
55    <title>Execution</title>
56    <para>
57      <command>repmgr service pause</command> can be executed on any active node in the
58      replication cluster. A valid <filename>repmgr.conf</filename> file is required.
59      It will have no effect on previously paused nodes.
60    </para>
61  </refsect1>
62
63  <refsect1>
64    <title>Example</title>
65    <para>
66    <programlisting>
67$ repmgr -f /etc/repmgr.conf service pause
68NOTICE: node 1 (node1) paused
69NOTICE: node 2 (node2) paused
70NOTICE: node 3 (node3) paused</programlisting>
71    </para>
72  </refsect1>
73
74  <refsect1>
75    <title>Options</title>
76    <variablelist>
77      <varlistentry>
78        <term><option>--dry-run</option></term>
79        <listitem>
80          <para>
81            Check if nodes are reachable but don't pause &repmgrd;.
82          </para>
83        </listitem>
84      </varlistentry>
85    </variablelist>
86  </refsect1>
87
88  <refsect1>
89    <title>Exit codes</title>
90    <para>
91      One of the following exit codes will be emitted by <command>repmgr service unpause</command>:
92    </para>
93    <variablelist>
94
95      <varlistentry>
96        <term><option>SUCCESS (0)</option></term>
97        <listitem>
98          <para>
99            &repmgrd; could be paused on all nodes.
100          </para>
101        </listitem>
102      </varlistentry>
103
104      <varlistentry>
105        <term><option>ERR_REPMGRD_PAUSE (26)</option></term>
106        <listitem>
107          <para>
108           &repmgrd; could not be paused on one or mode nodes.
109          </para>
110        </listitem>
111      </varlistentry>
112
113    </variablelist>
114  </refsect1>
115
116  <refsect1>
117    <title>See also</title>
118    <para>
119      <xref linkend="repmgr-service-unpause"/>,
120      <xref linkend="repmgr-service-status"/>,
121      <xref linkend="repmgrd-pausing"/>,
122      <xref linkend="repmgr-daemon-start"/>,
123      <xref linkend="repmgr-daemon-stop"/>
124    </para>
125  </refsect1>
126</refentry>
127
128