Re: Hot_standby WAL archiving question - Mailing list pgsql-admin

From Peter Brunnengräber
Subject Re: Hot_standby WAL archiving question
Date
Msg-id 566233723.2724.1462205651189.JavaMail.pbrunnen@Station8.local
Whole thread Raw
In response to Re: Hot_standby WAL archiving question  (Keith <keith@keithf4.com>)
Responses Re: Hot_standby WAL archiving question
List pgsql-admin
Hi Keith,
  Thank you for the reply.

  Ok, but so how can I safely clean up the pg_archive folder on my master?


Thank you!
-With kind regards,
 Peter Brunnengräber


----- Original Message -----
From: "Keith" <keith@keithf4.com>
To: "Peter Brunnengräber" <pbrunnen@bccglobal.com>
Cc: "pgsql-admin" <pgsql-admin@postgresql.org>
Sent: Monday, May 2, 2016 12:07:12 PM
Subject: Re: [ADMIN] Hot_standby WAL archiving question






On Mon, May 2, 2016 at 11:53 AM, Peter Brunnengräber < pbrunnen@bccglobal.com > wrote:


Hello all,
So I have been working on setting up an active/standby clustered postgresql 9.2 using corosync. The corosync
documentationhas me enable WAL archiving "archive_command = 'cp %p /db/data/postgresql/9.2/pg_archive/%f'"  

I assume so that the secondary can catch up in async (log shipping) mode before going into sync (streaming) mode. But I
amnoticing as I push data through the DB, that my pg_archive keeps growing and I am worried about running out of disk
space. 

Per the postgresql documentation, I set "wal_keep_segments" but I believe this only effects the segments in the pg_xlog
andnot what the archive_command is processing.  

So, since I am not keeping the archived WAL statements for long term use, is it safe to set "archive_cleanup_command =
'pg_archivecleanup/db/data/postgresql/9.2/pg_archive %r'" on the master? Also will the archive cleanup command even
haveeffect? I only read about it being on slaves to clean-up what has already been processed.  

Thank you!

-With kind regards,
Peter Brunnengräber


--
Sent via pgsql-admin mailing list ( pgsql-admin@postgresql.org )
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



The archive_cleanup_command is something you set on the slave in the recovery.conf, not on the master. It will run
whatevercommand you place there to remove WAL files that have been confirmed to have been replayed by the slave and are
nolonger needed by the slave itself.  


Keith


pgsql-admin by date:

Previous
From: Keith
Date:
Subject: Re: Hot_standby WAL archiving question
Next
From: Keith
Date:
Subject: Re: Hot_standby WAL archiving question