Follow these steps for initial configuration of file-based log shipping:
- Identify your archive location and ensure that it has sufficient space. This recipe assumes that the archive is a directory on the standby node, identified by the $PGARCHIVE environment variable. This is set on both the master and standby nodes, as the master must write to the archive and the standby must read from it. The standby node is identified on the master using $STANDBYNODE.
- Configure replication security. Perform a key exchange to allow the master and the standby to run the rsync command in either direction.
- Adjust the master's parameters in postgresql.conf, as follows:
wal_level = 'archive' archive_mode = on archive_command = 'scp %p $STANDBYNODE:$PGARCHIVE/%f' ...