Re: pgbackrest: backup from standby

From: Craig James <cjames(at)emolecules(dot)com>
To: David Steele <david(at)pgmasters(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pgbackrest: backup from standby
Date: 2018-08-22 15:42:50
Message-ID: CAFwQ8rc0DS9RCpX4RwcPLopC_EeTHpCbs6GT4A5j+gG=_+DC8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Aug 22, 2018 at 8:37 AM, David Steele <david(at)pgmasters(dot)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(at)pgmasters(dot)net
>

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David Steele 2018-08-22 15:48:57 Re: pgbackrest: backup from standby
Previous Message David Steele 2018-08-22 15:37:30 Re: pgbackrest: backup from standby