繁体   English   中英

Postgres 流复制 - 服务器不断关闭

[英]Postgres streaming replication - servers keep shutting down

我是 PostgreSQL 的新手,我正在尝试设置从我们的服务器到我的笔记本电脑上的测试数据库的流式复制。 我一直在关注本教程https://www.percona.com/blog/2018/09/07/setting-up-streaming-replication-postgresql/以及此处的 Postgres 文档https://www.postgresql.org/ docs/11/runtime-config-replication.html

我正在运行 Windows 10、PostgreSQL 11、PostGIS 2.5 扩展。

服务器和我的本地机器都不断关闭,日志中充满了 postmaster.pid 错误,例如:

LOG: performing immediate shutdown because data directory lock file is invalid
LOG: received immediate shutdown request
LOG: could not open file "postmaster.pid": No such file or directory
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.

有人能指出我这里的问题吗? 我知道我的服务器没有正确配置,但我只是不知道需要更改哪些配置。

这是我的备用服务器最新日志的图像。 备用日志这是我的主服务器最新日志的图像。 主日志

你一定在很多方面搞砸了。

  • 您删除或覆盖了主服务器上的postmaster.pid

    这是非常危险的,会导致服务器因您引用的错误消息而死亡。

  • 您在启动备用服务器之前没有创建recovery.conf ,或者您删除了backup_label 从错误消息我怀疑第二个,随之而来的数据损坏。

暂无
暂无

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

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