repmgr 3.0 released
What is repmgr?
repmgr is an open source package which greatly simplifies the process of setting up and managing replication using streaming replication within a cluster of PostgreSQL servers. Taking advantage of features introduced since PostgreSQL 9.3, repmgr builds on PostgreSQL's core functionality to provide a smooth, user-friendly way of working with the complexities of replication and failover management in high-availability environments.
repmgr consists of two core tools - the repmgr command line interface, which provides functionality for adminstering replication such as cloning standby servers, and repmgrd, a background daemon which monitors nodes in a replication cluster and provides automatic failover support.
The latest repmgr release, version 3.0, introduces a number of new features which further simplify replication administration:
- Standby cloning with pg_basebackup
- Timeline following:
- a standby can be promoted to a master without requiring a restart
- other standbys can connect to the new master without being resynced
- Cascading standby support
- Standbys not directly connected to the master node are not affected during failover of the master to another standby mode
- Replication slot support (PostgreSQL 9.4 and later), simplifying WAL retention management
Additionally many usability improvements have been made based on user feedback, including
better error reporting, removing the requirement to set pg_bindir
if PostgreSQL
binaries are in the default path, and a command line option to examine a server's
configuration and report any changes required for setting up replication.
Note that repmgr 3.0 supports PostgreSQL 9.3 and later only.
2ndQuadrant provides professional support services for repmgr - see our website for details.
New features
- Supports cloning of a standby using
pg_basebackup
(rsync
still available as an option) - Supports cascaded standbys
- No server restart needed when promoting a standby to a master
- Supports replication slots (PostgreSQL 9.4 and later)
- Supports tablespace remapping with
pg_basebackup
(PostgreSQL 9.4 and later) andrsync
- Events of interest (e.g. failovers) logged to a new log table `repl_events` and can be optionally passed to an external program to provide notifications by email etc.
New or altered configuration options
- Config option
pg_bindir
is no longer mandatory; repmgr will use the default path by default, or alternatively the new--pg_bindir
command line option - New config option:
pg_basebackup_options
- New config option:
tablespace_mapping
- New config option:
upstream_node
- New config option:
use_replication_slots
- New config option:
event_notification_command
- New config option:
event_notifications
New or altered command line options (repmgr)
- New command line option
--check-upstream-config
to report issues with the upstream server configuration - New command line option
--fast-checkpoint
(forces a fast checkpoint when cloning a standby) - New command line option
--rsync-only
(usersync
only to clone a standby) - New command line option
--pg_bindir
- New command line option
--ignore-external-config-files
Compatibility with repmgr 2.x
The configuration file format and options in repmgr 3 are backwards compatible
with repmgr 2.x, so existing configuration files can be used largely as-is.
However please be aware that the priority
setting now defaults
to 100
and that a setting of 0
(or less) indicates
that the node should not be promoted to master, so any priority
in existing repmgr.conf
files should be adjusted accordingly.
Note that the metadata stored by repmgr 3 has changed and the existing metadata
table (repl_nodes
) will need to be upgraded; a script has been
provided for this (repmgr2_repmgr3.sql
).
The following minor compatibility changes have been made:
- The text of many log messages has been revised for brevity and clarity
- A valid value for config option
failover
must be provided (previously it defaulted tomanual
if an unrecognized value was provided) - The config option
pg_bindir
is no longer mandatory
Community and development
repmgr is free and open source software and is licensed under the GPLv3.
Contributions to repmgr are welcome. See the README.md file for information about how to contribute.