简体   繁体   English

从存档的Wal日志中恢复Postgres流复制从设备

[英]Recover Postgres Streaming Replication Slave from Archived Wal Logs

I have set up a Postgres Hot Standby server by Streaming Replication. 我已经通过流复制设置了Postgres Hot Standby服务器。 But My Standby server is asking for an old wal archive log which is currently not in Master's pg_xlog directory. 但是我的备用服务器要求一个旧的wal存档日志,该日志当前不在Master的pg_xlog目录中。 But the file exists in the wal archive backup directory. 但是该文件存在于wal归档备份目录中。

How can I configure Standby to read this file from backup directory? 如何配置备用数据库以从备份目录读取此文件? Or any way to manually copy this file to Standby Server ? 或以任何方式手动将此文件复制到备用服务器?

Any help will be appreciated. 任何帮助将不胜感激。

You would have to add a restore_command to recovery.conf that can restore files from the WAL archive. 你将不得不增加一个restore_commandrecovery.conf可以从WAL归档恢复文件。

Then restart the standby, and it should be able to recover. 然后重新启动备用数据库,它应该能够恢复。

When the standby cannot get the required WAL via streaming replication, it tries restore_command . 当备用服务器无法通过流复制获得所需的WAL时,它将尝试restore_command When that fails, it tries streaming replication again, and so on in an endless loop. 如果失败,它将再次尝试流式复制,以此类推。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM