gpt4 book ai didi

删除WAL文件后PostgreSQL热备不会启动

转载 作者:行者123 更新时间:2023-11-29 14:23:09 26 4
gpt4 key购买 nike

我有一台 PostgreSQL 9.1 热备服务器。 WAL 文件最终占据了整个 HD,所以我最终删除了所有 WAP 文件。我多么想恢复服务器,所以我运行了:

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

问题是服务器永远不会完全启动。我看到这之后是不停地丢失 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

如何恢复服务器?

最佳答案

您需要从转储(或文件系统副本)重新创建热备用服务器。

有关操作的详细信息,您可以在本手册中找到:High Availability, Load Balancing, and Replication

关于删除WAL文件后PostgreSQL热备不会启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14794370/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com