Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've found out that archive_command is only run by postgresql on a master.

If I'm running a cascading replication like:

Master -> Slave1 -> Slave2 and want to archive WAL segments on Slave1, the command is never run.

Is this correct?

If so, what if I just copy (rsync or similar) myself the WAL segments from pg_xlog directory to my archive directory? Could I then use this archive directory as the source for a restore_command in a new slave?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If so, what if I just copy (rsync or similar) myself the WAL segments from pg_xlog directory to my archive directory? Could I then use this archive directory as the source for a restore_command in a new slave?

Yes, you can. You are however responsible for making sure you don't drop any log files while doing this.

For best results you probably want to do the cascading copy/rsync/whatever as part of your restore_command on Slave1.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.