Setting up walctl

walctl is basically a WAL management system that either pushes or fetches WAL files from a remote central server. It is a substitute for archive_command or restore_command in handling WAL archival or recovery.

walctl also includes a utility to clone a primary server and create a replica.

How to do it...

For this recipe we are going to use three servers. The remote server that will handle archival is called pg-arc. The primary server will be named pg-primary and the standby server will be named pg-clone. Our assumption is that the data directory will be located at /data location and the same can be defined in the $PGDATA environment variable.

Here are the steps for this recipe:

  1. On the primary server and standby run the following commands: ...

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.