Repmgr configuration for PostgreSQL_9.5 on Linux 7.x DD

This document describes how to configure Repmgr with Postgres 9.5 on Linux 7.x..

  • Repmgrd try connection to check liveliness of Master server. If it detects that master is notresponding then waits for reconnect_interval(seconds) and reconnect_attempts before failover. These parameters are available in /etc/repmgr.conf, any change in this file requires repmgrd restart to reflect the changes.
  • Once failover decission taken, it check all nodes for most up-to-date Slave on the basis of WAL (Write Ahead Log). After deciding the best candidate for promotion to Master repmgrd sleep for 5 seconds to close all local connections.
  • First time when witness server get registered with Master, it copies all replication related data from master.
  • During reboot we have observed that in case server comes up quickly, it lead to 2 master for 1 to 2 seconds which can lead to data loss. To avoid this issue we introduced timer for start of Postgres and repmgr processes. It waits for 1 minutes after reboot and then start postgres and repmgr services.
  • In case of any issue with DB startup or replication between Master-Slave below logs can checked:




  • For Network isolation (MGMT and Signaling) we can change configuration parameter in pg_hba.conf to allow/restrict a subnet or any specific IP. It requires DB restart after change in this file to reflect the new configuration changes.


# To allow all network:

host all all trust

# To allow selected network (it will allow connection from 127.0.0.xx IPs only):

host all all trust

Like what you read? Give Sudhakar Pandey a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.