【问题标题】:Postgres streaming replication - servers keep shutting downPostgres 流式复制 - 服务器不断关闭
【发布时间】:2020-03-10 17:52:47
【问题描述】:

我是 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.

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

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

【问题讨论】:

    标签: postgresql streaming replication


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 感谢您的反馈。我想此时我只需要在两台机器上重新安装 PostgreSQL。幸好这只是一个测试环境!
    猜你喜欢
    • 1970-01-01
    • 2013-04-25
    • 1970-01-01
    • 2023-03-03
    • 2013-02-03
    • 2021-11-13
    • 1970-01-01
    • 2013-07-29
    • 1970-01-01
    相关资源
    最近更新 更多