Reputation: 704
I am running the latest version of the GitLab CE Omnibus package on CentOS 7. On that same machine I have other Postgres database running. I seem to be unable to change the port of the in-build Postgres instance to 5433, for example.
I have added the two following lines to the /еtc/gitlab/gitlab.rb
postgresql['enable'] = true
postgresql['port'] = 5433
And I have executed the following commands:
# gitlab-ctl reconfigure
# gitlab-rake gitlab:setup
The second of which fails with the following error:
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"gitlabhq_production", "pool"=>10, "username"=>"gitlab", "password"=>nil, "host"=>nil, "port"=>5433, "socket"=>nil}
-- enable_extension("plpgsql")
rake aborted!
PG::Error: 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.5433"?
Upvotes: 1
Views: 1445
Reputation: 95751
I don't use gitlab, so I looked over the installation docs. GitLab doesn't have "its own" PostgreSQL installation. It uses a standard install (a package-based install) for PostgreSQL.
sudo apt-get install -y postgresql postgresql-client libpq-dev
So you could approach your problem in two different ways. Since you already have PostgreSQL installed and running on port 5432 (?), you could just configure GitLab to use that instance.
Or you could set up your new installation of PostgreSQL to listen on port 5433 (set in postgresql.conf), and configure GitLab to use that instance.
Regardless of which way you go, you have to get the listening configuration (PostgreSQL) and the talking configuration (GitLab) to match, and you have to get them both to agree on authentication. PostgreSQL controls authentication through the configuration file pg_hba.conf. Ruby on Rails controls authentication through the configuration file database.yml. I presume GitLab uses some combination of database.yml and gitlab.rb, but I'm not sure about that.
Both PostgreSQL and Rails write log viles that you'll find useful in tracking down the root cause of error messages. PostgreSQL settings are in postgresql.conf (search for "ERROR REPORTING"). The default log file is /var/log/postgresql/postgresql-9.4-main.log for version 9.4 under Ubuntu Linux; CentOS might use a different directory. Rails writes to the project's log/ directory (same level as app, config, test, etc.)
Upvotes: 2