Обсуждение: Use hardware snapshots to restore postgres

Поиск
Список
Период
Сортировка

Use hardware snapshots to restore postgres

От
jigar shah
Дата:
 Postgres Guru’s

Do you guys know the procedure to use hardware snapshots (for eg 3par) to restore postgres database? Is there somewhere I can find good documentation to do this?

I’d like to do the following

# put the database in the backup mode
# take an filesystem snap
# get the database out of the backup mode
# mount the snap on a different host
# bring up postgres and start querying.

Help appreciated

Regards
Jigar


--
"luck is truly where preparation meets opportunity"
--Randy Pausch

Re: Use hardware snapshots to restore postgres

От
Scott Marlowe
Дата:
On Fri, Aug 27, 2010 at 7:57 PM, jigar shah <jshah1982@gmail.com> wrote:
>  Postgres Guru’s
>
> Do you guys know the procedure to use hardware snapshots (for eg 3par) to
> restore postgres database? Is there somewhere I can find good documentation
> to do this?

http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html

is a good place to start.

Re: Use hardware snapshots to restore postgres

От
yj2133011
Дата:

Re: Use hardware snapshots to restore postgres

От
Scott Marlowe
Дата:
On Sat, Aug 28, 2010 at 12:24 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Fri, Aug 27, 2010 at 7:57 PM, jigar shah <jshah1982@gmail.com> wrote:
>>  Postgres Guru’s
>>
>> Do you guys know the procedure to use hardware snapshots (for eg 3par) to
>> restore postgres database? Is there somewhere I can find good documentation
>> to do this?
>
> http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html
>
> is a good place to start.

Specifically this section:

24.3.2. Making a Base Backup

Re: Use hardware snapshots to restore postgres

От
jigar shah
Дата:
thanks Scott. i have read and used this article a lot of times before.

in section 24.3.2, step number 3 says

"3. Perform the backup, using any convenient file-system-backup tool such as tar or cpio. It is neither necessary nor desirable to stop normal operation of the database while you do this. "

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 know a lot of ppl use this procedure, but cant find a good doc for this procedure.

regards
Jigar

On Sat, Aug 28, 2010 at 5:29 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Sat, Aug 28, 2010 at 12:24 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Fri, Aug 27, 2010 at 7:57 PM, jigar shah <jshah1982@gmail.com> wrote:
>>  Postgres Guru’s
>>
>> Do you guys know the procedure to use hardware snapshots (for eg 3par) to
>> restore postgres database? Is there somewhere I can find good documentation
>> to do this?
>
> http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html
>
> is a good place to start.

Specifically this section:

24.3.2. Making a Base Backup



--
"luck is truly where preparation meets opportunity"
--Randy Pausch

Re: Use hardware snapshots to restore postgres

От
Scott Marlowe
Дата:
On Sat, Aug 28, 2010 at 7:15 PM, jigar shah <jshah1982@gmail.com> wrote:
> thanks Scott. i have read and used this article a lot of times before.
>
> in section 24.3.2, step number 3 says
>
> "3. Perform the backup, using any convenient file-system-backup tool such as
> tar or cpio. It is neither necessary nor desirable to stop normal operation
> of the database while you do this. "
>
> 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 know a lot of ppl use this procedure, but cant find a good doc for this
> procedure.

I found little on the google about snapshotting with 3par.  I'd guess
they gave you docs on how to do that.  I hope.  I found plenty on
doing it with other file systems / etc, like LVM, ZFS, Microsoft, EMC.

For 3par I searched google for "3par snapshot howto" and the first
result was a pdf that seems to show what to do, but doesn't feel like
definitive documentation.  They're big on marketing, not so much on
documentation it seems.

--
To understand recursion, one must first understand recursion.

Re: Use hardware snapshots to restore postgres

От
Rosser Schwarz
Дата:
On Sat, Aug 28, 2010 at 7:15 PM, jigar shah <jshah1982@gmail.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