docs: improve documentation of pg_basebackup_options

This commit is contained in:
Ian Barwick
2017-11-15 20:50:13 +09:00
parent 9124e0f0a2
commit 2ad174489c
2 changed files with 27 additions and 5 deletions

View File

@@ -142,7 +142,7 @@
<title>I've provided replication permission for the <literal>repmgr</literal> user in <filename>pg_hba.conf</filename> <title>I've provided replication permission for the <literal>repmgr</literal> user in <filename>pg_hba.conf</filename>
but <command>repmgr</command>/<application>repmgrd</application> complains it can't connect to the server... Why?</title> but <command>repmgr</command>/<application>repmgrd</application> complains it can't connect to the server... Why?</title>
<para> <para>
<command>repmgr</command> and<application>repmgrd</application> need to be able to connect to the repmgr database <command>repmgr</command> and <application>repmgrd</application> need to be able to connect to the repmgr database
with a normal connection to query metadata. The <literal>replication</literal> connection with a normal connection to query metadata. The <literal>replication</literal> connection
permission is for PostgreSQL's streaming replication (and doesn't necessarily need to be the <literal>repmgr</literal> user). permission is for PostgreSQL's streaming replication (and doesn't necessarily need to be the <literal>repmgr</literal> user).
</para> </para>
@@ -155,8 +155,17 @@
Cloning a standby is a one-time action; the role of the server being cloned Cloning a standby is a one-time action; the role of the server being cloned
from could change, so fixing it in the configuration file would create from could change, so fixing it in the configuration file would create
confusion. If &repmgr; needs to establish a connection to the primary confusion. If &repmgr; needs to establish a connection to the primary
server, it can retrieve this from the <literal>repmgr.nodes</literal> table or if necessary server, it can retrieve this from the <literal>repmgr.nodes</literal> table on the local
scan the replication cluster until it locates the active primary. node, and if necessary scan the replication cluster until it locates the active primary.
</para>
</sect2>
<sect2 id="faq-repmgr-clone-waldir-xlogdir" xreflabel="Providing a custom WAL directory">
<title>When cloning a standby, how do I ensure the WAL files are placed in a custom directory?</title>
<para>
Provide the option <literal>--waldir</literal> (<literal>--xlogdir</literal> in PostgreSQL 9.6
and earlier) with the absolute path to the WAL directory in <varname>pg_basebackup_options</varname>.
For more details see <xref linkend="cloning-advanced-pg-basebackup-options">.
</para> </para>
</sect2> </sect2>

View File

@@ -347,6 +347,11 @@
<sect2 id="cloning-advanced-pg-basebackup-options" xreflabel="pg_basebackup options when cloning a standby"> <sect2 id="cloning-advanced-pg-basebackup-options" xreflabel="pg_basebackup options when cloning a standby">
<title>pg_basebackup options when cloning a standby</title> <title>pg_basebackup options when cloning a standby</title>
<para>
As &repmgr; uses <command>pg_basebackup</command> to clone a standby, it's possible to
provide additional parameters for <command>pg_basebackup</command> to customise the
cloning process.
</para>
<para> <para>
By default, <command>pg_basebackup</command> performs a checkpoint before beginning the backup By default, <command>pg_basebackup</command> performs a checkpoint before beginning the backup
process. However, a normal checkpoint may take some time to complete; process. However, a normal checkpoint may take some time to complete;
@@ -362,8 +367,16 @@
</simpara> </simpara>
</tip> </tip>
<para> <para>
Further options can be passed to the <command>pg_basebackup</command> utility via Other options can be passed to <command>pg_basebackup</command> by including them
the setting <varname>pg_basebackup_options</varname> in <filename>repmgr.conf</filename>. in the <filename>repmgr.conf</filename> setting <varname>pg_basebackup_options</varname>.
</para>
<para>
If using a separate directory to store WAL files, provide the option <literal>--waldir</literal>
(<literal>--xlogdir</literal> in PostgreSQL 9.6 and earlier) with the absolute path to the
WAL directory. Any WALs generated during the cloning process will be copied here, and
a symlink will automatically be created from the main data directory.
</para>
<para>
See the <ulink url="https://www.postgresql.org/docs/current/static/app-pgbasebackup.html">PostgreSQL pg_basebackup documentation</ulink> See the <ulink url="https://www.postgresql.org/docs/current/static/app-pgbasebackup.html">PostgreSQL pg_basebackup documentation</ulink>
for more details of available options. for more details of available options.
</para> </para>