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.
166 lines
4.8 KiB
Plaintext
166 lines
4.8 KiB
Plaintext
<refentry id="repmgr-daemon-status">
|
|
<indexterm>
|
|
<primary>repmgr daemon status</primary>
|
|
</indexterm>
|
|
|
|
<refmeta>
|
|
<refentrytitle>repmgr daemon status</refentrytitle>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>repmgr daemon status</refname>
|
|
<refpurpose>display information about the status of <application>repmgrd</application> on each node in the cluster</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
This command provides an overview over all active nodes in the cluster and the state
|
|
of each node's <application>repmgrd</application> instance. It can be used to check
|
|
the result of <xref linkend="repmgr-daemon-pause"> and <xref linkend="repmgr-daemon-unpause">
|
|
operations.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Execution</title>
|
|
<para>
|
|
<command>repmgr daemon status</command> can be executed on any active node in the
|
|
replication cluster. A valid <filename>repmgr.conf</filename> file is required.
|
|
</para>
|
|
|
|
<note>
|
|
<para>
|
|
After restarting PostgreSQL on any node, the <application>repmgrd</application> instance
|
|
will take a second or two before it is able to update its status. Until then,
|
|
<application>repmgrd</application> will be shown as not running.
|
|
</para>
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Examples</title>
|
|
<para>
|
|
<application>repmgrd</application> running normally on all nodes:
|
|
<programlisting>$ repmgr -f /etc/repmgr.conf daemon status
|
|
ID | Name | Role | Status | repmgrd | PID | Paused?
|
|
----+-------+---------+---------+---------+------+---------
|
|
1 | node1 | primary | running | running | 7851 | no
|
|
2 | node2 | standby | running | running | 7889 | no
|
|
3 | node3 | standby | running | running | 7918 | no</programlisting>
|
|
</para>
|
|
|
|
<para>
|
|
<application>repmgrd</application> paused on all nodes (using <xref linkend="repmgr-daemon-pause">):
|
|
<programlisting>$ repmgr -f /etc/repmgr.conf daemon status
|
|
ID | Name | Role | Status | repmgrd | PID | Paused?
|
|
----+-------+---------+---------+---------+------+---------
|
|
1 | node1 | primary | running | running | 7851 | yes
|
|
2 | node2 | standby | running | running | 7889 | yes
|
|
3 | node3 | standby | running | running | 7918 | yes</programlisting>
|
|
</para>
|
|
|
|
<para>
|
|
<application>repmgrd</application> not running on one node:
|
|
<programlisting>$ repmgr -f /etc/repmgr.conf daemon status
|
|
ID | Name | Role | Status | repmgrd | PID | Paused?
|
|
----+-------+---------+---------+-------------+------+---------
|
|
1 | node1 | primary | running | running | 7851 | yes
|
|
2 | node2 | standby | running | not running | n/a | n/a
|
|
3 | node3 | standby | running | running | 7918 | yes</programlisting>
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Options</title>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
<term><option>--csv</option></term>
|
|
<listitem>
|
|
<para>
|
|
<command>repmgr daemon status</command> accepts an optional parameter <literal>--csv</literal>, which
|
|
outputs the replication cluster's status in a simple CSV format, suitable for
|
|
parsing by scripts, e.g.:
|
|
<programlisting>
|
|
$ repmgr -f /etc/repmgr.conf daemon status --csv
|
|
1,node1,primary,1,1,10204,1
|
|
2,node2,standby,1,0,-1,1
|
|
3,node3,standby,1,1,10225,1</programlisting>
|
|
</para>
|
|
<para>
|
|
The columns have following meanings:
|
|
<itemizedlist spacing="compact" mark="bullet">
|
|
<listitem>
|
|
<simpara>
|
|
node ID
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
node name
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
node type (primary or standby)
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
PostgreSQL server running
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
<application>repmgrd</application> running (1 = running, 0 = not running)
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
<application>repmgrd</application> PID (-1 if not running)
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
<application>repmgrd</application> paused (1 = paused, 0 = not paused)
|
|
</simpara>
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>--verbose</option></term>
|
|
<listitem>
|
|
<para>
|
|
Display the full text of any database connection error messages
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
<title>See also</title>
|
|
<para>
|
|
<xref linkend="repmgr-daemon-pause">, <xref linkend="repmgr-daemon-unpause">, <xref linkend="repmgr-cluster-show">
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|