Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Overview of this book

Table of Contents (19 chapters)
PostgreSQL 9 Administration Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using repmgr


As said before, replication is great provided it works. It works well if it's understood and works even better if it's tested. This is a great reason to use repmgr.

repmgr is an open source tool designed specifically for PostgreSQL replication. To get additional information about repmgr, visit http://projects.2ndQuadrant.com/repmgr/.

repmgr provides a command-line interface and a management process (daemon) used to monitor and manage PostgreSQL servers involved in replication. repmgr easily supports more than two nodes, with automatic failover detection.

Getting ready

Install repmgr from binary packages on each PostgreSQL node.

Set up replication security and network access between nodes according to the Setting up streaming replication security recipe.

How to do it…

repmgr provides a set of single command-line actions that perform all the required activities on one node:

  • To register the current master with repmgr, use the following command:

    repmgr master register
    
  • To register an existing...