diff --git a/README.md b/README.md index c2b422d1..e6a1a18d 100644 --- a/README.md +++ b/README.md @@ -522,6 +522,78 @@ standby's upstream server is the replication cluster master. While of limited use in a simple master/standby replication cluster, this information is required to effectively manage cascading replication (see below). +### Using Barman to clone a standby + +`repmgr standby clone` also supports Barman, the Backup and +Replication manager (http://www.pgbarman.org/), as a provider of both +base backups and WAL files. + +Barman support provides the following advantages: + +- the primary node does not need to perform a new backup every time a + new standby is cloned; +- a standby node can be disconnected for longer periods without losing + the ability to catch up, and without causing accumulation of WAL + files on the primary node; +- therefore, `repmgr` does not need to use replication slots, and the + primary node does not need to set `wal_keep_segments`. + +> *NOTE*: In view of the above, Barman support is incompatible with +> the `use_replication_slots` setting in `repmgr.conf`. + +In order to enable Barman support for `repmgr standby clone`, you must +ensure that: + +- the name of the server configured in Barman is equal to the + `cluster_name` setting in `repmgr.conf`; +- the `barman_server` setting in `repmgr.conf` is set to the SSH + hostname of the Barman server; +- the `restore_command` setting in `repmgr.conf` is configured to + use a copy of the `barman-wal-restore.py` script shipped with Barman + (see below); +- the Barman catalogue includes at least one valid backup for this + server. + +> *NOTE*: Barman support is automatically enabled if `barman_server` +> is set. Normally it is a good practice to use Barman, for instance +> when fetching a base backup while cloning a standby; in any case, +> Barman mode can be disabled using the `--without-barman` command +> line option. + +> *NOTE*: if you have a non-default SSH configuration on the Barman +> server, e.g. using a port other than 22, then you can set those +> parameters in a dedicated Host section in `~/.ssh/config` +> corresponding to the value of `barman_server` in `repmgr.conf`. See +> the "Host" section in `man 5 ssh_config` for more details. + +`barman-wal-restore.py` is a Python script provided by the Barman +development team, which must be copied in a location accessible to +`repmgr`, and marked as executable; `restore_command` must then be +set in `repmgr.conf` as follows: + +