我刚刚在测试我设置的 PostgreSQL 9.4 集群的故障转移时偶然发现了这个错误。在这里,我试图将奴隶提升为新主人:
$ repmgr -f /etc/repmgr/repmgr.conf --verbose standby promote
2014-09-22 10:46:37 UTC LOG: database system shutdown was interrupted; last known up at 2014-09-22 10:44:02 UTC
2014-09-22 10:46:37 UTC LOG: database system was not properly shut down; automatic recovery in progress
2014-09-22 10:46:37 UTC LOG: redo starts at 0/18000028
2014-09-22 10:46:37 UTC LOG: consistent recovery state reached at 0/19000600
2014-09-22 10:46:37 UTC LOG: record with zero length at 0/1A000090
2014-09-22 10:46:37 UTC LOG: redo done at 0/1A000028
2014-09-22 10:46:37 UTC LOG: last completed transaction was at log time 2014-09-22 10:36:22.679806+00
2014-09-22 10:46:37 UTC FATAL: could not open directory "pg_logical/snapshots": No such file or directory
2014-09-22 10:46:37 UTC LOG: startup process (PID 2595) exited with exit code 1
2014-09-22 10:46:37 UTC LOG: aborting startup due to startup process failure
pg_logical/snapshots
dir 实际上存在于主节点上,它是空的。
UPD:我刚刚手动创建了空目录pg_logical/snapshots
,pg_logical/mappings
并且服务器已经启动而没有抱怨。repmgr standby clone
同步时似乎省略了这个目录。但是问题仍然存在,因为我只是好奇这个目录的用途,也许我在设置中遗漏了一些东西。简单地谷歌搜索它并没有产生任何有意义的结果。