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.
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 --list-actions is provided together with --action, the command which would be executed will be printed.
List all configured commands.
If the parameter --action is provided together with --list-actions, the command which would be executed for that particular action will be printed.
Issue a CHECKPOINT before stopping or restarting the node.
Following exit codes can be emitted by repmgr node service:
No issues were detected.
Execution of the system service command failed.
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