简体   繁体   English

删除WAL文件后,PostgreSQL热备份将无法启动

[英]PostgreSQL hot standby won't start after deleting WAL files

I have a PostgreSQL 9.1 hot standby server. 我有一个PostgreSQL 9.1热备用服务器。 The WAL files ended up taking up the entire HD so I ended up deleting all the WAP files. WAL文件最终占用了整个HD,所以我最终删除了所有WAP文件。 How I want to bring the server back up so I ran: 我要如何备份服务器,以便运行:

/usr/local/pgsql/bin/pg_ctl start  -D /usr/local/pgsql/data

The problem is the server never fully starts. 问题是服务器永远不会完全启动。 I see this follow by non-stop missing WAL files log outputs: 我看到了不间断的WAL文件丢失日志输出:

server starting
sh-4.1$ LOG:  database system was shut down in recovery at 2013-02-10 03:17:06 UTC
LOG:  entering standby mode
cp: cannot stat `/usr/local/pgsql/wals/0000000100000035000000A4': No such file or directory
LOG:  redo starts at 35/A4943928
LOG:  consistent recovery state reached at 35/A4AE8EB8
LOG:  database system is ready to accept read only connections
LOG:  invalid record length at 35/A4AE8EB8
cp: cannot stat `/usr/local/pgsql/wals/0000000100000035000000A4': No such file or directory
LOG:  streaming replication successfully connected to primary
FATAL:  could not receive data from WAL stream: FATAL:  requested WAL segment 0000000100000035000000A4 has already been removed

How can I get the server back? 如何找回服务器?

You need to recreate the hot standby server from the dump (or filesystem copy). 您需要从转储(或文件系统副本)重新创建热备用服务器。

Details on how to do that you can find in this manual: High Availability, Load Balancing, and Replication 您可以在本手册中找到有关操作方法的详细信息: 高可用性,负载平衡和复制

在以流方式将从属主机连接到主主机之前,请检查所需的wal是否在您要进行初始还原的位置上...由于从中进行初始恢复的wal段不可用,可能会发生上述问题。 ..如果这种情况很好,请在recovery.conf中检查您的restore_command。

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

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