pgbackrest: backup from standby

From: Craig James <cjames(at)emolecules(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pgbackrest: backup from standby
Date: 2018-08-20 16:12:48
Message-ID: CAFwQ8rcyq5ymqsqEV0VSyqeVZvhEh-qmU2+fK3EXA0C8uHNWzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
<https://pgbackrest.org/user-guide.html#standby-backup>* and on *S3 Support
<https://pgbackrest.org/user-guide.html#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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Craig James 2018-08-20 18:15:14 Re: pgbackrest: backup from standby
Previous Message Tom Lane 2018-08-20 15:26:11 Re: temp_file_limit parameter ignored?