我们在不同的服务器上有 postgresql 复制。所以今天我在复制集群 postgresql.conf
完成复制后,我用这个命令重新启动了 postgresql:
pg_ctlcluster 9.2 main2 restart
但是它没有重新启动,而是给出了这个错误:
The PostgreSQL server failed to start. Please check the log output.
查看日志,我看到了这个:
2015-06-16 12:18:16 EEST [10655]: [2-1] LOG: received smart shutdown request
2015-06-16 12:18:16 EEST [10661]: [2-1] FATAL: terminating walreceiver process due to administrator command
2015-06-16 12:18:16 EEST [10658]: [1-1] LOG: shutting down
2015-06-16 12:18:16 EEST [10658]: [2-1] LOG: database system is shut down
现在检查日志它显示了最后一次重启日志,但是当我尝试启动服务器时日志没有更新。它说检查日志,但没有新信息,即使我尝试再次启动服务器。
附言我需要在 master 上做些什么吗?
更新
更改 postgresql.conf
设置,开始复制。但是从错误中很难说出哪里出了问题。
这里是我改的设置(改完之后和master上的一样,评论的时候才开始复制):
shared_buffers = 1536MB
effective_cache_size = 3072MB
checkpoint_segments = 15
checkpoint_completion_target = 0.9
autovacuum = on
track_counts = on
work_mem = 25MB
所以正如我所说,评论完这些之后,我就可以开始了。但是不明白为什么它不会让这些设置开始。
最佳答案
如果我是你,并且可以选择升级,我要做的第一件事就是升级到 PostgreSQL 9.4(或更新版本)。在复制方面这样做是有充分理由的 - 一种称为“复制槽”的新功能(请参阅 the announcement)。
简而言之:复制槽比 WAL 归档更健壮且更容易实现(您显然根据您的日志使用)。
在this post您会找到有关实现该功能的综合指南。
关于postgresql - 无法启动 postgresql 复制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30863937/