Re: How-To Consitent EC2 Snapshots with Postgres

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: saturon <gsaturon(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How-To Consitent EC2 Snapshots with Postgres
Date: 2009-10-31 15:15:26
Message-ID: 9837222c0910310815h458bb160s138134162e99e78d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Oct 31, 2009 at 15:44, saturon <gsaturon(at)gmail(dot)com> wrote:

> Hi all,
>
> I am fairly new to postgres admin so please bear with me.
>
> I am looking for a way to create a consitent EC2 snapshot of a postgres DB
> that is running in a Debian Lenny instance, XFS file system on a EBS . I was
> following Eric Hammons posts *http://ec2ebs-mysql.notlong.com/*<http://ec2ebs-mysql.notlong.com/>
> *http://alestic.com/2009/09/ec2-consistent-snapshot*<http://alestic.com/2009/09/ec2-consistent-snapshot>on creating Snapshost for MySQL and would like to port his efforts to
> Postgres.
>
> I am really looking just for some documentation of this whole area since I
> am sitting here a bit in the blue ;) (e.g. I heard of LVM but do not know it
> and not sure if this is the way to go)
>

As long as EBS snapshots are atomic (which I think they are, but don't know
for sure), you can just do the snapshot, no need to do anything extra.
PostgreSQL will then go into normal crash recovery when you start up another
instance on the snapshot. Note that this requires that all your PostgreSQL
data (including the data directory, xlog and *all* tablespaces) are on the
same EBS volume - I'm pretty sure they can't do atomic snapshots across
multiple volumes.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2009-10-31 16:38:27 Re: How-To Consitent EC2 Snapshots with Postgres
Previous Message saturon 2009-10-31 14:44:51 How-To Consitent EC2 Snapshots with Postgres