Re: wal archiving on a hot-standby server - Mailing list pgsql-general

From Robert Treat
Subject Re: wal archiving on a hot-standby server
Date
Msg-id CABV9wwMyW-++o-r1fZoTeMj5Wwa=7Xm7B3UZL8GLPFtHGZCpDA@mail.gmail.com
Whole thread Raw
In response to wal archiving on a hot-standby server  (Enrico Sirola <enrico.sirola@gmail.com>)
List pgsql-general
On Mon, Nov 21, 2011 at 5:58 AM, Enrico Sirola <enrico.sirola@gmail.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
performa 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

pgsql-general by date:

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