Contact Info

Folow us on social

Working With Repmgr: Using Other 3rd Party Tools for Setting up a Standby

  • Michael Vitale
  • 4th May 2020
  • Database, pgbackrest, postgres, postgresql, repmgr

From the docs: repmgr is an open-source tool suite for managing replication and failover in a cluster of PostgreSQL servers.”

For a standby node to be used in a repmgr configuration, it has to be registered.  Normally you do this by allowing repmgr to clone the standby first.  If a node was not cloned by repmgr, you can nonetheless register it using the -F/–force option.  This is useful for cases where you want to use another tool (like pgbackrest) to backup and restore your clusters.

repmgr uses pg_basebackup by default and has configuration parameters for Barman, but nothing for other 3rd party tools.  This example uses repmgr 5.1 and PostgreSQL 12.2 and assumes we have an active PG cluster using streaming replication where the standby node was initially restored by pgbackrest. From the standby execute the following 2 commands:

repmgr standby register --force -d 'host=mystandby port=5432 user=repmgr password=mypassword'
repmgr -f /etc/repmgr/12/repmgr.conf standby follow

Validate that the standby is a part of the repmgr cluster:

repmgr -f /etc/repmgr/12/repmgr.conf node check
repmgr cluster show


Michael Vitale, Team Elephas

Join the conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *