Re: wal archiving on a hot-standby server

From: Robert Treat <rob(at)xzilla(dot)net>
To: Enrico Sirola <enrico(dot)sirola(at)gmail(dot)com>
Cc: "PostgreSQL General (list)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: wal archiving on a hot-standby server
Date: 2011-11-23 06:12:53
Message-ID: CABV9wwMyW-++o-r1fZoTeMj5Wwa=7Xm7B3UZL8GLPFtHGZCpDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 21, 2011 at 5:58 AM, Enrico Sirola <enrico(dot)sirola(at)gmail(dot)com> wrote:
> Hello,
> is it possible to archive the WAL files received by a hot-standby server? In noticed nothing about this on the pgsql docs. The idea
> is to archive logs in two locations, at the primary site and at the replica site (over a wan) in order to be able to perform a PITR also
> at the replica site.

You can do this 2 different ways; 1 is by adding multiple destinations
into your archive command to send the wal file to multiple
destinations; here is an example using omnipitr (the -dr are the
remote destinations, we gzip the first for long term archiving)

/opt/OMNIpitr/bin/omnipitr-archive -dr
gzip=db4:/mnt/db/prod/walarchive/ -dr db2:/mnt/db/prod/db2-walarchive/
"%p"

The other way to do this is to add something into your
archive_cleanup_command of your recovery.conf to archive the files to
the other destination.

Which method you want depends on the version / setup of postgres you
have, and whether you want the slave to be in the chain of the replica
site. (I probably wouldn't, which would make me lean towards something
like omnipitr)

Robert Treat
conjecture: xzilla.net
consulting: omniti.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2011-11-23 06:27:35 Re: autovacuum stuck on a table for 18+ hours, consuming lots of CPU time
Previous Message Robert Treat 2011-11-23 05:58:11 Re: Is this safe to perform on PostgreSQL 8.3.7 -> Resize a column in a PostgreSQL table without changing data