After configuring the PostgreSQL port, the chef-server-ctl configuration fails

I am using Open Source Chef 11.0.10 on Ubuntu 12.04. This is a shared server on which PostgreSQL and Apache are already running, so I'm trying to set up Chef port numbers.

I created a file / etc / chef -server / chef-server.rb that contains the lines:

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

When I execute the command:

sudo chef-server-ctl reconfigure

It does not work on the line:

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

and the error message says:

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

Now the Chef PostgreSQL instance seems to work in addition to the original instance:

$ 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

What did I miss?

More details:

I used the omnibus package to set up the initial setup of the 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

This failed at the same step with the same error, because it is trying to use the default PostgreSQL port that is already in use.

And the Chef PostgreSQL instance is executed:

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

, Chef PostgreSQL .

PostgreSQL 5433, Chef 5432. "chef-server-ctl reconfigure" .

+4

postgresql

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

2015-02-28_13: 29: 01.48646 FATAL: "/tmp/.s.PGSQL.5432.lock" : 2015-02-28_13: 29: 02.57961 FATAL: "/tmp/.s.PGSQL.5432.lock" : 2015-02-28_13: 29: 02.57961 FATAL: "/tmp/.s.PGSQL.5432.lock" : Permission denied

chmod 777 /tmp
+1

Source: https://habr.com/ru/post/1526593/


All Articles