Friday, April 22, 2022

[SOLVED] How to configure gitlab to use existing postgres server

Issue

When installing Gitlab by default Nginx and Postgres .. among other things are installed regardless of whether you have them already or not. So since I have these two already, I am trying to configure gitlab to use them, I have done this for Nginx, Using:

$ vi /etc/gitlab/gitlab.rb:

# Disable GitLab's nginx completely
nginx['enable'] = false

# Set external web user which is 'nginx' on CentOS 7
web_server['external_users'] = ['nginx']

but I need to know how to do the same postgres.


Solution

According to this doc, put this in /etc/gitlab/gitlab.rb :

# Disable the built-in Postgres
postgresql['enable'] = false

# Fill in the values for database.yml
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['db_host'] = '127.0.0.1'
gitlab_rails['db_port'] = '5432'
gitlab_rails['db_username'] = 'foo'
gitlab_rails['db_password'] = 'bar'

And run this command to apply this values : sudo gitlab-ctl reconfigure. Also you need to seed your database if you choose an external one. This command will do it with omnibus-gitlab: sudo gitlab-rake gitlab:setup



Answered By - PierreF
Answer Checked By - Candace Johnson (WPSolving Volunteer)