5

I use streaming replication and PITR (WAL files) in my cluster, currently I have different versions of postgresql.conf for the master and the standby server.

The only difference in the files is the archive command, that points to a different directory.

for example, on master I have:

archive_command = 'cp %p /dbckp/server1master/%f'

And on the standby:

archive_command = 'cp %p /dbckp/server2master/%f'

I figure that if the standby is not generating any archives while on 'standby mode' I could use the same directory and have a single postgresql.conf.

RolandoMySQLDBA
185k34 gold badges327 silver badges541 bronze badges
asked Feb 1, 2013 at 10:52

2 Answers 2

4

In theory this should work. After all, the files should be identical. In practice I think it is scary and I wouldn't do it. I would worry about file locking contention, and also the fact that if I am archiving twice to two locations I get a full backup of the WAL's esp, if I send to different file servers. If one goes belly up at a bad time, I can still get logs off the other for PITR.

Keep in mind that if something goes wrong with this setup, you can lose PITR ability to roll forward beyond a certain point. Additionally if you set things up how they are now, you may be able to use file permissions and attributes to prevent overwriting existing parts of existing files which can be very helpful in backup assurance.

answered Feb 15, 2013 at 1:17
1
  • In the end I decided to keep 2 different locations for the files but unified the postgresql.conf by creating a softlink with the same name on both servers (but pointing to different locations). Commented Feb 15, 2013 at 8:58
2

Indeed, the standby does not archive wal segments, but you should always test for the existence of the segment about to be written and skip the write if it exists already.

answered May 31, 2013 at 19:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.