repmgr node servicerepmgr node servicerepmgr node serviceshow or execute the system service command to stop/start/restart/reload/promote a nodeDescription
Shows or executes the system service command to stop/start/restart/reload a node.
This command is mainly meant for internal &repmgr; usage, but is useful for
confirming the command configuration.
Options
Log the steps which would be taken, including displaying the command which would be executed.
The action to perform. One of start, stop,
restart, reload or promote.
If the parameter is provided together with
, the command which would be executed will be printed.
List all configured commands.
If the parameter is provided together with
, the command which would be executed for that
particular action will be printed.
Issue a CHECKPOINT before stopping or restarting the node.
Exit codes
One of the following exit codes will be emitted by repmgr node service:
No issues were detected.
Execution of the system service command failed.
Examples
See what action would be taken for a restart:
[postgres@node1 ~]$ repmgr -f /etc/repmgr/11/repmgr.conf node service --action=restart --checkpoint --dry-run
INFO: a CHECKPOINT would be issued here
INFO: would execute server command "sudo service postgresql-11 restart"
Restart the PostgreSQL instance:
[postgres@node1 ~]$ repmgr -f /etc/repmgr/11/repmgr.conf node service --action=restart --checkpoint
NOTICE: issuing CHECKPOINT
DETAIL: executing server command "sudo service postgresql-11 restart"
Redirecting to /bin/systemctl restart postgresql-11.service
List all commands:
[postgres@node1 ~]$ repmgr -f /etc/repmgr/11/repmgr.conf node service --list-actions
Following commands would be executed for each action:
start: "sudo service postgresql-11 start"
stop: "sudo service postgresql-11 stop"
restart: "sudo service postgresql-11 restart"
reload: "sudo service postgresql-11 reload"
promote: "/usr/pgsql-11/bin/pg_ctl -w -D '/var/lib/pgsql/11/data' promote"
List a single command:
[postgres@node1 ~]$ repmgr -f /etc/repmgr/11/repmgr.conf node service --list-actions --action=promote
/usr/pgsql-11/bin/pg_ctl -w -D '/var/lib/pgsql/11/data' promote