Improve "witness register" documentation, help and logging

Make it clearer that a) the primary server's hostname is required,
and b) how to provide it.

Based on feedback provided in GitHub #529.
This commit is contained in:
Ian Barwick
2019-01-17 10:42:53 +09:00
parent 8e0088d51e
commit a965bc005f
3 changed files with 17 additions and 10 deletions

View File

@@ -23,14 +23,19 @@
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.
When executing <command>repmgr witness register</command>, database connection
information for the cluster primary server must also be provided.
</para>
<para>
Execute with the <literal>--dry-run</literal> option to check what would happen
In most cases it's only necessary to provide the primary's hostname with
the <option>-h</option>/<option>--hostname</option> option; &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>, unless these are explicitly
provided as command line options.
</para>
<para>
Execute with the <option>--dry-run</option> option to check what would happen
without actually registering the witness server.
</para>
</refsect1>

View File

@@ -484,13 +484,15 @@ void do_witness_help(void)
printf(_("Usage:\n"));
printf(_(" %s [OPTIONS] witness register\n"), progname());
printf(_(" %s [OPTIONS] witness unregister\n"), progname());
puts("");
printf(_("WITNESS REGISTER\n"));
puts("");
printf(_(" \"witness register\" registers a witness node.\n"));
puts("");
printf(_(" Requires provision of connection information for the primary\n"));
printf(_(" Requires provision of connection information for the primary node,\n"));
printf(_(" typically usually just the hostname.\n"));
puts("");
printf(_(" -h/--hostname hostname of the primary node\n"));
printf(_(" --dry-run check prerequisites but don't make any changes\n"));
printf(_(" -F, --force overwrite an existing node record\n"));
puts("");

View File

@@ -1399,7 +1399,7 @@ check_cli_parameters(const int action)
if (!runtime_options.host_param_provided)
{
item_list_append_format(&cli_errors,
_("host name for the source node must be provided when executing %s"),
_("host name for the source node must be provided with -h/--hostname when executing %s"),
action_name(action));
}
@@ -1456,7 +1456,7 @@ check_cli_parameters(const int action)
if (!runtime_options.host_param_provided)
{
item_list_append_format(&cli_errors,
_("host name for the source node must be provided when executing %s"),
_("host name for the source node must be provided with -h/--hostname when executing %s"),
action_name(action));
}
}