How to perform recovery using archived WAL logs in postgresql?

Asked by Lakhan Agarwal

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.

Question information

English Edit question
Ubuntu postgresql-common Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Thomas Kr├╝ger (thkrueger) said :

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.

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.