2ndQuadrant is now part of EDB

Bringing together some of the world's top PostgreSQL experts.

2ndQuadrant | PostgreSQL
Mission Critical Databases
  • Contact us
  • EN
    • FR
    • IT
    • ES
    • DE
    • PT
  • Support & Services
  • Products
  • Downloads
    • Installers
      • Postgres Installer
      • 2UDA – Unified Data Analytics
    • Whitepapers
      • Business Case for PostgreSQL Support
      • Security Best Practices for PostgreSQL
    • Case Studies
      • Performance Tuning
        • BenchPrep
        • tastyworks
      • Distributed Clusters
        • ClickUp
        • European Space Agency (ESA)
        • Telefónica del Sur
        • Animal Logic
      • Database Administration
        • Agilis Systems
      • Professional Training
        • Met Office
        • London & Partners
      • Database Upgrades
        • Alfred Wegener Institute (AWI)
      • Database Migration
        • International Game Technology (IGT)
        • Healthcare Software Solutions (HSS)
        • Navionics
  • Postgres Learning Center
    • Webinars
      • Upcoming Webinars
      • Webinar Library
    • Whitepapers
      • Business Case for PostgreSQL Support
      • Security Best Practices for PostgreSQL
    • Blog
    • Training
      • Course Catalogue
    • Case Studies
      • Performance Tuning
        • BenchPrep
        • tastyworks
      • Distributed Clusters
        • ClickUp
        • European Space Agency (ESA)
        • Telefónica del Sur
        • Animal Logic
      • Database Administration
        • Agilis Systems
      • Professional Training
        • Met Office
        • London & Partners
      • Database Upgrades
        • Alfred Wegener Institute (AWI)
      • Database Migration
        • International Game Technology (IGT)
        • Healthcare Software Solutions (HSS)
        • Navionics
    • Books
      • PostgreSQL 11 Administration Cookbook
      • PostgreSQL 10 Administration Cookbook
      • PostgreSQL High Availability Cookbook – 2nd Edition
      • PostgreSQL 9 Administration Cookbook – 3rd Edition
      • PostgreSQL Server Programming Cookbook – 2nd Edition
      • PostgreSQL 9 Cookbook – Chinese Edition
    • Videos
    • Events
    • PostgreSQL
      • PostgreSQL – History
      • Who uses PostgreSQL?
      • PostgreSQL FAQ
      • PostgreSQL vs MySQL
      • The Business Case for PostgreSQL
      • Security Information
      • Documentation
  • About Us
    • About 2ndQuadrant
    • 2ndQuadrant’s Passion for PostgreSQL
    • News
    • Careers
    • Team Profile
  • Blog
  • Menu Menu
You are here: Home1 / Blog2 / Ian's PlanetPostgreSQL3 / Improvements in repmgr 3.1.4
Ian Barwick

Improvements in repmgr 3.1.4

July 25, 2016/0 Comments/in Ian's PlanetPostgreSQL /by Ian Barwick

The recently released repmgr 3.1.4 update incorporates several changes which improve usability and lay out the groundwork for enhanced compatibility with 2ndQuadrant’s barman product.

New configuration option restore_command

It’s now possible to specify a restore_command in repmgr.conf, which will be included in the recovery.conf file generated by repmgr standby clone, making it easier to configure a more robust replication setup by enabling PostgreSQL to fall back to a WAL archive source if streaming replication is interrupted. See Gabriele Bartolini’s recent blog post “Speed up getting WAL files from Barman” for an example on how to do this.

CSV output for repmgr cluster show

The repmgr cluster show command now accepts the optional parameter --csv, which outputs the status of the replication cluster in CSV format, suitable for parsing by scripts. Current “human-readble” output will look something like this:

    $ repmgr -f  /path/to/repmgr.conf cluster show

    Role      | Name  | Upstream | Connection String
    ----------+-------|----------|---------------------------------------------------
      FAILED  | node1 |          | host=localhost dbname=repmgr user=repmgr port=5501
    * master  | node2 |          | host=localhost dbname=repmgr user=repmgr port=5502
      standby | node3 | node2    | host=localhost dbname=repmgr user=repmgr port=5503

The equivalent CSV output is this:

   $ repmgr -f  /path/to/repmgr.conf cluster show --csv
   1,-1
   2,0
   3,1

with node ID as the first column, and status (0 = master, 1 = standby, -1 = failed) as
the second.

conninfo strings now accepted

repmgr operations which require the provision of database connection information, such as repmgr standby clone, now accept conninfo-style strings. This brings repmgr into line with other PostgreSQL utilities and is more than a convenient syntax – it provides much more granular control over the primary_conninfo string in the recovery.conf file generated by repmgr. This is particularly relevant when setting up SSL-based replication.

Typical conninfo string usage is something like this:

  repmgr standby clone -d 'host=foo port=6543 user=bar dbname=repmgr' -f /path/to/repmgr.conf

or in URL format:

  repmgr standby clone -d 'postgresql://[email protected]:6543/repmgr' -f /path/to/repmgr.conf

Other parameter keywords (see here for the full list) can be added as required – for example to force SSL-only replication add sslmode=require:

    $ repmgr
       -D /path/to/standby/data \
       -f /path/to/standby/repmgr.conf \
       -d 'host=localhost dbname=repmgr user=repmgr port=5501 sslmode=require' \
       -R someuser \
       standby clone

which will result in the following recovery.conf being generated:

    $ cat /path/to/standby/data/recovery.conf
    standby_mode = 'on'
    primary_conninfo = 'user=repmgr host=localhost port=5501 application_name=node2 sslmode=require sslcompression=1'
    recovery_target_timeline = 'latest'

(This does of course require that your PostgreSQL servers are configured with SSL – for more detailed information see the documentation and pages 188 ~ 195 of the PostgreSQL 9 Administration Cookbook).

Please be aware that any PostgreSQL-specific environment variables, if set, will be incorporated into the generated primary_conninfo string unless they’re explicitly overridden in the provided conninfo string.

What’s next for repmgr?

Our thanks goes out to all the users whose feedback has helped improve repmgr. For the upcoming 3.2 release, we’ll be working on integrating the replication enhancements provided by the upcoming PostgreSQL 9.6 release as well as greater integration with barman.

Tags: Barman, ha, postgresql repmgr, replication, Repmgr
Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

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

Search

Get in touch with us!

Recent Posts

  • Random Data December 3, 2020
  • Webinar: COMMIT Without Fear – The Beauty of CAMO [Follow Up] November 13, 2020
  • Full-text search since PostgreSQL 8.3 November 5, 2020
  • Random numbers November 3, 2020
  • Webinar: Best Practices for Bulk Data Loading in PostgreSQL [Follow Up] November 2, 2020

Featured External Blogs

Tomas Vondra's Blog

Our Bloggers

  • Simon Riggs
  • Alvaro Herrera
  • Andrew Dunstan
  • Craig Ringer
  • Francesco Canovai
  • Gabriele Bartolini
  • Giulio Calacoci
  • Ian Barwick
  • Marco Nenciarini
  • Mark Wong
  • Pavan Deolasee
  • Petr Jelinek
  • Shaun Thomas
  • Tomas Vondra
  • Umair Shahid

PostgreSQL Cloud

2QLovesPG 2UDA 9.6 backup Barman BDR Business Continuity community conference database DBA development devops disaster recovery greenplum Hot Standby JSON JSONB logical replication monitoring OmniDB open source Orange performance PG12 pgbarman pglogical PG Phriday postgres Postgres-BDR postgres-xl PostgreSQL PostgreSQL 9.6 PostgreSQL10 PostgreSQL11 PostgreSQL 11 PostgreSQL 11 New Features postgresql repmgr Recovery replication security sql wal webinar webinars

Support & Services

24/7 Production Support

Developer Support

Remote DBA for PostgreSQL

PostgreSQL Database Monitoring

PostgreSQL Health Check

PostgreSQL Performance Tuning

Database Security Audit

Upgrade PostgreSQL

PostgreSQL Migration Assessment

Migrate from Oracle to PostgreSQL

Products

HA Postgres Clusters

Postgres-BDR®

2ndQPostgres

pglogical

repmgr

Barman

Postgres Cloud Manager

SQL Firewall

Postgres-XL

OmniDB

Postgres Installer

2UDA

Postgres Learning Center

Introducing Postgres

Blog

Webinars

Books

Videos

Training

Case Studies

Events

About Us

About 2ndQuadrant

What does 2ndQuadrant Mean?

News

Careers 

Team Profile

© 2ndQuadrant Ltd. All rights reserved. | Privacy Policy
  • Twitter
  • LinkedIn
  • Facebook
  • Youtube
  • Mail
Evolution of Fault Tolerance in PostgreSQL: Time Travel PostgreSQL 10 Roadmap
Scroll to top
×