For this procedure, we will need three servers. The archive server should be named pg-arc, our primary PostgreSQL server is pg-primary, and the new standby will be pg-clone. As usual, the PostgreSQL data directory will be located at /db/pgdata. For simplicity, the system user on all machines will be postgres. Be sure to have the password for this user!
- As a root-capable user on pg-primary and pg-clone, run these commands to install walctl:
git clone https://github.com/peak6/walctl cd walctl sudo make install
- As a root-capable user on pg-arc, create the WAL storage directory:
sudo mkdir -m 0600 /db/wal_archive sudo chown postgres:postgres /db/wal_archive
- On pg-primary, create and export an SSH key to the pg-arc and ...