/etc/repmgr.conf
# more /etc/repmgr.conf############################################### node informationnode_id=1node_name=node1conninfo='host=192.168.56.101 user=repmgr dbname=repmgr connect_timeout=2'data_directory='/var/lib/postgresql/9.6/main'use_replication_slots=truepg_bindir='/usr/lib/postgresql/9.6/bin'pg_ctl_options='-l /var/log/postgres/startup.log'rsync_options=--exclude=postgresql.local.conf --archive#use_primary_conninfo_password=true#passfile=''location='location01'############################################### service_*_commandservice_start_command = 'sudo pg_ctlcluster 9.6 main start'service_stop_command = 'sudo pg_ctlcluster 9.6 main stop'service_restart_command = 'sudo pg_ctlcluster 9.6 main restart'service_reload_command = 'sudo pg_ctlcluster 9.6 main reload' service_promote_command = 'sudo pg_ctlcluster 9.6 main promote'############################################### log infolog_level=INFOlog_status_interval=10log_file=/var/log/postgresql/repmgrd.log############################################### monitoringmonitoring_history=yesmonitor_interval_secs=2reconnect_attempts=10reconnect_interval=5async_query_timeout=600############################################### failoverfailover=automaticpromote_command='/usr/bin/repmgr standby promote -f /etc/repmgr.conf --log-to-file'follow_command='/usr/bin/repmgr standby follow -f /etc/repmgr.conf --log-to-file --upstream-node-id=%n'
/etc/logrotate.d/repmgrd
/var/log/repmgr/repmgrd.log { missingok compress rotate 52 maxsize 100M weekly create 0600 postgres postgres postrotate /usr/bin/killall -HUP repmgrd endscript }
参考: