Backup Strategy Second Opinion

From: Bryan Murphy <bmurphy1976(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Backup Strategy Second Opinion
Date: 2009-02-23 01:19:44
Message-ID: 7fd310d10902221719s2897205ekea6230bf110bb836@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey guys, we just moved our system to Amazon's EC2 service. I'm a bit
paranoid about backups, and this environment is very different than
our previous environment. I was hoping you guys could point out any
major flaws in our backup strategy that I may have missed.

A few assumptions:

1. It's OK if we lose a few seconds (or even minutes) of transactions
should one of our primary databases crash.
2. It's unlikely we'll need to load a backup that's more than a few days old.

Here's what we're currently doing:

Primary database ships WAL files to S3.
Snapshot primary database to tar file.
Upload tar file to S3.

Create secondary database from tar file on S3.
Put secondary database into continuous recovery mode, pulling wal files from S3.

Every night on secondary database:
* shutdown postgres
* unmount ebs volume that contains postgres data
* create new snapshot of ebs volume
* remount ebs volume
* restart postgres

I manually delete older log files and snapshots once I've verified
that a newer snapshot can be brought up as an active database and have
run a few tests on it.

Other than that, we have some miscellaneous monitoring to keep track
of the # of logs files in the pg_xlog directory and the amount of
available disk space on all the servers. Ideally, if the # of log
files starts to grow beyond a certain threshold, that indicates
something went wrong with the log shipping and we'll investigate to
see what the problem is.

I think this is a pretty good strategy, but I've been so caught up in
this I may not be seeing the forest through the trees so I thought I'd
ask for a sanity check here.

Thanks,
Bryan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2009-02-23 01:30:08 Re: Backup Strategy Second Opinion
Previous Message Mike Hall 2009-02-22 23:45:02 Re: Cambiando Postgresql 7.4.3 a 8.1.11 !!!