自定义PostgreSQL端口后,chef server ctl重新配置失败

自定义PostgreSQL端口后,chef server ctl重新配置失败,postgresql,chef-infra,Postgresql,Chef Infra,我正在Ubuntu 12.04上使用开源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/ch

我正在Ubuntu 12.04上使用开源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软件包进行了chef server的初始安装:

https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.10-1.ubuntu.12.04_amd64.deb
它在同一步骤完成之前失败,并出现相同的错误,因为它正在尝试使用已在使用的默认PostgreSQL端口

并且Chef 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 reconforme”命令成功完成。

检查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

该用户有创建数据库的权限吗?我似乎无法连接到Chef PostgreSQL实例来确定opscode_Chef用户是否存在。命令“psql-p 5433-U postgres”返回错误“是在本地运行并接受Unix域套接字上的连接的服务器’/var/run/postgresql/.s.PGSQL.5433’”,即使我已将该实例配置为将其pid和套接字文件写入/var/run/postgresql chef/。任何提示都会有帮助!我指的是opscode_厨师“数据库”。我试图使用psql与“postgres”用户(通常是默认的db用户)连接到Chef PostgreSQL实例,以便列出数据库。我放弃了使用其他端口获取Chef的PostgreSQL实例的尝试。相反,我将默认PostgreSQL安装的端口号修改为5433,让Chef使用5432。现在,“厨师服务器CTL重新配置”命令成功地完成了。请考虑回答您自己的问题,这仍然是一个问题:(是的,因为您的问题是不同的——“不能创建锁文件”,而原始的问题是“不能连接到数据库”。