我有Debian 8.2 x64和Postgresql 9.4(从回购)。 我已经在不同的位置像这样重新创build了默认集群:
# service postgresql stop # pg_dropcluster 9.4 main # pg_createcluster -d /srv/postgresql/data/9.4/main 9.4 main -- -W -A md5 # service postgresql start
然后我可以连接到数据库:
# psql -WU postgres
然后我创build了另一个群集:
# pg_createcluster -d /srv/postgresql/data/9.4/apps -p 5433 9.4 apps -- -W -A md5
我可以开始:
# pg_ctlcluster 9.4 apps start
并连接:
# psql -WU postgres -p 5433
但init脚本只启动忽略apps的main集群,如果/etc/postgresql/9.4/apps/start.conf不存在则根据手册页假定自动启动集群。 但是这是我的/etc/postgresql/9.4/apps/start.conf
# Automatic startup configuration # auto: automatically start/stop the cluster in the init script # manual: do not start/stop in init scripts, but allow manual startup with # pg_ctlcluster # disabled: do not allow manual startup with pg_ctlcluster (this can be easily # circumvented and is only meant to be a small protection for # accidents). auto
所以它也应该启动apps群集,或者我误解了一些东西,或者应该有一些其他选项设置?
UPDATE
那么我认为我已经解决了我的问题:
# apt-get install --reintall postgresql-common
在此之后,所有集群都由init脚本控制,并且:
# service postgresql start|stop|restart
影响所有集群。 这很奇怪,因为第一次安装和重新安装没有报告任何错误。