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:
On the primary server and standby run the following commands:
git clone https://github.com/OptionsHouse/walctl cd walctl sudo make install
On the archival server
pg-arc
create the wal storage directory:sudo mkdir -m 0600 /db/wal_archive sudo chown postgres...