pgbackrest: backup from standby - Mailing list pgsql-admin

From Craig James
Subject pgbackrest: backup from standby
Date
Msg-id CAFwQ8rcyq5ymqsqEV0VSyqeVZvhEh-qmU2+fK3EXA0C8uHNWzg@mail.gmail.com
Whole thread Raw
Responses Re: pgbackrest: backup from standby  (Craig James <cjames@emolecules.com>)
Re: pgbackrest: backup from standby  (David Steele <david@pgmasters.net>)
List pgsql-admin
The pgbackrest documentation has a section on backing up from a standby, but I'm having trouble figuring it out. I think it's just a terminology problem: I can't figure out which configuration directives go on which server.

To begin with, I already have streaming replication running:

Primary server (live database): "radon"

[emolecules]
  db-path=/var/lib/postgresql/9.6/main

[global]
  repo-path=/pg_archive/pgbackrest
  retention-full=10
  backup-user=postgres
  log-level-file=detail

Hot-standby server: "standby"

[emolecules]
  db-path=/var/lib/postgresql/9.6/main
  recovery-option=standby_mode=on

 [global]
  backup-host=radon.emolecules.com
  backup-user=postgres

The standby server is on Amazon AWS, and I want to set up a backup Amazon S3 archive that gets its snapshot and WAL files from the standby in order to save bandwidth costs from the primary (don't want to copy the data twice).

Note that the primary is also archived to a local NFS disk. I want to keep that going, too, but create a second archive on S3. (The reason for this is that we're migrating from our own hardware to AWS, and during the transition need both systems fully functional.)

There are sections in the user guide on Backup from a Standby and on S3 Support, but I can't sort out how to combine them. Apparently I need to define pg1-host/pg1-path, and pg2-host/pg2-path, then a stanza for S3. But does all this go in the pgbackrest.conf of the primary ("radon" in my case), or on the standby, or somehow split across both?

Another question: if I modify these files, will the current standby replica keep streaming properly? That is, can I add the S3 repository to the current primary/standby pair without having to start over?

Thanks!
Craig

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: temp_file_limit parameter ignored?
Next
From: Craig James
Date:
Subject: Re: pgbackrest: backup from standby