Re: pg_archivecleanup with multiple slaves

From: Ben Lancaster <benlancaster(at)holler(dot)co(dot)uk>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_archivecleanup with multiple slaves
Date: 2011-05-20 14:23:46
Message-ID: ED4EED04-4C0D-4E6F-BA59-F501F5287C58@holler.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 20 May 2011, at 12:53, Tim wrote:

> I think you are using Log-Shipping not Streaming-Replication
> http://www.postgresql.org/docs/9.0/static/different-replication-solutions.html

I'm using streaming replication with log shipping as a fallback as per walkthrough here: http://brandonkonkle.com/blog/2010/oct/20/postgres-9-streaming-replication-and-django-balanc/

> I would just make 2 copies of the WAL file one for each slave in different folders.
> That way if one slave is offline for a period of time it can catch up when it comes back online.

...hence using a combination of the two.

For now, I've reverted to do the following on an hourly basis:

for f in `find /srv/pg_backups -ctime +0.5`; do pg_archivecleanup /srv/pg_backups `basename $f`; done;

...that is, find anything that was changed within the past day and a half and archive it. Not particularly elegant, but it gives me plenty of time for a slave to go down and replay the logs.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Fujii Masao 2011-05-20 15:30:35 Re: pg_archivecleanup with multiple slaves
Previous Message Mark Johnson 2011-05-20 13:27:26 Re: LDAP Authentication