docs: add command reference for "witness (un)register"

This commit is contained in:
Ian Barwick
2017-11-13 22:16:26 +09:00
parent efe28cbbeb
commit f61f7f82eb
2 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<refentry id="repmgr-witness-register" xreflabel="repmgr witness register">
<indexterm>
<primary>repmgr witness register</primary>
</indexterm>
<refmeta>
<refentrytitle>repmgr witness register</refentrytitle>
</refmeta>
<refnamediv>
<refname>repmgr witness register</refname>
<refpurpose>add a witness node's information to the &repmgr; metadata</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>
<command>repmgr witness register</command> adds a witness server's node
record to the &repmgr; metadata, and if necessary initialises the witness
node by installing the &repmgr; extension and copying the &repmgr; metadata
to the witness server. This command needs to be executed to enable
use of the witness server with <application>repmgrd</application>.
</para>
<para>
When executing <command>repmgr witness register</command>, connection information
for the cluster primary server must also be provided. &repmgr; will automatically
use the <varname>user</varname> and <varname>dbname</varname> values defined
in the <varname>conninfo</varname> string defined in the witness node's
<filename>repmgr.conf</filename>, if these are not explicitly provided.
</para>
<para>
Execute with the <literal>--dry-run</literal> option to check what would happen
without actually registering the witness server.
</para>
</refsect1>
<refsect1>
<title>Example</title>
<para>
<programlisting>
$ repmgr -f /etc/repmgr.conf witness register -h node1
INFO: connecting to witness node "node3" (ID: 3)
INFO: connecting to primary node
NOTICE: attempting to install extension "repmgr"
NOTICE: "repmgr" extension successfully installed
INFO: witness registration complete
NOTICE: witness node "node3" (ID: 3) successfully registered
</programlisting>
</para>
</refsect1>
</refentry>

View File

@@ -0,0 +1,64 @@
<refentry id="repmgr-witness-unregister" xreflabel="repmgr witness unregister">
<indexterm>
<primary>repmgr witness unregister</primary>
</indexterm>
<refmeta>
<refentrytitle>repmgr witness unregister</refentrytitle>
</refmeta>
<refnamediv>
<refname>repmgr witness unregister</refname>
<refpurpose>remove a witness node's information to the &repmgr; metadata</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>
<command>repmgr witness unregister</command> removes a witness server's node
record from the &repmgr; metadata.
</para>
<para>
The node does not have to be running to be unregistered, however if this is the
case then connection information for the primary server must be provided.
</para>
<para>
Execute with the <literal>--dry-run</literal> option to check what would happen
without actually registering the witness server.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
Unregistering a running witness node:
<programlisting>
$ ./repmgr -f /space/sda1/ibarwick/repmgr-test/node_3/repmgr.conf witness unregister
INFO: connecting to witness node "node3" (ID: 3)
INFO: unregistering witness node 3
INFO: witness unregistration complete
DETAIL: witness node with id 3 (conninfo: host=node3 dbname=repmgr user=repmgr port=5499) successfully unregistered</programlisting>
</para>
<para>
Unregistering a non-running witness node:
<programlisting>
$ ./repmgr -f /space/sda1/ibarwick/repmgr-test/node_3/repmgr.conf witness unregister -h localhost -p 5501 -F
INFO: connecting to witness node "node3" (ID: 3)
NOTICE: unable to connect to witness node "node3" (ID: 3), removing node record on cluster primary only
INFO: unregistering witness node 3
INFO: witness unregistration complete
DETAIL: witness node with id 3 (conninfo: host=node3 dbname=repmgr user=repmgr port=5499) successfully unregistered</programlisting>
</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
This command will not make any changes to the witness node itself and will neither
remove any data from the witness database nor stop the PostgreSQL instance.
</para>
<para>
A witness node which has been unregistered, can be re-registered with
<link linkend="repmgr-witness-register">repmgr witness register --force</link>.
</para>
</refsect1>
</refentry>