How it works...

First, we need to ensure that the archive server at 192.168.56.100 can connect to the primary server to receive the transaction log traffic. Next, unlike other recipes that depend on archive_mode to be enabled on the primary server, we want to disable it this time. Instead, we are going to rely on pg_receivexlog itself.

One setting that we change might seem a bit odd at first. The wal_keep_segments parameter defines how many transaction logs PostgreSQL should keep after it no longer needs them. Normally, it would delete old files or call the archive command to process them if archive_mode is on. By setting it to 1000, we are telling it to always have at least 1000 extra files. This helps avoid lost WAL archives if there's ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.