How to perform recovery using archived WAL logs in postgresql?

Asked by Lakhan Agarwal on 2013-09-18

I have enabled streaming replication between two server say master and slave. Now after this I enabled archiving changing following parameters-

On the master node, configure "postgresql.conf"

archive_mode = on
archive_command = 'cp %p /u01/arch/%f'
 archive_timeout = 120
max_wal_senders = 5
wal_keep_segments = 10

After this I edited the recovery.conf file on the slave server-

modify "recovery.conf" on the standby node

trigger_file = '/tmp/pg_failover.trigger'
restore_command = 'cp /u01/arch/%f %p'

Now due to server load the slave WAL receiver lags behind and the WAL needed by slave has been archived and removed from the pg_xlog.

Issue is that the following error is generated on slave-
cp: cannot stat `/u01/arch/0000000100000005000000C5': No such file or directory
2013-09-18 16:02:38 IST LOG: streaming replication successfully connected to primary
2013-09-18 16:02:38 IST FATAL: could not receive data from WAL stream: FATAL: requested WAL segment 0000000100000005000000C4 has already been removed

Please help me to resolve this.

Thanks in advance.
Lakhan

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu postgresql-common Edit question
Assignee:
No assignee Edit question
Last query:
2013-09-18
Last reply:
2013-09-18
Thomas Kr├╝ger (thkrueger) said : #1

This is a very specific PostgresQL question. It is also not related to Ubuntu Linux.
I think it would be best if you try to find help in a PostgresQL related community. They have the experts on it.
http://www.postgresql.org/community/

Can you help with this problem?

Provide an answer of your own, or ask Lakhan Agarwal for more information if necessary.

To post a message you must log in.