pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSnapshot as Backup
4+ messages / 4 participants
[nested] [flat]
* Snapshot as Backup
@ 2004-01-13 17:15 Ed Murphy <emurphy1@email.arizona.edu>
0 siblings, 2 replies; 4+ messages in thread
From: Ed Murphy @ 2004-01-13 17:15 UTC (permalink / raw)
To: pgsql-admin
Hello,
I'm using Red Hat Enterprise v2.1 and PostgreSQL v7.3.4. Our hardware
setup includes a large Storage Area Network (SAN). The systems folks
are going to utilize a snapshot type backup to backup the file system.
This snapshot will include PGDATA and all the PostgreSQL files. My
question is if I restore this snapshot will PostgreSQL work? I know if
doing a typical file system backup of PostgreSQL I must first stop the
postmaster or the backup will not produce a useable PostgreSQL system.
Is it necessary to stop the postmaster for this snapshot backup also?
Thanks,
Ed Murphy
The University of Arizona
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Snapshot as Backup
@ 2004-01-13 17:59 Matt Clark <matt@ymogen.net>
parent: Ed Murphy <emurphy1@email.arizona.edu>
1 sibling, 0 replies; 4+ messages in thread
From: Matt Clark @ 2004-01-13 17:59 UTC (permalink / raw)
To: emurphy1@email.arizona.edu; pgsql-admin
MessageThe consensus from previous discussions (search for 'LVM' in the
archives) is essentially that it definitely *should* work, some people *do*
use it successfully, but that you *must* test it thoroughly in your own
setup under heavy write load before relying on it.
PG will believe it has 'crashed' when you start it from a restored snapshot,
and PG is designed to recover perfectly well from crashes. If you stop the
postmaster before the snapshot is taken then it will definitely work fine.
Matt
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Ed Murphy
Sent: 13 January 2004 17:16
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Snapshot as Backup
Hello,
I'm using Red Hat Enterprise v2.1 and PostgreSQL v7.3.4. Our hardware
setup includes a large Storage Area Network (SAN). The systems folks are
going to utilize a snapshot type backup to backup the file system. This
snapshot will include PGDATA and all the PostgreSQL files. My question is
if I restore this snapshot will PostgreSQL work? I know if doing a typical
file system backup of PostgreSQL I must first stop the postmaster or the
backup will not produce a useable PostgreSQL system. Is it necessary to
stop the postmaster for this snapshot backup also?
Thanks,
Ed Murphy
The University of Arizona
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Snapshot as Backup
@ 2004-01-13 20:30 Sai Hertz And Control Systems <sank89@sancharnet.in>
parent: Ed Murphy <emurphy1@email.arizona.edu>
1 sibling, 1 reply; 4+ messages in thread
From: Sai Hertz And Control Systems @ 2004-01-13 20:30 UTC (permalink / raw)
To: emurphy1@email.arizona.edu; +Cc: pgsql-admin
Dear Ed Murphy ,
> and all the PostgreSQL files. My question is if I restore this
> snapshot will PostgreSQL work? I know if doing a typical file system
> backup of PostgreSQL I must first stop the postmaster or the backup
> will not produce a useable PostgreSQL system. Is it necessary to stop
> the postmaster for this snapshot backup also?
>
Yes if the snapshot (filesystem) backup and restore is performed when
postmaster is NOT running you can reproduce it.
I have done this with command
dump <-- for file system backup
Filesystem ext3
Regards
Vishal Kashyap
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Snapshot as Backup
@ 2004-01-16 14:54 Jeff <threshar@torgo.978.org>
parent: Sai Hertz And Control Systems <sank89@sancharnet.in>
0 siblings, 0 replies; 4+ messages in thread
From: Jeff @ 2004-01-16 14:54 UTC (permalink / raw)
To: aspire420@hotpop.com; +Cc: sank89@sancharnet.in; emurphy1@email.arizona.edu; pgsql-admin
On Wed, 14 Jan 2004 02:00:45 +0530
Sai Hertz And Control Systems <sank89@sancharnet.in> wrote:
>
> > and all the PostgreSQL files. My question is if I restore this
> > snapshot will PostgreSQL work? I know if doing a typical file
> > system backup of PostgreSQL I must first stop the postmaster or the
> > backup will not produce a useable PostgreSQL system. Is it
> > necessary to stop the postmaster for this snapshot backup also?
> >
I've done testing on this. It works fine.
Just make sure you're doing a filesystem snapshot and not a "cp".
To PG it just looks like the power went out or some other failure.
It'll replay parts of its log and be on its merry way. This is *much*
faster than using pg_dump / pg_restore, especially on huge db's.
If you are using xfs you may want to wrap the snapshot call with
xfs_freeze/unfreeze.
It may also be nice every once in a while to do a normal pg_dump..
--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2004-01-16 14:54 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-13 17:15 Snapshot as Backup Ed Murphy <emurphy1@email.arizona.edu>
2004-01-13 17:59 ` Matt Clark <matt@ymogen.net>
2004-01-13 20:30 ` Sai Hertz And Control Systems <sank89@sancharnet.in>
2004-01-16 14:54 ` Jeff <threshar@torgo.978.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox