Using walctl to create replica

In this recipe, we are going to use the walctl_clone utility to create a clone/replica

How to do it...

For this recipe only two servers are needed. One is the primary server and the other is the replica server. Our primary server will be named pg-primary and the replica will be named pg-clone server.

We need to execute the following command on the replica server:

walctl_clone pg-primary walctl

How it works...

walctl_clone has two parameters. The first parameter is supposed to be the hostname of the primary server and the second parameter should be the name of the database superuser with which we are going to create a backup.

Here are the series of actions that are performed on behalf of walctl_clone:

  • It puts the primary ...

Get PostgreSQL High Performance Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.