I’m using Postgresql 9.0 AS database for my applications on Linux Operating System, And i have configured the backup server also which is working as slave.
So the slave server is in sync with the master but today the replication got stopped and it is showing the below error message in Log file.
2015-12-11 01:23:57 ISTLOG: streaming replication successfully connected to primary
2015-12-11 01:23:57 ISTFATAL: could not receive data from WAL stream: FATAL: requested WAL segment 000000010000016C0000002E has already been removed
As per the “ISTFATAL: could not receive data from WAL stream: FATAL: requested WAL segment 000000010000016C0000002E has already been removed” error message,
The slave server requesting for the next WAL segment that is “000000010000016C0000002E” to Master server but the master server had already recycled the requested WAL segment or moved it somewhere.
1. Provide the requested WAL segment from backup, If you don’t have the backup then need to follow below steps:
2. Take a fresh backup of Master server and Rebuild your Slave server.
3. Increase wal_keep_segments on the Master Server.
4. Make sure that the archive_command is set and take regularaly backup to avoid this kind of issue in future.