Getting ready

We need to cover a few different scenarios here. One of the things we want to do is transfer files from one server to another. A popular way to do this is with the rsync command. On Debian or Ubuntu systems, we can install it as a root-capable user this way:

sudo apt-get install rsync

We also need it properly configured in order to use it. Create a file named /etc/rsyncd.conf and fill it with this content:

[archive] 
    path = /db/wal_archive 
    comment = Archived Transaction Logs 
    uid = postgres 
    gid = postgres 
    read only = true 

We're now ready to protect our data from hardware problems.

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.