The repmgr utility provides a set of single command-line actions that perform all the required activities on one node:
- To start a new cluster with repmgr with the current node as its primary, use the following command:
repmgr primary register
- To add an existing standby to the cluster with repmgr, use the following command:
repmgr standby register
- Use the following command to request repmgr to create a new standby for you by copying node1. This will fail if you specify an existing data directory:
repmgr standby clone node1 -D /path/of_new_data_directory
- To reuse an old master as a standby, use the rejoin command:
repmgr node rejoin -d ‘host=node2 user=repmgr’
-
To switch from one primary to another one, run this command ...