加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-13 15:56:55 所属栏目:百科 来源:网络整理
导读:我在Ubuntu 12.04上使用Open Source Chef 11.0.10.这是PostgreSQL和Apache已经运行的共享服务器,所以我正在尝试自定义Chef端口号. 我创建了文件/etc/chef-server/chef-server.rb,其中包含以下行: nginx['ssl_port'] = 8443postgresql['port'] = 5433 当我执
我在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包进行初始的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 reconfigure”命令成功完成.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读