For this scenario, the server at 192.168.56.10 is the primary PostgreSQL server, and 192.168.56.20 will be the new copy. Once again, arc_server will be the location of the archive server with old WAL files. On all PostgreSQL servers, our data directory should be located at /db/pgdata.
Follow these steps to build a PostgreSQL hot standby:
- Ensure that the pg_hba.conf file on the primary server contains this line:
host replication rep_user 192.168.56.20/32 trust
- Ensure that the wal_level and max_wal_senders settings in postgresql.conf are set as follows on the primary server:
wal_level = replica max_wal_senders = 5
- Restart PostgreSQL on the primary server with the following command as the postgres user:
pg_ctl -D /db/pgdata ...