1<refentry id="repmgr-witness-unregister" xreflabel="repmgr witness unregister">
2  <indexterm>
3    <primary>repmgr witness unregister</primary>
4  </indexterm>
5
6  <refmeta>
7    <refentrytitle>repmgr witness unregister</refentrytitle>
8  </refmeta>
9
10  <refnamediv>
11    <refname>repmgr witness unregister</refname>
12    <refpurpose>remove a witness node's information to the &repmgr; metadata</refpurpose>
13  </refnamediv>
14
15  <refsect1>
16    <title>Description</title>
17    <para>
18      <command>repmgr witness unregister</command> removes a witness server's node
19      record from the &repmgr; metadata.
20    </para>
21    <para>
22      The node does not have to be running to be unregistered, however if this is the
23      case then either provide connection information for the primary server, or
24	  execute <command>repmgr witness unregister</command> on a running node and
25	  provide the parameter <option>--node-id</option> with the node ID of the
26	  witness server.
27    </para>
28    <para>
29      Execute with the <literal>--dry-run</literal> option to check what would happen
30      without actually registering the witness server.
31    </para>
32  </refsect1>
33  <refsect1>
34    <title>Examples</title>
35    <para>
36      Unregistering a running witness node:
37      <programlisting>
38    $ repmgr -f /etc/repmgr.conf witness unregister
39    INFO: connecting to witness node "node3" (ID: 3)
40    INFO: unregistering witness node 3
41    INFO: witness unregistration complete
42    DETAIL: witness node with UD 3 successfully unregistered</programlisting>
43    </para>
44    <para>
45      Unregistering a non-running witness node:
46      <programlisting>
47        $ repmgr -f /etc/repmgr.conf witness unregister -h node1 -p 5501  -F
48        INFO: connecting to node "node3" (ID: 3)
49        NOTICE: unable to connect to node "node3" (ID: 3), removing node record on cluster primary only
50        INFO: unregistering witness node 3
51        INFO: witness unregistration complete
52        DETAIL: witness node with id ID 3 successfully unregistered</programlisting>
53    </para>
54  </refsect1>
55
56  <refsect1>
57    <title>Notes</title>
58    <para>
59      This command will not make any changes to the witness node itself and will neither
60      remove any data from the witness database nor stop the PostgreSQL instance.
61    </para>
62    <para>
63      A witness node which has been unregistered, can be re-registered with
64      <link linkend="repmgr-witness-register">repmgr witness register --force</link>.
65    </para>
66  </refsect1>
67
68  <refsect1>
69
70    <title>Options</title>
71    <variablelist>
72
73      <varlistentry>
74        <term><option>--dry-run</option></term>
75        <listitem>
76          <para>
77            Check prerequisites but don't actually unregister the witness.
78          </para>
79        </listitem>
80      </varlistentry>
81
82      <varlistentry>
83       <term><option>--node-id</option></term>
84        <listitem>
85          <para>
86            Unregister witness server with the specified node ID.
87          </para>
88        </listitem>
89      </varlistentry>
90
91    </variablelist>
92  </refsect1>
93
94
95  <refsect1 id="repmgr-witness-unregister-events">
96    <title>Event notifications</title>
97    <para>
98      A <literal>witness_unregister</literal> <link linkend="event-notifications">event notification</link> will be generated.
99    </para>
100  </refsect1>
101
102</refentry>
103