repmgr
repmgr : Replication manager for PostgreSQL
Overview
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | Yes | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | repmgr |
| See Also | pg_failover_slots bgw_replstatus pgautofailover pgpool_adm pglogical pgactive pglogical_ticker |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 |
| el8.aarch64 | N/A | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 |
| el9.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 |
| el9.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 |
| el10.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 |
| el10.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 | PGDG 5.5.1 |
| d12.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| d12.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| d13.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| d13.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| u22.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| u22.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| u24.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| u24.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| u26.x86_64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
| u26.aarch64 | PIGSTY 5.5.1 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 | PGDG 5.5.0 |
Source
github.com/EnterpriseDB/repmgr
repmgr-5.5.1.tar.gz
Install
Make sure PGDG repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
repmgr manages PostgreSQL physical replication, monitoring and failover. Release 5.5.1 supports PostgreSQL 13–18 and retains SQL extension version 5.5. It fixes escaping of values substituted into external notification commands. Use the same repmgr release on all cluster nodes.
Enabling
Use a dedicated metadata database and management role, with replication connections and the required SSH access configured. The upstream quickstart uses a superuser role; a normal role needs --superuser for privileged operations. Run the following SQL in the metadata database with sufficient privileges:
Configuration
Create repmgr.conf on each node:
Register Primary
Clone and Register Standby
Monitoring
Manual Switchover
Promote a standby to primary (planned switchover):
Automatic Failover with repmgrd
Before using repmgrd, configure this on each node and restart PostgreSQL:
Start the repmgr daemon on each node:
Configure failover in repmgr.conf:
Key Commands
repmgr primary register- register a primary noderepmgr standby clone- clone a standby from primaryrepmgr standby register- register a standby noderepmgr standby promote- promote standby to primaryrepmgr standby follow- follow a new primaryrepmgr standby switchover- planned switchoverrepmgr cluster show- display cluster statusrepmgr cluster event- show cluster eventsrepmgr node check- health check a node
5.5.1 Upgrade
Pause or stop automatic failover as directed by the upgrade guide, update the programs on each node, then restart a running repmgrd and check cluster status. Both 5.5.0 and 5.5.1 use SQL version 5.5; do not request a nonexistent SQL version 5.5.1. Follow the appropriate extension upgrade chain when coming from an older SQL version.