gitlab mysql连接失败_GitLab数据库引起的502错误问题及解决方案

1.打开GitLab的主页地址http://192.168.1.123:8888报错:

d31ea04182fb41fd8fb27159a36ed9c7.png

2.重启或检查状态发现都正常。

[root@localhost unicorn]# sudo gitlab-ctl status

run: alertmanager: (pid 98218) 1895s; run: log: (pid 66884) 2683s

run: gitaly: (pid 98231) 1895s; run: log: (pid 66906) 2683s

run: gitlab-monitor: (pid 98242) 1894s; run: log: (pid 66888) 2683s

run: gitlab-workhorse: (pid 98250) 1894s; run: log: (pid 66900) 2683s

run: logrotate: (pid 98263) 1893s; run: log: (pid 66904) 2683s

run: nginx: (pid 98269) 1893s; run: log: (pid 66902) 2683s

run: node-exporter: (pid 98281) 1893s; run: log: (pid 66890) 2683s

run: postgres-exporter: (pid 98291) 1892s; run: log: (pid 66892) 2683s

run: postgresql: (pid 98299) 1892s; run: log: (pid 66894) 2683s

run: prometheus: (pid 98308) 1891s; run: log: (pid 66882) 2683s

run: redis: (pid 98315) 1891s; run: log: (pid 66880) 2683s

run: redis-exporter: (pid 98319) 1891s; run: log: (pid 66886) 2683s

run: sidekiq: (pid 98325) 1890s; run: log: (pid 66898) 2683s

run: unicorn: (pid 98332) 1890s; run: log: (pid 66896) 2683s

3.检查端口号:

[root@localhost unicorn]# netstat -anp |grep 8888

tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 98269/nginx: master

发现端口没有被占用。

4.检查刷新配置:

gitlab-ctl reconfigure

终于发现错误信息:

Running handlers:

There was an error running gitlab-ctl reconfigure:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'

---- Begin output of "bash" "/tmp/chef-script20190308-65247-12ck9rp" ----

STDOUT: rake aborted!

PG::ConnectionBad: could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?

/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:52:in `block (3 levels) in '

/opt/gitlab/embedded/bin/bundle:23:in `load'

/opt/gitlab/embedded/bin/bundle:23:in `'

Tasks: TOP => gitlab:db:configure

(See full trace by running task with --trace)

STDERR:

---- End output of "bash" "/tmp/chef-script20190308-65247-12ck9rp" ----

Ran "bash" "/tmp/chef-script20190308-65247-12ck9rp" returned 1

d0a6b898c51f93636b0e3b5d8b7d9b3c.png

6.解决了以后再次检查端口号:

[root@localhost unicorn]# netstat -anp |grep 8888

tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 98269/nginx: master

unix 3 [ ] STREAM CONNECTED 83131258 98888/postgres: git /var/opt/gitlab/postgresql/.s.PGSQL.5432

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值