Re: pgbackrest: backup from standby - Mailing list pgsql-admin

From Craig James
Subject Re: pgbackrest: backup from standby
Date
Msg-id CAFwQ8rc0DS9RCpX4RwcPLopC_EeTHpCbs6GT4A5j+gG=_+DC8w@mail.gmail.com
Whole thread Raw
In response to Re: pgbackrest: backup from standby  (David Steele <david@pgmasters.net>)
Responses Re: pgbackrest: backup from standby  (David Steele <david@pgmasters.net>)
List pgsql-admin

On Wed, Aug 22, 2018 at 8:37 AM, David Steele <david@pgmasters.net> wrote:
On 8/20/18 9:42 PM, Craig James wrote:
>
> One possibility: Does pgbackrest support chained standby servers?
>
>     primary ----> standby #1 ----> standby #2

This won't matter to pgBackRest and Postgres certainly supports it.

> If so, we could do this:
>
>     1. Set up standby #1 and #2 on AWS, but no S3 yet
>     2. Prepare config for S3, but don't deploy
>     3. Failover to standby #1, making it the primary
>     4. Start the S3 backup

Or combine my earlier plan with your plan to allow you to keep your repo
and have uninterrupted PITR:

Before the migration:

1) Stop backups
2) Sync the NFS repo to S3 using rsync/s3fs or aws cli

During the migration:

3) Failover to new AWS primary but leave archive_command disabled on new
primary (archive_command = false)
4) Resync the NFS repo to S3 to get new WAL segments
5) Enable archive command on AWS primary
6) Perform a new backup directly to S3 (just in case was mistake was
made syncing the repo)

Depending on your WAL volume you can add some syncs in there to reduce
the time when the new primary is not archiving, maybe after step #2 and
again before step #3.

This leaves you with your old backups and PITR capability while only
copying data local->S3 once.

This is a great plan. Thanks very much for your help.

Craig
 

Regards,
--
-David
david@pgmasters.net



--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------

pgsql-admin by date:

Previous
From: David Steele
Date:
Subject: Re: pgbackrest: backup from standby
Next
From: David Steele
Date:
Subject: Re: pgbackrest: backup from standby