walctl is basically a WAL management system that either pushes or fetches WAL files from a remote central server. It is a substitute for
restore_command in handling WAL archival or recovery.
walctl also includes a utility to clone a primary server and create a replica.
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: