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

问题描述 投票:0回答:1

我是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个回答
0
投票

您必须以多种方式搞砸了。

  • 您已删除或改写了主服务器上的postmaster.pid

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

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

© www.soinside.com 2019 - 2024. All rights reserved.