su - gitlab-psql
psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
\password gitlab
gitlab_rails[‘db_password’] = ‘这个就是你刚刚在Postgresql中设置的密码’
firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --reload
vim /etc/gitlab/gitlab.rb
postgresql[‘port’] = 5432
postgresql[‘listen_address’] = ‘0.0.0.0’
postgresql[‘md5_auth_cidr_addresses’] = [‘192.168.0.0/0’]
gitlab-ctl reconfigure
gitlab-ctl restart