repmgr 4.3 Documentation | |||
---|---|---|---|
Prev | Up | Chapter 3. Quick-start guide | Next |
Create a repmgr.conf file on the primary server. The file must contain at least the following parameters:
node_id=1 node_name=node1 conninfo='host=node1 user=repmgr dbname=repmgr connect_timeout=2' data_directory='/var/lib/postgresql/data'
repmgr.conf should not be stored inside the PostgreSQL data directory, as it could be overwritten when setting up or reinitialising the PostgreSQL server. See sections Configuration and configuration file for further details about repmgr.conf.
Note: repmgr only uses pg_bindir when it executes PostgreSQL binaries directly.
For user-defined scripts such as promote_command and the various service_*_commands, you must always explicitly provide the full path to the binary or script being executed, even if it is repmgr itself.
This is because these options can contain user-defined scripts in arbitrary locations, so prepending pg_bindir may break them.
Tip: For Debian-based distributions we recommend explictly setting pg_bindir to the directory where pg_ctl and other binaries not in the standard path are located. For PostgreSQL 9.6 this would be /usr/lib/postgresql/9.6/bin/.
Tip: If your distribution places the repmgr binaries in a location other than the PostgreSQL installation directory, specify this with repmgr_bindir to enable repmgr to perform operations (e.g. repmgr cluster crosscheck) on other nodes.
See the file repmgr.conf.sample for details of all available configuration parameters.