O'Reilly logo

PostgreSQL High Performance Cookbook by Dinesh Kumar, Chitij Chauhan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using repmgr to create replica

As mentioned earlier in this chapter, repmgr is a management suite to manage replication setups and also to create replicas and add them to the existing PostgreSQL clusters. In this recipe, we are going to create a new clone of the primary server.

This recipe builds on from the previous recipe. Here we are going to create a replica of the primary server pg-primary and as we said we need two machines participating in this configuration. Our replica server will be titled pg-clone and the /data location will be our data directory.

How to do it...

All the following commands in this recipe are carried out in the replica server pg-clone. Here are the complete steps:

  1. First log in as the Postgres user and generate a RSA key-pair ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required