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 location for further details about repmgr.conf.
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/.
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.
See the file repmgr.conf.sample for details of all available configuration parameters.