Re: pgbackrest: backup from standby

From: David Steele <david(at)pgmasters(dot)net>
To: Craig James <cjames(at)emolecules(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pgbackrest: backup from standby
Date: 2018-08-22 15:37:30
Message-ID: 404af85d-01ea-562a-0186-afef862696d2@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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.

Regards,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Craig James 2018-08-22 15:42:50 Re: pgbackrest: backup from standby
Previous Message Wim Bertels 2018-08-22 08:19:12 Re: Setting up SSL for postgre