我是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
。从错误消息中,我怀疑是第二个,随之而来的是数据损坏。