mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40b6c92129 | ||
|
|
761d65526c | ||
|
|
a13a1232e9 | ||
|
|
65965b3ba4 | ||
|
|
629d2b8f85 | ||
|
|
23c285b73b | ||
|
|
915fb7d617 | ||
|
|
ae141b9d32 | ||
|
|
d035550723 | ||
|
|
c7692b5d84 | ||
|
|
08b7f1294b | ||
|
|
81d01bf0e8 | ||
|
|
089c778e49 | ||
|
|
b4b5681762 | ||
|
|
e5ef549aa7 | ||
|
|
cfc41392c3 | ||
|
|
55dc4f7a5f | ||
|
|
6616712346 |
6
HISTORY
6
HISTORY
@@ -1,4 +1,4 @@
|
|||||||
4.4 2019-??-??
|
4.4 2019-06-27
|
||||||
repmgr: improve "daemon status" output (Ian)
|
repmgr: improve "daemon status" output (Ian)
|
||||||
repmgr: add "--siblings-follow" option to "standby promote" (Ian)
|
repmgr: add "--siblings-follow" option to "standby promote" (Ian)
|
||||||
repmgr: add "--repmgrd-force-unpause" option to "standby switchover" (Ian)
|
repmgr: add "--repmgrd-force-unpause" option to "standby switchover" (Ian)
|
||||||
@@ -6,6 +6,8 @@
|
|||||||
an existing directory is being overwritten (Ian)
|
an existing directory is being overwritten (Ian)
|
||||||
repmgr: improve "--dry-run" behaviour for "standby promote" and
|
repmgr: improve "--dry-run" behaviour for "standby promote" and
|
||||||
"standby switchover" (Ian)
|
"standby switchover" (Ian)
|
||||||
|
repmgr: when running "standby clone" with the "--upstream-conninfo" option
|
||||||
|
ensure that "application_name" is set correctly in "primary_conninfo" (Ian)
|
||||||
repmgr: ensure "--dry-run" together with --force when running "standby clone"
|
repmgr: ensure "--dry-run" together with --force when running "standby clone"
|
||||||
in barman mode does not modify an existing data directory (Ian)
|
in barman mode does not modify an existing data directory (Ian)
|
||||||
repmgr: improve "--dry-run" output when running "standby clone" in
|
repmgr: improve "--dry-run" output when running "standby clone" in
|
||||||
@@ -21,6 +23,8 @@
|
|||||||
repmgr: prevent a witness server being registered on the cluster primary (John)
|
repmgr: prevent a witness server being registered on the cluster primary (John)
|
||||||
repmgr: ensure BDR2-specific functionality cannot be used on
|
repmgr: ensure BDR2-specific functionality cannot be used on
|
||||||
BDR3 and later (Ian)
|
BDR3 and later (Ian)
|
||||||
|
repmgr: canonicalize the data directory path (Ian)
|
||||||
|
repmgr: note that "standby follow" requires a primary to be available (Ian)
|
||||||
repmgrd: monitor standbys attached to primary (Ian)
|
repmgrd: monitor standbys attached to primary (Ian)
|
||||||
repmgrd: add "primary visibility consensus" functionality (Ian)
|
repmgrd: add "primary visibility consensus" functionality (Ian)
|
||||||
repmgrd: fix memory leak which occurs while the monitored PostgreSQL
|
repmgrd: fix memory leak which occurs while the monitored PostgreSQL
|
||||||
|
|||||||
@@ -502,10 +502,15 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
|
|||||||
else if (strcmp(name, "conninfo") == 0)
|
else if (strcmp(name, "conninfo") == 0)
|
||||||
strncpy(options->conninfo, value, MAXLEN);
|
strncpy(options->conninfo, value, MAXLEN);
|
||||||
else if (strcmp(name, "data_directory") == 0)
|
else if (strcmp(name, "data_directory") == 0)
|
||||||
|
{
|
||||||
strncpy(options->data_directory, value, MAXPGPATH);
|
strncpy(options->data_directory, value, MAXPGPATH);
|
||||||
|
canonicalize_path(options->data_directory);
|
||||||
|
}
|
||||||
else if (strcmp(name, "config_directory") == 0)
|
else if (strcmp(name, "config_directory") == 0)
|
||||||
|
{
|
||||||
strncpy(options->config_directory, value, MAXPGPATH);
|
strncpy(options->config_directory, value, MAXPGPATH);
|
||||||
|
canonicalize_path(options->config_directory);
|
||||||
|
}
|
||||||
else if (strcmp(name, "replication_user") == 0)
|
else if (strcmp(name, "replication_user") == 0)
|
||||||
{
|
{
|
||||||
if (strlen(value) < sizeof(options->replication_user))
|
if (strlen(value) < sizeof(options->replication_user))
|
||||||
|
|||||||
@@ -2092,9 +2092,9 @@ get_repmgr_extension_status(PGconn *conn, t_extension_versions *extversions)
|
|||||||
appendPQExpBufferStr(&query,
|
appendPQExpBufferStr(&query,
|
||||||
" SELECT ae.name, e.extname, "
|
" SELECT ae.name, e.extname, "
|
||||||
" ae.default_version, "
|
" ae.default_version, "
|
||||||
" (((ae.default_version::NUMERIC::INT) * 10000) + (ae.default_version::NUMERIC - ae.default_version::NUMERIC::INT) * 1000)::INT AS available, "
|
" (((FLOOR(ae.default_version::NUMERIC)::INT) * 10000) + (ae.default_version::NUMERIC - FLOOR(ae.default_version::NUMERIC)::INT) * 1000)::INT AS available, "
|
||||||
" ae.installed_version, "
|
" ae.installed_version, "
|
||||||
" (((ae.installed_version::NUMERIC::INT) * 10000) + (ae.installed_version::NUMERIC - ae.installed_version::NUMERIC::INT) * 1000)::INT AS installed "
|
" (((FLOOR(ae.installed_version::NUMERIC)::INT) * 10000) + (ae.installed_version::NUMERIC - FLOOR(ae.installed_version::NUMERIC)::INT) * 1000)::INT AS installed "
|
||||||
" FROM pg_catalog.pg_available_extensions ae "
|
" FROM pg_catalog.pg_available_extensions ae "
|
||||||
"LEFT JOIN pg_catalog.pg_extension e "
|
"LEFT JOIN pg_catalog.pg_extension e "
|
||||||
" ON e.extname=ae.name "
|
" ON e.extname=ae.name "
|
||||||
|
|||||||
@@ -17,31 +17,39 @@
|
|||||||
|
|
||||||
<sect1 id="release-4.4">
|
<sect1 id="release-4.4">
|
||||||
<title>Release 4.4</title>
|
<title>Release 4.4</title>
|
||||||
<para><emphasis>?? June, 2019</emphasis></para>
|
<para><emphasis>27 June, 2019</emphasis></para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>repmgr client enhancements</title>
|
<title>repmgr client enhancements</title>
|
||||||
<para>
|
<para>
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-standby-clone"><command>repmgr standby clone</command></link>:
|
<link linkend="repmgr-standby-clone"><command>repmgr standby clone</command></link>:
|
||||||
prevent a standby from being cloned from a witness server (PostgreSQL 9.6 and later only).
|
prevent a standby from being cloned from a witness server (PostgreSQL 9.6 and later only).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-witness-register"><command>repmgr witness register</command></link>:
|
<link linkend="repmgr-witness-register"><command>repmgr witness register</command></link>:
|
||||||
prevent a witness server from being registered on the replication cluster primary server
|
prevent a witness server from being registered on the replication cluster primary server
|
||||||
(PostgreSQL 9.6 and later only).
|
(PostgreSQL 9.6 and later only).
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Registering a witness on the primary node would defeat the purpose of having a witness server,
|
Registering a witness on the primary node would defeat the purpose of having a witness server,
|
||||||
which is intended to remain running even if the cluster's primary goes down.
|
which is intended to remain running even if the cluster's primary goes down.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<link linkend="repmgr-standby-follow"><command>repmgr standby follow</command></link>:
|
||||||
|
note that an active, reachable cluster primary is required for this command;
|
||||||
|
and provide a more helpful error message if no reachable primary could be found.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@@ -75,7 +83,6 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-standby-promote"><command>repmgr standby promote</command></link>:
|
<link linkend="repmgr-standby-promote"><command>repmgr standby promote</command></link>:
|
||||||
@@ -94,61 +101,61 @@
|
|||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>:
|
<link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>:
|
||||||
add <option>--repmgrd-force-unpause</option> to unpause all &repmgrd; instances after executing a switchover.
|
add <option>--repmgrd-force-unpause</option> to unpause all &repmgrd; instances after executing a switchover.
|
||||||
This will ensure that any &repmgrd; instances which were paused before the switchover will be
|
This will ensure that any &repmgrd; instances which were paused before the switchover will be
|
||||||
unpaused.
|
unpaused.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-daemon-status"><command>repmgr daemon status</command></link>:
|
<link linkend="repmgr-daemon-status"><command>repmgr daemon status</command></link>:
|
||||||
make output similar to that of
|
make output similar to that of
|
||||||
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>
|
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>
|
||||||
for consistency and to make it easier to identify nodes not in the expected
|
for consistency and to make it easier to identify nodes not in the expected
|
||||||
state.
|
state.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>:
|
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>:
|
||||||
display each node's timeline ID (PostgreSQL 9.6 and later only).
|
display each node's timeline ID (PostgreSQL 9.6 and later only).
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>
|
|
||||||
and <link linkend="repmgr-daemon-status"><command>repmgr daemon status</command></link>:
|
|
||||||
show the upstream node name as reported by each individual node - this helps visualise
|
|
||||||
situations where the cluster is in an unexpected state, and provide a better idea of the
|
|
||||||
actual cluster state.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
For example, if a cluster has divided somehow and a set of nodes are
|
|
||||||
following a new primary, when running either of these commands, &repmgr;
|
|
||||||
will now show the name of the primary those nodes are actually
|
|
||||||
following, rather than the now outdated node name recorded
|
|
||||||
on the other side of the "split". A warning will also be issued
|
|
||||||
about the unexpected situation.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>
|
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>
|
||||||
and <link linkend="repmgr-daemon-status"><command>repmgr daemon status</command></link>:
|
and <link linkend="repmgr-daemon-status"><command>repmgr daemon status</command></link>:
|
||||||
check if a node is attached to its advertised upstream node, and issue a
|
show the upstream node name as reported by each individual node - this helps visualise
|
||||||
warning if the node is not attached.
|
situations where the cluster is in an unexpected state, and provide a better idea of the
|
||||||
</para>
|
actual cluster state.
|
||||||
</listitem>
|
</para>
|
||||||
|
<para>
|
||||||
|
For example, if a cluster has divided somehow and a set of nodes are
|
||||||
|
following a new primary, when running either of these commands, &repmgr;
|
||||||
|
will now show the name of the primary those nodes are actually
|
||||||
|
following, rather than the now outdated node name recorded
|
||||||
|
on the other side of the "split". A warning will also be issued
|
||||||
|
about the unexpected situation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
<listitem>
|
||||||
</para>
|
<para>
|
||||||
|
<link linkend="repmgr-cluster-show"><command>repmgr cluster show</command></link>
|
||||||
|
and <link linkend="repmgr-daemon-status"><command>repmgr daemon status</command></link>:
|
||||||
|
check if a node is attached to its advertised upstream node, and issue a
|
||||||
|
warning if the node is not attached.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
@@ -221,23 +228,41 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
|
&repmgr;: when executing <link linkend="repmgr-standby-clone"><command>repmgr standby clone</command></link>
|
||||||
|
with the <option>--upstream-conninfo</option>, ensure that <varname>application_name</varname>
|
||||||
|
is set correctly in <varname>primary_conninfo</varname>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
||||||
don't abort if one or more nodes are not reachable <emphasis>and</emphasis>
|
don't abort if one or more nodes are not reachable <emphasis>and</emphasis>
|
||||||
they are marked as inactive.
|
they are marked as inactive.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
|
&repmgr;: canonicalize the data directory path when parsing the configuration file, so
|
||||||
|
the provided path matches the path PostgreSQL reports as its data directory.
|
||||||
|
Otherwise, if e.g. the data directory is configured with a trailing slash,
|
||||||
|
<link linkend="repmgr-node-check"><command>repmgr node check --data-directory-config</command></link>
|
||||||
|
will return a spurious error.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
&repmgrd;: fix memory leak which occurs while the monitored PostgreSQL node is <emphasis>not</emphasis>
|
&repmgrd;: fix memory leak which occurs while the monitored PostgreSQL node is <emphasis>not</emphasis>
|
||||||
running.
|
running.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
|
||||||
@@ -281,19 +306,19 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|
||||||
<important>
|
<important>
|
||||||
<para>
|
<para>
|
||||||
On Debian-based systems, including Ubuntu, if using &repmgrd;
|
On Debian-based systems, including Ubuntu, if using &repmgrd;
|
||||||
please ensure that in the file <filename>/etc/init.d/repmgrd</filename>, the parameter
|
please ensure that in the file <filename>/etc/init.d/repmgrd</filename>, the parameter
|
||||||
<varname>REPMGRD_OPTS</varname> contains "<literal>--daemonize=false</literal>", e.g.:
|
<varname>REPMGRD_OPTS</varname> contains "<literal>--daemonize=false</literal>", e.g.:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
# additional options
|
# additional options
|
||||||
REPMGRD_OPTS="--daemonize=false"</programlisting>
|
REPMGRD_OPTS="--daemonize=false"</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
For further details, see <link linkend="repmgrd-configuration-debian-ubuntu">repmgrd configuration on Debian/Ubuntu</link>.
|
For further details, see <link linkend="repmgrd-configuration-debian-ubuntu">repmgrd configuration on Debian/Ubuntu</link>.
|
||||||
</para>
|
</para>
|
||||||
</important>
|
</important>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>repmgr client enhancements</title>
|
<title>repmgr client enhancements</title>
|
||||||
@@ -358,11 +383,11 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-cluster-show">repmgr cluster show</link></command>:
|
<command><link linkend="repmgr-cluster-show">repmgr cluster show</link></command>:
|
||||||
differentiate between unreachable nodes and nodes which are running but rejecting connections.
|
differentiate between unreachable nodes and nodes which are running but rejecting connections.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
This makes it possible to see whether a node is unreachable at network level,
|
This makes it possible to see whether a node is unreachable at network level,
|
||||||
or if it is running but rejecting connections for some reason.
|
or if it is running but rejecting connections for some reason.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
@@ -411,7 +436,7 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
&repmgrd; will no longer consider nodes where &repmgrd;
|
&repmgrd; will no longer consider nodes where &repmgrd;
|
||||||
is not running as promotion candidates.
|
is not running as promotion candidates.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Previously, if &repmgrd; was not running on a node, but
|
Previously, if &repmgrd; was not running on a node, but
|
||||||
@@ -449,15 +474,15 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
In a failover situation, &repmgrd; will not attempt to promote a
|
In a failover situation, &repmgrd; will not attempt to promote a
|
||||||
node if another primary has already appeared (e.g. by being promoted manually).
|
node if another primary has already appeared (e.g. by being promoted manually).
|
||||||
GitHub #420.
|
GitHub #420.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Bug fixes</title>
|
<title>Bug fixes</title>
|
||||||
@@ -467,23 +492,23 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-cluster-show">repmgr cluster show</link></command>:
|
<command><link linkend="repmgr-cluster-show">repmgr cluster show</link></command>:
|
||||||
fix display of node IDs with multiple digits.
|
fix display of node IDs with multiple digits.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
ensure <command><link linkend="repmgr-primary-unregister">repmgr primary unregister</link></command>
|
ensure <command><link linkend="repmgr-primary-unregister">repmgr primary unregister</link></command>
|
||||||
behaves correctly when executed on a witness server. GitHub #548.
|
behaves correctly when executed on a witness server. GitHub #548.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
ensure <command><link linkend="repmgr-standby-register">repmgr standby register</link></command>
|
ensure <command><link linkend="repmgr-standby-register">repmgr standby register</link></command>
|
||||||
fails when <option>--upstream-node-id</option> is the same as the local node ID.
|
fails when <option>--upstream-node-id</option> is the same as the local node ID.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@@ -504,7 +529,7 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
||||||
verify the standby (promotion candidate) is currently attached to the primary (demotion candidate). GitHub #519.
|
verify the standby (promotion candidate) is currently attached to the primary (demotion candidate). GitHub #519.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
@@ -512,7 +537,7 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<para>
|
<para>
|
||||||
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
||||||
avoid a potential race condition when comparing received WAL on the standby to the primary's shutdown location,
|
avoid a potential race condition when comparing received WAL on the standby to the primary's shutdown location,
|
||||||
as the standby's walreceiver may not have yet flushed all received WAL to disk. GitHub #518.
|
as the standby's walreceiver may not have yet flushed all received WAL to disk. GitHub #518.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
@@ -526,11 +551,11 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-node-check">repmgr node check</link></command>
|
<command><link linkend="repmgr-node-check">repmgr node check</link></command>
|
||||||
will only consider physical replication slots, as the purpose
|
will only consider physical replication slots, as the purpose
|
||||||
of slot checks is to warn about potential issues with
|
of slot checks is to warn about potential issues with
|
||||||
streaming replication standbys which are no longer attached.
|
streaming replication standbys which are no longer attached.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@@ -561,19 +586,19 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<link linkend="upgrading-major-version">Upgrading a major version release</link>.
|
<link linkend="upgrading-major-version">Upgrading a major version release</link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<important>
|
<important>
|
||||||
<para>
|
<para>
|
||||||
On Debian-based systems, including Ubuntu, if using &repmgrd;
|
On Debian-based systems, including Ubuntu, if using &repmgrd;
|
||||||
please ensure that the in the file <filename>/etc/init.d/repmgrd</filename>, the parameter
|
please ensure that the in the file <filename>/etc/init.d/repmgrd</filename>, the parameter
|
||||||
<varname>REPMGRD_OPTS</varname> contains "<literal>--daemonize=false</literal>", e.g.:
|
<varname>REPMGRD_OPTS</varname> contains "<literal>--daemonize=false</literal>", e.g.:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
# additional options
|
# additional options
|
||||||
REPMGRD_OPTS="--daemonize=false"</programlisting>
|
REPMGRD_OPTS="--daemonize=false"</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
For further details, see <link linkend="repmgrd-configuration-debian-ubuntu">repmgrd daemon configuration on Debian/Ubuntu</link>.
|
For further details, see <link linkend="repmgrd-configuration-debian-ubuntu">repmgrd daemon configuration on Debian/Ubuntu</link>.
|
||||||
</para>
|
</para>
|
||||||
</important>
|
</important>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Configuration file changes</title>
|
<title>Configuration file changes</title>
|
||||||
@@ -705,11 +730,11 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
repmgr 4.1.1 contains a number of usability enhancements and bug fixes.
|
repmgr 4.1.1 contains a number of usability enhancements and bug fixes.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
We recommend upgrading to this version as soon as possible.
|
We recommend upgrading to this version as soon as possible.
|
||||||
This release can be installed as a simple package upgrade from repmgr 4.0 ~ 4.1.0;
|
This release can be installed as a simple package upgrade from repmgr 4.0 ~ 4.1.0;
|
||||||
&repmgrd; (if running) should be restarted.
|
&repmgrd; (if running) should be restarted.
|
||||||
See <xref linkend="upgrading-repmgr"/> for more details.
|
See <xref linkend="upgrading-repmgr"/> for more details.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>repmgr enhancements</title>
|
<title>repmgr enhancements</title>
|
||||||
@@ -971,18 +996,18 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-witness-unregister">repmgr witness unregister</link></command>
|
<command><link linkend="repmgr-witness-unregister">repmgr witness unregister</link></command>
|
||||||
can be run on any node, by providing the ID of the witness node with <option>--node-id</option>.
|
can be run on any node, by providing the ID of the witness node with <option>--node-id</option>.
|
||||||
(GitHub #472).
|
(GitHub #472).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-standby-switchover">repmgr standby switchover</link></command>
|
<command><link linkend="repmgr-standby-switchover">repmgr standby switchover</link></command>
|
||||||
will refuse to run if an exclusive backup is taking place on the current primary.
|
will refuse to run if an exclusive backup is taking place on the current primary.
|
||||||
(GitHub #476).
|
(GitHub #476).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
@@ -1003,9 +1028,9 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
&repmgrd;: daemonize process by default.
|
&repmgrd;: daemonize process by default.
|
||||||
In case, for whatever reason, the user does not wish to daemonize the
|
In case, for whatever reason, the user does not wish to daemonize the
|
||||||
process, provide <option>--daemonize=false</option>.
|
process, provide <option>--daemonize=false</option>.
|
||||||
(GitHub #458).
|
(GitHub #458).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
@@ -1030,23 +1055,23 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-cluster-cleanup">repmgr cluster cleanup</link></command>:
|
<command><link linkend="repmgr-cluster-cleanup">repmgr cluster cleanup</link></command>:
|
||||||
add missing help options. (GitHub #461/#462).
|
add missing help options. (GitHub #461/#462).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Ensure witness node follows new primary after switchover. (GitHub #453).
|
Ensure witness node follows new primary after switchover. (GitHub #453).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-node-check">repmgr node check</link></command> and
|
<command><link linkend="repmgr-node-check">repmgr node check</link></command> and
|
||||||
<command><link linkend="repmgr-node-status">repmgr node status</link></command>:
|
<command><link linkend="repmgr-node-status">repmgr node status</link></command>:
|
||||||
fix witness node handling. (GitHub #451).
|
fix witness node handling. (GitHub #451).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@@ -1066,14 +1091,14 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<title>Release 4.0.6</title>
|
<title>Release 4.0.6</title>
|
||||||
<para><emphasis>Thu June 14, 2018</emphasis></para>
|
<para><emphasis>Thu June 14, 2018</emphasis></para>
|
||||||
<para>
|
<para>
|
||||||
&repmgr; 4.0.6 contains a number of bug fixes and usability enhancements.
|
&repmgr; 4.0.6 contains a number of bug fixes and usability enhancements.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
We recommend upgrading to this version as soon as possible.
|
We recommend upgrading to this version as soon as possible.
|
||||||
This release can be installed as a simple package upgrade from repmgr 4.0 ~ 4.0.5;
|
This release can be installed as a simple package upgrade from repmgr 4.0 ~ 4.0.5;
|
||||||
&repmgrd; (if running) should be restarted. See <xref linkend="upgrading-repmgr"/>
|
&repmgrd; (if running) should be restarted. See <xref linkend="upgrading-repmgr"/>
|
||||||
for more details.
|
for more details.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Usability enhancements</title>
|
<title>Usability enhancements</title>
|
||||||
@@ -1091,33 +1116,33 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-standby-clone">repmgr standby clone</link></command>:
|
<command><link linkend="repmgr-standby-clone">repmgr standby clone</link></command>:
|
||||||
Improve handling of external configuration file copying, including consideration in
|
Improve handling of external configuration file copying, including consideration in
|
||||||
<option>--dry-run</option> check
|
<option>--dry-run</option> check
|
||||||
(GitHub #443)
|
(GitHub #443)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
When using <option>--dry-run</option>, force log level to <literal>INFO</literal>
|
When using <option>--dry-run</option>, force log level to <literal>INFO</literal>
|
||||||
to ensure output will always be displayed
|
to ensure output will always be displayed
|
||||||
(GitHub #441)
|
(GitHub #441)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-standby-clone">repmgr standby clone</link></command>:
|
<command><link linkend="repmgr-standby-clone">repmgr standby clone</link></command>:
|
||||||
Improve documentation of <option>--recovery-conf-only</option> mode
|
Improve documentation of <option>--recovery-conf-only</option> mode
|
||||||
(GitHub #438)
|
(GitHub #438)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-standby-clone">repmgr standby clone</link></command>:
|
<command><link linkend="repmgr-standby-clone">repmgr standby clone</link></command>:
|
||||||
Don't require presence of <varname>user</varname> parameter in conninfo string
|
Don't require presence of <varname>user</varname> parameter in conninfo string
|
||||||
(GitHub #437)
|
(GitHub #437)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
@@ -1143,23 +1168,23 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-standby-follow">repmgr standby follow</link></command>:
|
<command><link linkend="repmgr-standby-follow">repmgr standby follow</link></command>:
|
||||||
check node has actually connected to new primary before reporting success
|
check node has actually connected to new primary before reporting success
|
||||||
(GitHub #444)
|
(GitHub #444)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<command><link linkend="repmgr-node-rejoin">repmgr node rejoin</link></command>:
|
<command><link linkend="repmgr-node-rejoin">repmgr node rejoin</link></command>:
|
||||||
Fix bug when parsing <option>--config-files</option> parameter
|
Fix bug when parsing <option>--config-files</option> parameter
|
||||||
(GitHub #442)
|
(GitHub #442)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
&repmgrd;: ensure local node is counted as quorum member
|
&repmgrd;: ensure local node is counted as quorum member
|
||||||
(GitHub #439)
|
(GitHub #439)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
|||||||
124
doc/configuration-file-optional-settings.xml
Normal file
124
doc/configuration-file-optional-settings.xml
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<sect1 id="configuration-file-optional-settings" xreflabel="optional configuration file settings">
|
||||||
|
|
||||||
|
<title>Optional configuration file settings</title>
|
||||||
|
|
||||||
|
<indexterm>
|
||||||
|
<primary>repmgr.conf</primary>
|
||||||
|
<secondary>optional settings</secondary>
|
||||||
|
</indexterm>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
|
||||||
|
|
||||||
|
<varlistentry id="repmgr-conf-config-directory" xreflabel="config_directory">
|
||||||
|
<term><varname>config_directory</varname> (<type>string</type>)
|
||||||
|
<indexterm>
|
||||||
|
<primary><varname>config_directory</varname> configuration file parameter</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If PostgreSQL configuration files are located outside the data
|
||||||
|
directory, specify the directory where the main
|
||||||
|
<filename>postgresql.conf</filename> file is located.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
This enables explicit provision of an external configuration file
|
||||||
|
directory, which if set will be passed to <command>pg_ctl</command> as the
|
||||||
|
<option>-D</option> parameter. Otherwise <command>pg_ctl</command> will
|
||||||
|
default to using the data directory, which will cause some operations
|
||||||
|
to fail if the configuration files are not present there.
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
This is implemented primarily for feature completeness and for
|
||||||
|
development/testing purposes. Users who have installed &repmgr; from
|
||||||
|
a package should <emphasis>not</emphasis> rely on to stop/start/restart PostgreSQL,
|
||||||
|
instead they should set the appropriate <option>service_..._command</option>
|
||||||
|
for their operating system. For more details see
|
||||||
|
<xref linkend="configuration-file-service-commands"/>.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry id="repmgr-conf-replication-user" xreflabel="replication_user">
|
||||||
|
<term><varname>replication_user</varname> (<type>string</type>)
|
||||||
|
<indexterm>
|
||||||
|
<primary><varname>replication_user</varname> configuration file parameter</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
PostgreSQL user to make replication connections with.
|
||||||
|
If not set defaults, to the user defined in <xref linkend="repmgr-conf-conninfo"/>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<varlistentry id="repmgr-conf-replication-type" xreflabel="replication_type">
|
||||||
|
<term><varname>replication_type</varname> (<type>string</type>)
|
||||||
|
<indexterm>
|
||||||
|
<primary><varname>replication_type</varname> configuration file parameter</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Must be one of <literal>physical</literal> (for standard streaming replication)
|
||||||
|
or <literal>bdr</literal>.
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
Replication type <literal>bdr</literal> can only be used with BDR 2.x
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
BDR 3.x users should use <literal>physical</literal>.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry id="repmgr-conf-location" xreflabel="location">
|
||||||
|
<term><varname>location</varname> (<type>string</type>)
|
||||||
|
<indexterm>
|
||||||
|
<primary><varname>location</varname> configuration file parameter</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An arbitrary string defining the location of the node; this
|
||||||
|
is used during failover to check visibility of the
|
||||||
|
current primary node.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
For more details see <xref linkend="repmgrd-network-split"/>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry id="repmgr-conf-use-replication-slots" xreflabel="use_replication_slots">
|
||||||
|
<term><varname>use_replication_slots</varname> (<type>boolean</type>)
|
||||||
|
<indexterm>
|
||||||
|
<primary><varname>use_replication_slots</varname> configuration file parameter</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Whether to use physical replication slots.
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
When using replication slots,
|
||||||
|
<varname>max_replication_slots</varname> should be configured for
|
||||||
|
at least the number of standbys which will connect
|
||||||
|
to the primary.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</sect1>
|
||||||
@@ -96,33 +96,6 @@
|
|||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
|
||||||
For a full list of annotated configuration items, see the file
|
|
||||||
<ulink url="https://raw.githubusercontent.com/2ndQuadrant/repmgr/master/repmgr.conf.sample">repmgr.conf.sample</ulink>.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
For &repmgrd;-specific settings, see <xref linkend="repmgrd-configuration"/>.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
The following parameters in the configuration file can be overridden with
|
|
||||||
command line options:
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<simpara>
|
|
||||||
<literal>-L/--log-level</literal> overrides <literal>log_level</literal> in
|
|
||||||
<filename>repmgr.conf</filename>
|
|
||||||
</simpara>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<simpara>
|
|
||||||
<literal>-b/--pg_bindir</literal> overrides <literal>pg_bindir</literal> in
|
|
||||||
<filename>repmgr.conf</filename>
|
|
||||||
</simpara>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|||||||
@@ -62,6 +62,70 @@ data_directory = /var/lib/pgsql/11/data</programlisting>
|
|||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
|
||||||
|
<sect2 id="configuration-file-items" xreflabel="configuration file items">
|
||||||
|
|
||||||
|
<title>Configuration file items</title>
|
||||||
|
<para>
|
||||||
|
The following sections document some sections of the configuration file:
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<simpara>
|
||||||
|
<xref linkend="configuration-file-settings"/>
|
||||||
|
</simpara>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<simpara>
|
||||||
|
<xref linkend="configuration-file-optional-settings"/>
|
||||||
|
</simpara>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<simpara>
|
||||||
|
<xref linkend="configuration-file-log-settings"/>
|
||||||
|
</simpara>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<simpara>
|
||||||
|
<xref linkend="configuration-file-service-commands"/>
|
||||||
|
</simpara>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
For a full list of annotated configuration items, see the file
|
||||||
|
<ulink url="https://raw.githubusercontent.com/2ndQuadrant/repmgr/master/repmgr.conf.sample">repmgr.conf.sample</ulink>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
For &repmgrd;-specific settings, see <xref linkend="repmgrd-configuration"/>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
The following parameters in the configuration file can be overridden with
|
||||||
|
command line options:
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<simpara>
|
||||||
|
<literal>-L/--log-level</literal> overrides <literal>log_level</literal> in
|
||||||
|
<filename>repmgr.conf</filename>
|
||||||
|
</simpara>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<simpara>
|
||||||
|
<literal>-b/--pg_bindir</literal> overrides <literal>pg_bindir</literal> in
|
||||||
|
<filename>repmgr.conf</filename>
|
||||||
|
</simpara>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
<sect2 id="configuration-file-location" xreflabel="configuration file location">
|
<sect2 id="configuration-file-location" xreflabel="configuration file location">
|
||||||
<title>Configuration file location</title>
|
<title>Configuration file location</title>
|
||||||
|
|||||||
@@ -305,6 +305,7 @@
|
|||||||
|
|
||||||
&configuration-file;
|
&configuration-file;
|
||||||
&configuration-file-required-settings;
|
&configuration-file-required-settings;
|
||||||
|
&configuration-file-optional-settings;
|
||||||
&configuration-file-log-settings;
|
&configuration-file-log-settings;
|
||||||
&configuration-file-service-commands;
|
&configuration-file-service-commands;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<!ENTITY configuration SYSTEM "configuration.xml">
|
<!ENTITY configuration SYSTEM "configuration.xml">
|
||||||
<!ENTITY configuration-file SYSTEM "configuration-file.xml">
|
<!ENTITY configuration-file SYSTEM "configuration-file.xml">
|
||||||
<!ENTITY configuration-file-required-settings SYSTEM "configuration-file-required-settings.xml">
|
<!ENTITY configuration-file-required-settings SYSTEM "configuration-file-required-settings.xml">
|
||||||
|
<!ENTITY configuration-file-optional-settings SYSTEM "configuration-file-optional-settings.xml">
|
||||||
<!ENTITY configuration-file-log-settings SYSTEM "configuration-file-log-settings.xml">
|
<!ENTITY configuration-file-log-settings SYSTEM "configuration-file-log-settings.xml">
|
||||||
<!ENTITY configuration-file-service-commands SYSTEM "configuration-file-service-commands.xml">
|
<!ENTITY configuration-file-service-commands SYSTEM "configuration-file-service-commands.xml">
|
||||||
<!ENTITY cloning-standbys SYSTEM "cloning-standbys.xml">
|
<!ENTITY cloning-standbys SYSTEM "cloning-standbys.xml">
|
||||||
|
|||||||
@@ -326,9 +326,13 @@
|
|||||||
<term><option>--upstream-conninfo</option></term>
|
<term><option>--upstream-conninfo</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<literal>primary_conninfo</literal> value to write in recovery.conf
|
<literal>primary_conninfo</literal> value to write in <filename>recovery.conf</filename>
|
||||||
when the intended upstream server does not yet exist.
|
when the intended upstream server does not yet exist.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
Note that &repmgr; may modify the provided value, in particular to set the
|
||||||
|
correct <literal>application_name</literal>.
|
||||||
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|||||||
@@ -20,49 +20,54 @@
|
|||||||
("follow target"). Typically this will be the primary, but this
|
("follow target"). Typically this will be the primary, but this
|
||||||
command can also be used to attach the standby to another standby.
|
command can also be used to attach the standby to another standby.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This command requires a valid
|
This command requires a valid <filename>repmgr.conf</filename> file for the standby,
|
||||||
<filename>repmgr.conf</filename> file for the standby, either specified
|
either specified explicitly with <literal>-f/--config-file</literal> or located in a
|
||||||
explicitly with <literal>-f/--config-file</literal> or located in a
|
|
||||||
default location; no additional arguments are required.
|
default location; no additional arguments are required.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>The standby node ("follow candidate") <emphasis>must</emphasis>
|
||||||
By default &repmgr; will attempt to attach the standby to the current primary.
|
be running. If the new upstream ("follow target") is not the primary,
|
||||||
If <option>--upstream-node-id</option> is provided, &repmgr; will attempt
|
the cluster primary <emphasis>must</emphasis> be running and accessible from the
|
||||||
to attach the standby to the specified node, which can be another standby.
|
standby node.
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
This command will force a restart of the standby server, which must be
|
|
||||||
running.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
To re-add an inactive node to the replication cluster, use
|
To re-add an inactive node to the replication cluster, use
|
||||||
<xref linkend="repmgr-node-rejoin"/>.
|
<xref linkend="repmgr-node-rejoin"/>.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>repmgr standby follow</command> will wait up to
|
By default &repmgr; will attempt to attach the standby to the current primary.
|
||||||
<varname>standby_follow_timeout</varname> seconds (default: <literal>30</literal>)
|
If <option>--upstream-node-id</option> is provided, &repmgr; will attempt
|
||||||
to verify the standby has actually connected to the new upstream node.
|
to attach the standby to the specified node, which can be another standby.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<para>
|
||||||
<para>
|
This command will force a restart of PostgreSQL on the standby node.
|
||||||
If <option>recovery_min_apply_delay</option> is set for the standby, it
|
</para>
|
||||||
will not attach to the new upstream node until it has replayed available
|
|
||||||
WAL.
|
<para>
|
||||||
</para>
|
<command>repmgr standby follow</command> will wait up to
|
||||||
<para>
|
<varname>standby_follow_timeout</varname> seconds (default: <literal>30</literal>)
|
||||||
Conversely, if the standby is attached to an upstream standby
|
to verify the standby has actually connected to the new upstream node.
|
||||||
which has <option>recovery_min_apply_delay</option> set, the upstream
|
</para>
|
||||||
standby's replay state may actually be behind that of its new downstream node.
|
|
||||||
</para>
|
<note>
|
||||||
</note>
|
<para>
|
||||||
|
If <option>recovery_min_apply_delay</option> is set for the standby, it
|
||||||
|
will not attach to the new upstream node until it has replayed available
|
||||||
|
WAL.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Conversely, if the standby is attached to an upstream standby
|
||||||
|
which has <option>recovery_min_apply_delay</option> set, the upstream
|
||||||
|
standby's replay state may actually be behind that of its new downstream node.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -124,7 +129,7 @@
|
|||||||
<para>
|
<para>
|
||||||
Note that when using &repmgrd;, <option>--upstream-node-id</option>
|
Note that when using &repmgrd;, <option>--upstream-node-id</option>
|
||||||
should always be configured;
|
should always be configured;
|
||||||
see <link linkend="repmgrd-automatic-failover-configuration">Automatic failover configuration</link>
|
see <link linkend="repmgrd-automatic-failover-configuration">Automatic failover configuration</link>
|
||||||
for details.
|
for details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
<para>
|
<para>
|
||||||
For more complex replication scenarios,e.g. with multiple datacentres, it may
|
For more complex replication scenarios, e.g. with multiple datacentres, it may
|
||||||
be preferable to use location-based failover, which ensures that only nodes
|
be preferable to use location-based failover, which ensures that only nodes
|
||||||
in the same location as the primary will ever be promotion candidates;
|
in the same location as the primary will ever be promotion candidates;
|
||||||
see <xref linkend="repmgrd-network-split"/> for more details.
|
see <xref linkend="repmgrd-network-split"/> for more details.
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ ALTER EXTENSION repmgr UPDATE</programlisting>
|
|||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
Use <command><link linkend="repmgr-node-check">repmgr node check</link></command>
|
Use <command><link linkend="repmgr-node-check">repmgr node check</link></command>
|
||||||
to determine which replacation slots need to be recreated.
|
to determine which replication slots need to be recreated.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
|
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
|||||||
LEFT JOIN repmgr.nodes un
|
LEFT JOIN repmgr.nodes un
|
||||||
ON un.node_id = n.upstream_node_id;
|
ON un.node_id = n.upstream_node_id;
|
||||||
|
|
||||||
|
|
||||||
/* XXX update upgrade scripts! */
|
|
||||||
CREATE TABLE repmgr.voting_term (
|
CREATE TABLE repmgr.voting_term (
|
||||||
term INT NOT NULL
|
term INT NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
|||||||
LEFT JOIN repmgr.nodes un
|
LEFT JOIN repmgr.nodes un
|
||||||
ON un.node_id = n.upstream_node_id;
|
ON un.node_id = n.upstream_node_id;
|
||||||
|
|
||||||
|
|
||||||
/* XXX update upgrade scripts! */
|
|
||||||
CREATE TABLE repmgr.voting_term (
|
CREATE TABLE repmgr.voting_term (
|
||||||
term INT NOT NULL
|
term INT NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
|||||||
LEFT JOIN repmgr.nodes un
|
LEFT JOIN repmgr.nodes un
|
||||||
ON un.node_id = n.upstream_node_id;
|
ON un.node_id = n.upstream_node_id;
|
||||||
|
|
||||||
|
|
||||||
/* XXX update upgrade scripts! */
|
|
||||||
CREATE TABLE repmgr.voting_term (
|
CREATE TABLE repmgr.voting_term (
|
||||||
term INT NOT NULL
|
term INT NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
|||||||
LEFT JOIN repmgr.nodes un
|
LEFT JOIN repmgr.nodes un
|
||||||
ON un.node_id = n.upstream_node_id;
|
ON un.node_id = n.upstream_node_id;
|
||||||
|
|
||||||
|
|
||||||
/* XXX update upgrade scripts! */
|
|
||||||
CREATE TABLE repmgr.voting_term (
|
CREATE TABLE repmgr.voting_term (
|
||||||
term INT NOT NULL
|
term INT NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
|||||||
LEFT JOIN repmgr.nodes un
|
LEFT JOIN repmgr.nodes un
|
||||||
ON un.node_id = n.upstream_node_id;
|
ON un.node_id = n.upstream_node_id;
|
||||||
|
|
||||||
|
|
||||||
/* XXX update upgrade scripts! */
|
|
||||||
CREATE TABLE repmgr.voting_term (
|
CREATE TABLE repmgr.voting_term (
|
||||||
term INT NOT NULL
|
term INT NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ static void get_barman_property(char *dst, char *name, char *local_repmgr_direct
|
|||||||
static int get_tablespace_data_barman(char *, TablespaceDataList *);
|
static int get_tablespace_data_barman(char *, TablespaceDataList *);
|
||||||
static char *make_barman_ssh_command(char *buf);
|
static char *make_barman_ssh_command(char *buf);
|
||||||
|
|
||||||
static bool create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_conninfo, char *dest, bool as_file);
|
static bool create_recovery_file(t_node_info *node_record, t_conninfo_param_list *primary_conninfo, char *dest, bool as_file);
|
||||||
static void write_primary_conninfo(PQExpBufferData *dest, t_conninfo_param_list *param_list);
|
static void write_primary_conninfo(PQExpBufferData *dest, t_conninfo_param_list *param_list);
|
||||||
static bool check_sibling_nodes(NodeInfoList *sibling_nodes, SiblingNodeStats *sibling_nodes_stats);
|
static bool check_sibling_nodes(NodeInfoList *sibling_nodes, SiblingNodeStats *sibling_nodes_stats);
|
||||||
static bool check_free_wal_senders(int available_wal_senders, SiblingNodeStats *sibling_nodes_stats, bool *dry_run_success);
|
static bool check_free_wal_senders(int available_wal_senders, SiblingNodeStats *sibling_nodes_stats, bool *dry_run_success);
|
||||||
@@ -2784,12 +2784,6 @@ do_standby_follow(void)
|
|||||||
|
|
||||||
PQfinish(local_conn);
|
PQfinish(local_conn);
|
||||||
|
|
||||||
if (runtime_options.dry_run == true)
|
|
||||||
{
|
|
||||||
log_info(_("prerequisites for executing STANDBY FOLLOW are met"));
|
|
||||||
exit(SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Here we'll need a connection to the primary, if the upstream is not a primary.
|
* Here we'll need a connection to the primary, if the upstream is not a primary.
|
||||||
*/
|
*/
|
||||||
@@ -2802,12 +2796,30 @@ do_standby_follow(void)
|
|||||||
primary_conn = get_primary_connection_quiet(follow_target_conn,
|
primary_conn = get_primary_connection_quiet(follow_target_conn,
|
||||||
&primary_node_id,
|
&primary_node_id,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If follow target is not primary and no other primary could be found,
|
||||||
|
* abort because we won't be able to update the node record.
|
||||||
|
*/
|
||||||
|
if (PQstatus(primary_conn) != CONNECTION_OK)
|
||||||
|
{
|
||||||
|
log_error(_("unable to determine the cluster primary"));
|
||||||
|
log_detail(_("an active primary node is required for \"repmgr standby follow\""));
|
||||||
|
PQfinish(follow_target_conn);
|
||||||
|
exit(ERR_FOLLOW_FAIL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
primary_conn = follow_target_conn;
|
primary_conn = follow_target_conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (runtime_options.dry_run == true)
|
||||||
|
{
|
||||||
|
log_info(_("prerequisites for executing STANDBY FOLLOW are met"));
|
||||||
|
exit(SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
initPQExpBuffer(&follow_output);
|
initPQExpBuffer(&follow_output);
|
||||||
|
|
||||||
success = do_standby_follow_internal(
|
success = do_standby_follow_internal(
|
||||||
@@ -2991,57 +3003,22 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialise connection parameters to write as `primary_conninfo` */
|
/*
|
||||||
initialize_conninfo_params(&recovery_conninfo, false);
|
* store the original upstream node id so we can delete the
|
||||||
|
* replication slot, if exists
|
||||||
/* We ignore any application_name set in the primary's conninfo */
|
*/
|
||||||
parse_conninfo_string(follow_target_node_record->conninfo, &recovery_conninfo, &errmsg, true);
|
if (local_node_record.upstream_node_id != UNKNOWN_NODE_ID)
|
||||||
|
|
||||||
{
|
{
|
||||||
t_conninfo_param_list local_node_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
original_upstream_node_id = local_node_record.upstream_node_id;
|
||||||
bool parse_success;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
original_upstream_node_id = follow_target_node_record->node_id;
|
||||||
|
}
|
||||||
|
|
||||||
initialize_conninfo_params(&local_node_conninfo, false);
|
if (config_file_options.use_replication_slots && runtime_options.host_param_provided == false && original_upstream_node_id != UNKNOWN_NODE_ID)
|
||||||
|
{
|
||||||
parse_success = parse_conninfo_string(local_node_record.conninfo, &local_node_conninfo, &errmsg, false);
|
remove_old_replication_slot = true;
|
||||||
|
|
||||||
if (parse_success == false)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* this shouldn't happen, but if it does we'll plough on
|
|
||||||
* regardless
|
|
||||||
*/
|
|
||||||
log_warning(_("unable to parse conninfo string \"%s\":\n %s"),
|
|
||||||
local_node_record.conninfo, errmsg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *application_name = param_get(&local_node_conninfo, "application_name");
|
|
||||||
|
|
||||||
if (application_name != NULL && strlen(application_name))
|
|
||||||
param_set(&recovery_conninfo, "application_name", application_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
free_conninfo_params(&local_node_conninfo);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* store the original upstream node id so we can delete the
|
|
||||||
* replication slot, if exists
|
|
||||||
*/
|
|
||||||
if (local_node_record.upstream_node_id != UNKNOWN_NODE_ID)
|
|
||||||
{
|
|
||||||
original_upstream_node_id = local_node_record.upstream_node_id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
original_upstream_node_id = follow_target_node_record->node_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (config_file_options.use_replication_slots && runtime_options.host_param_provided == false && original_upstream_node_id != UNKNOWN_NODE_ID)
|
|
||||||
{
|
|
||||||
remove_old_replication_slot = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fetch original upstream's record */
|
/* Fetch original upstream's record */
|
||||||
@@ -3066,6 +3043,12 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Initialise connection parameters to write as "primary_conninfo" */
|
||||||
|
initialize_conninfo_params(&recovery_conninfo, false);
|
||||||
|
|
||||||
|
/* We ignore any application_name set in the primary's conninfo */
|
||||||
|
parse_conninfo_string(follow_target_node_record->conninfo, &recovery_conninfo, &errmsg, true);
|
||||||
|
|
||||||
/* Set the application name to this node's name */
|
/* Set the application name to this node's name */
|
||||||
param_set(&recovery_conninfo, "application_name", config_file_options.node_name);
|
param_set(&recovery_conninfo, "application_name", config_file_options.node_name);
|
||||||
|
|
||||||
@@ -6942,11 +6925,11 @@ check_recovery_type(PGconn *conn)
|
|||||||
* Creates a recovery.conf file for a standby
|
* Creates a recovery.conf file for a standby
|
||||||
*
|
*
|
||||||
* A database connection pointer is required for escaping primary_conninfo
|
* A database connection pointer is required for escaping primary_conninfo
|
||||||
* parameters. When cloning from Barman and --no-upstream-connection ) this
|
* parameters. When cloning from Barman and --no-upstream-connection supplied,
|
||||||
* might not be available.
|
* this might not be available.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_conninfo, char *dest, bool as_file)
|
create_recovery_file(t_node_info *node_record, t_conninfo_param_list *primary_conninfo, char *dest, bool as_file)
|
||||||
{
|
{
|
||||||
PQExpBufferData recovery_file_buf;
|
PQExpBufferData recovery_file_buf;
|
||||||
char recovery_file_path[MAXPGPATH] = "";
|
char recovery_file_path[MAXPGPATH] = "";
|
||||||
@@ -6961,29 +6944,7 @@ create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_c
|
|||||||
"standby_mode = 'on'\n");
|
"standby_mode = 'on'\n");
|
||||||
|
|
||||||
/* primary_conninfo = '...' */
|
/* primary_conninfo = '...' */
|
||||||
|
write_primary_conninfo(&recovery_file_buf, primary_conninfo);
|
||||||
/*
|
|
||||||
* the user specified --upstream-conninfo string - copy that
|
|
||||||
*/
|
|
||||||
if (strlen(runtime_options.upstream_conninfo))
|
|
||||||
{
|
|
||||||
char *escaped = escape_recovery_conf_value(runtime_options.upstream_conninfo);
|
|
||||||
|
|
||||||
appendPQExpBuffer(&recovery_file_buf,
|
|
||||||
"primary_conninfo = '%s'\n",
|
|
||||||
escaped);
|
|
||||||
|
|
||||||
free(escaped);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* otherwise use the conninfo inferred from the upstream connection and/or
|
|
||||||
* node record
|
|
||||||
*/
|
|
||||||
else
|
|
||||||
{
|
|
||||||
write_primary_conninfo(&recovery_file_buf, recovery_conninfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* recovery_target_timeline = 'latest' */
|
/* recovery_target_timeline = 'latest' */
|
||||||
appendPQExpBufferStr(&recovery_file_buf,
|
appendPQExpBufferStr(&recovery_file_buf,
|
||||||
|
|||||||
@@ -51,7 +51,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# Optional configuration items
|
# Optional configuration items
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
@@ -68,16 +67,16 @@
|
|||||||
# Replication settings
|
# Replication settings
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#replication_user='repmgr' # User to make replication connections with, if not set defaults
|
#replication_user='repmgr' # User to make replication connections with, if not set
|
||||||
# to the user defined in "conninfo".
|
# defaults to the user defined in "conninfo".
|
||||||
|
|
||||||
#replication_type=physical # Must be one of 'physical' or 'bdr'.
|
#replication_type=physical # Must be one of "physical" or "bdr".
|
||||||
# NOTE: "bdr" can only be used with BDR 2.x
|
# NOTE: "bdr" can only be used with BDR 2.x
|
||||||
|
|
||||||
#location=default # arbitrary string defining the location of the node; this
|
#location=default # An arbitrary string defining the location of the node; this
|
||||||
# is used during failover to check visibilty of the
|
# is used during failover to check visibility of the
|
||||||
# current primary node. See the 'repmgrd' documentation
|
# current primary node. For further details see:
|
||||||
# in README.md for further details.
|
# https://repmgr.org/docs/current/repmgrd-network-split.html
|
||||||
|
|
||||||
#use_replication_slots=no # whether to use physical replication slots
|
#use_replication_slots=no # whether to use physical replication slots
|
||||||
# NOTE: when using replication slots,
|
# NOTE: when using replication slots,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#define REPMGR_VERSION_DATE ""
|
#define REPMGR_VERSION_DATE ""
|
||||||
#define REPMGR_VERSION "4.4dev"
|
#define REPMGR_VERSION "4.4"
|
||||||
#define REPMGR_VERSION_NUM 40400
|
#define REPMGR_VERSION_NUM 40400
|
||||||
|
|||||||
Reference in New Issue
Block a user