1、修改gitlab.rb
vim /etc/gitlab/gitlab.rb
配置为:
postgresql['enable'] = true
postgresql['listen_address'] = '0.0.0.0'
postgresql['port'] = 5432
postgresql['data_dir'] = "/var/opt/gitlab/postgresql/data"
2、gitlab-ctl reconfigure 等待报错
3、修改pg_hba.conf
vim /var/opt/gitlab/postgresql/data/pg_hba.conf
注释Local行、增加下面行
host all all 0.0.0.0/0 trust
4、gitlab-ctl restart
5、连接gitlabhq_production、用户名gitlab
附:本地连接命令
sudo gitlab-rake gitlab:env:info
-sh-4.2$ psql -h /var/opt/gitlab/postgresql -d gitlabhq_production