mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-28 09:26:29 +00:00
doc: define entity for repmgrd
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
<title>repmgrd setup and configuration</title>
|
||||
|
||||
<para>
|
||||
<application>repmgrd</application> is a daemon which runs on each PostgreSQL node,
|
||||
&repmgrd; is a daemon which runs on each PostgreSQL node,
|
||||
monitoring the local node, and (unless it's the primary node) the upstream server
|
||||
(the primary server or with cascading replication, another standby) which it's
|
||||
connected to.
|
||||
</para>
|
||||
<para>
|
||||
<application>repmgrd</application> can be configured to provide failover
|
||||
&repmgrd; can be configured to provide failover
|
||||
capability in case the primary upstream node becomes unreachable, and/or
|
||||
provide monitoring data to the &repmgr; metadatabase.
|
||||
</para>
|
||||
@@ -23,7 +23,7 @@
|
||||
<title>repmgrd configuration</title>
|
||||
|
||||
<para>
|
||||
To use <application>repmgrd</application>, its associated function library <emphasis>must</emphasis> be
|
||||
To use &repmgrd;, its associated function library <emphasis>must</emphasis> be
|
||||
included via <filename>postgresql.conf</filename> with:
|
||||
|
||||
<programlisting>
|
||||
@@ -35,7 +35,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following configuraton options apply to <application>repmgrd</application> in all circumstances:
|
||||
The following configuraton options apply to &repmgrd; in all circumstances:
|
||||
</para>
|
||||
<variablelist>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
The option <option>connection_check_type</option> is used to select the method
|
||||
<application>repmgrd</application> uses to determine whether the upstream node is available.
|
||||
&repmgrd; uses to determine whether the upstream node is available.
|
||||
</para>
|
||||
<para>
|
||||
Possible values are:
|
||||
@@ -132,7 +132,7 @@
|
||||
<term><option>degraded_monitoring_timeout</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Interval (in seconds) after which <application>repmgrd</application> will terminate if
|
||||
Interval (in seconds) after which &repmgrd; will terminate if
|
||||
either of the servers (local node and or upstream node) being monitored is no longer available
|
||||
(<link linkend="repmgrd-degraded-monitoring">degraded monitoring mode</link>).
|
||||
</para>
|
||||
@@ -152,7 +152,7 @@
|
||||
<title>Required configuration for automatic failover</title>
|
||||
|
||||
<para>
|
||||
The following <application>repmgrd</application> options <emphasis>must</emphasis> be set in
|
||||
The following &repmgrd; options <emphasis>must</emphasis> be set in
|
||||
<filename>repmgr.conf</filename>:
|
||||
|
||||
<itemizedlist spacing="compact" mark="bullet">
|
||||
@@ -192,7 +192,7 @@
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If <option>failover</option> is set to <literal>manual</literal>, <application>repmgrd</application>
|
||||
If <option>failover</option> is set to <literal>manual</literal>, &repmgrd;
|
||||
will not take any action if a failover situation is detected, and the node may need to
|
||||
be modified manually (e.g. by executing <command><link linkend="repmgr-standby-follow">repmgr standby follow</link></command>).
|
||||
</para>
|
||||
@@ -209,7 +209,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
The program or script defined in <option>promote_command</option> will be executed
|
||||
in a failover situation when <application>repmgrd</application> determines that
|
||||
in a failover situation when &repmgrd; determines that
|
||||
the current node is to become the new primary node.
|
||||
</para>
|
||||
<para>
|
||||
@@ -231,8 +231,8 @@
|
||||
|
||||
<para>
|
||||
Note that the <literal>--log-to-file</literal> option will cause
|
||||
output generated by the &repmgr; command, when executed by <application>repmgrd</application>,
|
||||
to be logged to the same destination configured to receive log output for <application>repmgrd</application>.
|
||||
output generated by the &repmgr; command, when executed by &repmgrd;,
|
||||
to be logged to the same destination configured to receive log output for &repmgrd;.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
@@ -252,7 +252,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
The program or script defined in <option>follow_command</option> will be executed
|
||||
in a failover situation when <application>repmgrd</application> determines that
|
||||
in a failover situation when &repmgrd; determines that
|
||||
the current node is to follow the new primary node.
|
||||
</para>
|
||||
<para>
|
||||
@@ -263,7 +263,7 @@
|
||||
The <option>follow_command</option> parameter
|
||||
should provide the <literal>--upstream-node-id=%n</literal>
|
||||
option to <command>repmgr standby follow</command>; the <literal>%n</literal> will be replaced by
|
||||
<application>repmgrd</application> with the ID of the new primary node. If this is not provided,
|
||||
&repmgrd; with the ID of the new primary node. If this is not provided,
|
||||
<command>repmgr standby follow</command> will attempt to determine the new primary by itself, but if the
|
||||
original primary comes back online after the new primary is promoted, there is a risk that
|
||||
<command>repmgr standby follow</command> will result in the node continuing to follow
|
||||
@@ -284,8 +284,8 @@
|
||||
|
||||
<para>
|
||||
Note that the <literal>--log-to-file</literal> option will cause
|
||||
output generated by the &repmgr; command, when executed by <application>repmgrd</application>,
|
||||
to be logged to the same destination configured to receive log output for <application>repmgrd</application>.
|
||||
output generated by the &repmgr; command, when executed by &repmgrd;,
|
||||
to be logged to the same destination configured to receive log output for &repmgrd;.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
@@ -337,7 +337,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
User-defined script to execute for an external mechanism to validate the failover
|
||||
decision made by <application>repmgrd</application>.
|
||||
decision made by &repmgrd;.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
@@ -408,7 +408,7 @@
|
||||
for this option.
|
||||
</para>
|
||||
<para>
|
||||
<application>repmgrd</application> will refuse to start if this option is set
|
||||
&repmgrd; will refuse to start if this option is set
|
||||
but either of these prerequisites is not met.
|
||||
</para>
|
||||
</note>
|
||||
@@ -469,14 +469,14 @@
|
||||
</indexterm>
|
||||
<title>PostgreSQL service configuration</title>
|
||||
<para>
|
||||
If using automatic failover, currently <application>repmgrd</application> will need to execute
|
||||
If using automatic failover, currently &repmgrd; will need to execute
|
||||
<link linkend="repmgr-standby-follow"><command>repmgr standby follow</command></link>
|
||||
to restart PostgreSQL on standbys to have them follow a new primary.
|
||||
</para>
|
||||
<para>
|
||||
To ensure this happens smoothly, it's essential to provide the appropriate system/service restart
|
||||
command appropriate to your operating system via <varname>service_restart_command</varname>
|
||||
in <filename>repmgr.conf</filename>. If you don't do this, <application>repmgrd</application>
|
||||
in <filename>repmgr.conf</filename>. If you don't do this, &repmgrd;
|
||||
will default to using <command>pg_ctl</command>, which can result in unexpected problems,
|
||||
particularly on <application>systemd</application>-based systems.
|
||||
</para>
|
||||
@@ -549,21 +549,21 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
</indexterm>
|
||||
<title>Applying configuration changes to repmgrd</title>
|
||||
<para>
|
||||
To apply configuration file changes to a running <application>repmgrd</application>
|
||||
daemon, execute the operating system's <application>repmgrd</application> service reload command
|
||||
To apply configuration file changes to a running &repmgrd;
|
||||
daemon, execute the operating system's &repmgrd; service reload command
|
||||
(see <xref linkend="appendix-packages"> for examples),
|
||||
or for instances which were manually started, execute <command>kill -HUP</command>, e.g.
|
||||
<command>kill -HUP `cat /tmp/repmgrd.pid`</command>.
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
Check the <application>repmgrd</application> log to see what changes were
|
||||
Check the &repmgrd; log to see what changes were
|
||||
applied, or if any issues were encountered when reloading the configuration.
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
Note that only the following subset of configuration file parameters can be changed on a
|
||||
running <application>repmgrd</application> daemon:
|
||||
running &repmgrd; daemon:
|
||||
</para>
|
||||
<itemizedlist spacing="compact" mark="bullet">
|
||||
|
||||
@@ -770,7 +770,7 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
<note>
|
||||
<para>
|
||||
After executing <command><link linkend="repmgr-standby-register">repmgr standby register --force</link></command>,
|
||||
<application>repmgrd</application> <emphasis>must</emphasis> be restarted for the changes to take effect.
|
||||
&repmgrd; <emphasis>must</emphasis> be restarted for the changes to take effect.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
@@ -785,7 +785,7 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
</indexterm>
|
||||
<title>repmgrd daemon</title>
|
||||
<para>
|
||||
If installed from a package, the <application>repmgrd</application> can be started
|
||||
If installed from a package, the &repmgrd; can be started
|
||||
via the operating system's service command, e.g. in <application>systemd</application>
|
||||
using <command>systemctl</command>.
|
||||
</para>
|
||||
@@ -796,7 +796,7 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
<para>
|
||||
The commands <link linkend="repmgr-daemon-start"><command>repmgr daemon start</command></link> and
|
||||
<link linkend="repmgr-daemon-stop"><command>repmgr daemon stop</command></link> can be used
|
||||
as convenience wrappers to start and stop <application>repmgrd</application>.
|
||||
as convenience wrappers to start and stop &repmgrd;.
|
||||
</para>
|
||||
<important>
|
||||
<para>
|
||||
@@ -808,7 +808,7 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
</para>
|
||||
</important>
|
||||
<para>
|
||||
<application>repmgrd</application> can be started manually like this:
|
||||
&repmgrd; can be started manually like this:
|
||||
<programlisting>
|
||||
repmgrd -f /etc/repmgr.conf --pid-file /tmp/repmgrd.pid</programlisting>
|
||||
and stopped with <command>kill `cat /tmp/repmgrd.pid`</command>. Adjust paths as appropriate.
|
||||
@@ -825,7 +825,7 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
</indexterm>
|
||||
<title>repmgrd's PID file</title>
|
||||
<para>
|
||||
<application>repmgrd</application> will generate a PID file by default.
|
||||
&repmgrd; will generate a PID file by default.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
@@ -845,12 +845,12 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
<option>--pid-file</option> may be deprecated in future releases.
|
||||
</para>
|
||||
<para>
|
||||
If a PID file location was specified by the package maintainer, <application>repmgrd</application>
|
||||
If a PID file location was specified by the package maintainer, &repmgrd;
|
||||
will use that. This only applies if &repmgr; was installed from a package and the package
|
||||
maintainer has specified the PID file location.
|
||||
</para>
|
||||
<para>
|
||||
If none of the above apply, <application>repmgrd</application> will create a PID file
|
||||
If none of the above apply, &repmgrd; will create a PID file
|
||||
in the operating system's temporary directory (as setermined by the environment variable
|
||||
<varname>TMPDIR</varname>, or if that is not set, will use <filename>/tmp</filename>).
|
||||
</para>
|
||||
@@ -859,10 +859,10 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
<option>--no-pid-file</option>.
|
||||
</para>
|
||||
<para>
|
||||
To see which PID file <application>repmgrd</application> would use, execute <application>repmgrd</application>
|
||||
with the option <option>--show-pid-file</option>. <application>repmgrd</application>
|
||||
To see which PID file &repmgrd; would use, execute &repmgrd;
|
||||
with the option <option>--show-pid-file</option>. &repmgrd;
|
||||
will not start if this option is provided. Note that the value shown is the
|
||||
file <application>repmgrd</application> would use next time it starts, and is
|
||||
file &repmgrd; would use next time it starts, and is
|
||||
not necessarily the PID file currently in use.
|
||||
</para>
|
||||
</sect2>
|
||||
@@ -881,7 +881,7 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
|
||||
<para>
|
||||
If &repmgr; was installed from Debian/Ubuntu packages, additional configuration
|
||||
is required before <application>repmgrd</application> is started as a daemon.
|
||||
is required before &repmgrd; is started as a daemon.
|
||||
</para>
|
||||
<para>
|
||||
This is done via the file <filename>/etc/default/repmgrd</filename>, which by default
|
||||
@@ -920,12 +920,12 @@ REPMGRD_OPTS="--daemonize=false"
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
From <application>repmgrd</application> 4.1, ensure <varname>REPMGRD_OPTS</varname> includes
|
||||
From &repmgrd; 4.1, ensure <varname>REPMGRD_OPTS</varname> includes
|
||||
<option>--daemonize=false</option>, as daemonization is handled by the service command.
|
||||
</para>
|
||||
<para>
|
||||
If using <application>systemd</application>, you may need to execute <command>systemctl daemon-reload</command>.
|
||||
Also, if you attempted to start <application>repmgrd</application> using <command>systemctl start repmgrd</command>,
|
||||
Also, if you attempted to start &repmgrd; using <command>systemctl start repmgrd</command>,
|
||||
you'll need to execute <command>systemctl stop repmgrd</command>. Because that's how <application>systemd</application>
|
||||
rolls.
|
||||
</para>
|
||||
@@ -972,7 +972,7 @@ REPMGRD_OPTS="--daemonize=false"
|
||||
|
||||
<title>repmgrd log rotation</title>
|
||||
<para>
|
||||
To ensure the current <application>repmgrd</application> logfile
|
||||
To ensure the current &repmgrd; logfile
|
||||
(specified in <filename>repmgr.conf</filename> with the parameter
|
||||
<option>log_file</option>) does not grow indefinitely, configure your
|
||||
system's <command>logrotate</command> to regularly rotate it.
|
||||
|
||||
Reference in New Issue
Block a user