mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
Update "repmgr primary ..." --help output and command reference
This commit is contained in:
21
README.md
21
README.md
@@ -773,10 +773,21 @@ The following commands are available:
|
|||||||
* `primary register`
|
* `primary register`
|
||||||
|
|
||||||
Registers a primary in a streaming replication cluster, and configures
|
Registers a primary in a streaming replication cluster, and configures
|
||||||
it for use with repmgr. This command needs to be executed before any
|
it for use with repmgr, including installing the `repmgr` extension.
|
||||||
standby nodes are registered.
|
This command needs to be executed before any standby nodes are registered.
|
||||||
|
Execute with the `--dry-run` option to check what would happen without
|
||||||
|
actually registering the primary.
|
||||||
|
|
||||||
`primary register` can be used as an alias for `primary register`.
|
`master register` can be used as an alias for `primary register`.
|
||||||
|
|
||||||
|
* `primary unregister`
|
||||||
|
|
||||||
|
Unregisters an inactive primary node from the `repmgr` metadata. This is
|
||||||
|
typically when the primary has failed and is being removed from the cluster
|
||||||
|
after a new primary has been promoted. Execute with the `--dry-run` option
|
||||||
|
to check what would happen without actually unregistering the node.
|
||||||
|
|
||||||
|
`master unregister` can be used as an alias for `primary unregister`.
|
||||||
|
|
||||||
* `standby switchover`
|
* `standby switchover`
|
||||||
|
|
||||||
@@ -784,9 +795,7 @@ The following commands are available:
|
|||||||
|
|
||||||
If other standbys (siblings of the promotion candidate) are connected
|
If other standbys (siblings of the promotion candidate) are connected
|
||||||
to the demotion candidate, if `--siblings-follow` is specified `repmgr`
|
to the demotion candidate, if `--siblings-follow` is specified `repmgr`
|
||||||
can instruct these to follow the new primary. Note this can only work
|
can instruct these to follow the new primary. .
|
||||||
if the configuration file on each sibling is the same path as specifed
|
|
||||||
in -f/--config-file or -C/--remote-config-file.
|
|
||||||
|
|
||||||
* `node status`
|
* `node status`
|
||||||
|
|
||||||
|
|||||||
@@ -355,10 +355,9 @@ do_primary_unregister(void)
|
|||||||
if (recovery_type == RECTYPE_STANDBY)
|
if (recovery_type == RECTYPE_STANDBY)
|
||||||
{
|
{
|
||||||
/* We'll refuse to do anything unless the node record shows it as a primary */
|
/* We'll refuse to do anything unless the node record shows it as a primary */
|
||||||
|
|
||||||
if (target_node_info_ptr->type != PRIMARY)
|
if (target_node_info_ptr->type != PRIMARY)
|
||||||
{
|
{
|
||||||
log_error(_("node %s (id: %i) is a %s, unable to unregister"),
|
log_error(_("node %s (ID: %i) is a %s, unable to unregister"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id,
|
target_node_info_ptr->node_id,
|
||||||
get_node_type_string(target_node_info_ptr->type));
|
get_node_type_string(target_node_info_ptr->type));
|
||||||
@@ -370,7 +369,7 @@ do_primary_unregister(void)
|
|||||||
*/
|
*/
|
||||||
else if (!runtime_options.force)
|
else if (!runtime_options.force)
|
||||||
{
|
{
|
||||||
log_error(_("node %s (id: %i) is running as a standby, unable to unregister"),
|
log_error(_("node %s (ID: %i) is running as a standby, unable to unregister"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
log_hint(_("the node can be registered as a standby with \"repmgr standby register --force\""));
|
log_hint(_("the node can be registered as a standby with \"repmgr standby register --force\""));
|
||||||
@@ -395,7 +394,7 @@ do_primary_unregister(void)
|
|||||||
|
|
||||||
if (primary_record_found == false)
|
if (primary_record_found == false)
|
||||||
{
|
{
|
||||||
log_error(_("node %s (id: %i) is a primary node, but no primary node record found"),
|
log_error(_("node %s (ID: %i) is a primary node, but no primary node record found"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
log_hint(_("register this node as primary with \"repmgr primary register --force\""));
|
log_hint(_("register this node as primary with \"repmgr primary register --force\""));
|
||||||
@@ -408,7 +407,7 @@ do_primary_unregister(void)
|
|||||||
*/
|
*/
|
||||||
if (primary_node_info.node_id == target_node_info_ptr->node_id)
|
if (primary_node_info.node_id == target_node_info_ptr->node_id)
|
||||||
{
|
{
|
||||||
log_error(_("node %s (id: %i) is the current primary node, unable to unregister"),
|
log_error(_("node %s (ID: %i) is the current primary node, unable to unregister"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
|
|
||||||
@@ -430,7 +429,7 @@ do_primary_unregister(void)
|
|||||||
{
|
{
|
||||||
if (!runtime_options.force)
|
if (!runtime_options.force)
|
||||||
{
|
{
|
||||||
log_error(_("node %s (id: %i) is marked as active, unable to unregister"),
|
log_error(_("node %s (ID: %i) is marked as active, unable to unregister"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
log_hint(_("run \"repmgr primary unregister --force\" to unregister this node"));
|
log_hint(_("run \"repmgr primary unregister --force\" to unregister this node"));
|
||||||
@@ -441,7 +440,7 @@ do_primary_unregister(void)
|
|||||||
|
|
||||||
if (runtime_options.dry_run == true)
|
if (runtime_options.dry_run == true)
|
||||||
{
|
{
|
||||||
log_notice(_("node %s (id: %i) would now be unregistered"),
|
log_notice(_("node %s (ID: %i) would now be unregistered"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
log_hint(_("run the same command without the --dry-run option to unregister this node"));
|
log_hint(_("run the same command without the --dry-run option to unregister this node"));
|
||||||
@@ -454,7 +453,7 @@ do_primary_unregister(void)
|
|||||||
|
|
||||||
if (delete_success == false)
|
if (delete_success == false)
|
||||||
{
|
{
|
||||||
log_error(_("unable to unregister node %s (id: %i)"),
|
log_error(_("unable to unregister node %s (ID: %i)"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
PQfinish(primary_conn);
|
PQfinish(primary_conn);
|
||||||
@@ -463,14 +462,14 @@ do_primary_unregister(void)
|
|||||||
|
|
||||||
initPQExpBuffer(&event_details);
|
initPQExpBuffer(&event_details);
|
||||||
appendPQExpBuffer(&event_details,
|
appendPQExpBuffer(&event_details,
|
||||||
_("node %s (id: %i) unregistered"),
|
_("node %s (ID: %i) unregistered"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
|
|
||||||
if (target_node_info_ptr->node_id != config_file_options.node_id)
|
if (target_node_info_ptr->node_id != config_file_options.node_id)
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(&event_details,
|
appendPQExpBuffer(&event_details,
|
||||||
_(" from node %s (id: %i)"),
|
_(" from node %s (ID: %i)"),
|
||||||
config_file_options.node_name,
|
config_file_options.node_name,
|
||||||
config_file_options.node_id);
|
config_file_options.node_id);
|
||||||
}
|
}
|
||||||
@@ -483,7 +482,7 @@ do_primary_unregister(void)
|
|||||||
event_details.data);
|
event_details.data);
|
||||||
termPQExpBuffer(&event_details);
|
termPQExpBuffer(&event_details);
|
||||||
|
|
||||||
log_info(_("node %s (id: %i) was successfully unregistered"),
|
log_info(_("node %s (ID: %i) was successfully unregistered"),
|
||||||
target_node_info_ptr->node_name,
|
target_node_info_ptr->node_name,
|
||||||
target_node_info_ptr->node_id);
|
target_node_info_ptr->node_id);
|
||||||
}
|
}
|
||||||
@@ -503,17 +502,25 @@ do_primary_help(void)
|
|||||||
printf(_(" %s [OPTIONS] primary register\n"), progname());
|
printf(_(" %s [OPTIONS] primary register\n"), progname());
|
||||||
printf(_(" %s [OPTIONS] primary unregister\n"), progname());
|
printf(_(" %s [OPTIONS] primary unregister\n"), progname());
|
||||||
puts("");
|
puts("");
|
||||||
printf(_(" Note: \"%s repmgr master ...\" can be used as an alias\n"), progname());
|
printf(_(" Note: \"%s master ...\" can be used as an alias\n"), progname());
|
||||||
puts("");
|
puts("");
|
||||||
|
|
||||||
printf(_("PRIMARY REGISTER\n"));
|
printf(_("PRIMARY REGISTER\n"));
|
||||||
puts("");
|
puts("");
|
||||||
printf(_(" \"primary register\" initialises the repmgr cluster and registers the primary node.\n"));
|
printf(_(" \"primary register\" initialises the repmgr cluster and registers the primary node.\n"));
|
||||||
puts("");
|
puts("");
|
||||||
|
printf(_(" --dry-run check that the prerequisites are met for registering the primary\n" \
|
||||||
|
" (including availablity of the repmgr extension)\n"));
|
||||||
|
printf(_(" -F, --force overwrite an existing node record\n"));
|
||||||
|
puts("");
|
||||||
|
|
||||||
printf(_("PRIMARY UNREGISTER\n"));
|
printf(_("PRIMARY UNREGISTER\n"));
|
||||||
puts("");
|
puts("");
|
||||||
printf(_(" \"primary unregister\" unregisters an inactive primary node.\n"));
|
printf(_(" \"primary unregister\" unregisters an inactive primary node.\n"));
|
||||||
puts("");
|
puts("");
|
||||||
|
printf(_(" --dry-run check what would happen, but don't actually unregister the primary\n"));
|
||||||
|
printf(_(" -F, --force force removal of the record\n"));
|
||||||
|
|
||||||
|
puts("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user