Re: Use hardware snapshots to restore postgres

From: Rosser Schwarz <rosser(dot)schwarz(at)gmail(dot)com>
To: jigar shah <jshah1982(at)gmail(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Use hardware snapshots to restore postgres
Date: 2010-08-29 17:21:11
Message-ID: AANLkTi=Z=kL2-xVwHD46b_EFGJ_hpx2mZPQi_-n8cpNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sat, Aug 28, 2010 at 7:15 PM, jigar shah <jshah1982(at)gmail(dot)com> wrote:
> so instead of tar or cpio, i am looking for the procedure where you can use
> hardware level snapshots of the postgres filesystem, which you can take on
> san (3par) or nas (netapp) or any other vendor hardware, and then mount the
> postgres filesystem snapshot to a different host.

I've used this technique on NetApp filers quite a bit. The critical
step is to issue a CHECKPOINT (and allow time for it to settle,
depending on your checkpoint_completion_target setting) *before*
taking the snapshot. When you mount the snap elsewhere and start up
another postmaster, it will take a moment to clean up (to the postgres
cluster running against the snap, it will appear as if there was an
unclean shutdown), and you're good to go.

Remember also to synchronize snapping your data and WAL filesystems as
much as possible, if you're using separate volumes for them (as we
did).

I routinely used this technique to populate development and testing
environments, as well as to spin up a secondary instance to use for
backups (i.e., pg_dump), to avoid impacting the production environment
with that IO overhead.

rls

--
:wq

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mark Rostron 2010-08-30 20:36:18 plpgsql syntax question
Previous Message Amit jain 2010-08-29 15:04:24 Re: [Admin] Large DataBase move