我们有一个Postgres 11集群,其中包含一个主服务器和一个热复制服务器。复制服务器已停止工作很长一段时间。但是,主服务器遇到了意外的电源故障。之后,它无法重新启动,日志显示:
2021-05-10 10:20:09.134 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-05-10 10:20:09.134 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-05-10 10:20:09.137 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-05-10 10:20:09.245 UTC [22] LOG: database system was shut down at 2021-05-10 09:30:22 UTC
2021-05-10 10:20:09.248 UTC [22] PANIC: replication slot file "pg_replslot/replica_1_slot/state" has wrong magic number: 842020920 instead of 17112225
2021-05-10 10:20:09.531 UTC [1] LOG: startup process (PID 22) was terminated by signal 6
2021-05-10 10:20:09.531 UTC [1] LOG: aborting startup due to startup process failure
2021-05-10 10:20:09.546 UTC [1] LOG: database system is shut down有没有办法解决这个问题?非常感谢。
发布于 2021-05-10 22:59:39
关闭PostgreSQL,转到数据目录并运行
rm -r pg_replslot/replica_1_slot如果这是您唯一的问题,那么像这样移除复制插槽就可以解决它。
然而,复制槽通常不会像那样被损坏。可能还有其他损坏的文件。
如果您可以像这样启动服务器,请立即执行pg_dumpall,如果成功,则将其恢复到不同硬件上的新集群。如果无法启动服务器,请对数据目录进行文件系统备份。
测试您的硬件,这可能是问题所在。
https://stackoverflow.com/questions/67468768
复制相似问题