自定义PostgreSQL端口后,ctl reconfigure失败

我在Ubuntu 12.04上使用Open Source Chef 11.0.10。 这是一个PostgreSQL和Apache已经运行的共享服务器,所以我试图自定义Chef端口号。

我创建了文件/etc/chef-server/chef-server.rb,其中包含以下行:

nginx['ssl_port'] = 8443
postgresql['port'] = 5433

当我执行命令时:

sudo chef-server-ctl reconfigure

它失败了:

execute[/opt/chef-server/embedded/bin/createdb -T template0 -E UTF-8 opscode_chef] action run

并且错误消息说:

---- Begin output of /opt/chef-server/embedded/bin/createdb -T template0 -E UTF-8 opscode_chef ----
STDOUT:
STDERR: createdb: could not connect to database template1: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
---- End output of /opt/chef-server/embedded/bin/createdb -T template0 -E UTF-8 opscode_chef ----

现在,除了原始实例之外,PostgreSQL的Chef实例似乎还在运行:

$ ps -ef | grep postgresql | grep -v grep
postgres  1000     1  0 09:14 ?        00:00:00 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf
root      4830  4421  0 09:46 ?        00:00:00 runsv postgresql
root      4831  4830  0 09:46 ?        00:00:00 svlogd -tt /var/log/chef-server/postgresql
998       5579  4830  0 09:49 ?        00:00:00 /opt/chef-server/embedded/bin/postgres -D /var/opt/chef-server/postgresql/data

我错过了什么?

更多细节:

我曾使用omnibus软件包进行初始厨师服务器安装:

https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.10-1.ubuntu.12.04_amd64.deb

它在完成之前以相同的错误完成失败,因为它尝试使用已在使用的默认PostgreSQL端口。

厨师PostgreSQL实例正在运行:

$ sudo /opt/chef-server/embedded/bin/sv status postgresql
run: postgresql: (pid 5579) 86034s; run: log: (pid 4831) 86158s

我放弃了试图让Chef的PostgreSQL实例配置为使用不同的端口。

相反,我将现有的PostgreSQL安装的端口号修改为5433,并让Chef的实例使用5432.现在,“chef-server-ctl reconfigure”命令成功完成。


检查postgresql日志文件

tail -f /var/log/chef-server/postgresql/current

2015-02-28_13:29:01.48646致命:无法创建锁定文件“/tmp/.s.PGSQL.5432.lock”:权限被拒绝2015-02-28_13:29:02.57961致命:无法创建锁定文件“/ tmp / .s.PGSQL.5432.lock“:权限被拒绝2015-02-28_13:29:02.57961致命:无法创建锁定文件”/tmp/.s.PGSQL.5432.lock“:权限被拒绝

我的问题是解决运行下面的命令

chmod 777 /tmp
链接地址: http://www.djcxy.com/p/78307.html

上一篇: ctl reconfigure fails after customizing the PostgreSQL port

下一篇: Minimize service restarts from chef notifications?