502错误修复
服务器断电关机,再开机时一般会导致 gitlab 502错误
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| $ gitlab-ctl status run: gitaly: (pid 1072) 689s; run: log: (pid 1071) 689s run: gitlab-monitor: (pid 1101) 689s; run: log: (pid 1090) 689s run: gitlab-workhorse: (pid 1092) 689s; run: log: (pid 1078) 689s run: logrotate: (pid 1115) 689s; run: log: (pid 1097) 689s run: nginx: (pid 1091) 689s; run: log: (pid 1077) 689s run: node-exporter: (pid 1111) 689s; run: log: (pid 1096) 689s run: postgres-exporter: (pid 1113) 689s; run: log: (pid 1098) 689s run: postgresql: (pid 1114) 689s; run: log: (pid 1095) 689s run: prometheus: (pid 14267) 0s; run: log: (pid 1089) 689s run: redis: (pid 1110) 689s; run: log: (pid 1094) 689s run: redis-exporter: (pid 1075) 689s; run: log: (pid 1074) 689s run: sidekiq: (pid 1076) 689s; run: log: (pid 1073) 689s run: unicorn: (pid 14244) 1s; run: log: (pid 1079) 689s # 尝试重启 $ gitlab-ctl restart ok: run: gitaly: (pid 14454) 0s ok: run: gitlab-monitor: (pid 14465) 1s ok: run: gitlab-workhorse: (pid 14469) 0s ok: run: logrotate: (pid 14482) 1s ok: run: nginx: (pid 14508) 0s ok: run: node-exporter: (pid 14514) 0s ok: run: postgres-exporter: (pid 14519) 1s ok: run: postgresql: (pid 14532) 0s ok: run: prometheus: (pid 14544) 0s ok: run: redis: (pid 14549) 0s ok: run: redis-exporter: (pid 14558) 0s ok: run: sidekiq: (pid 14575) 0s ok: run: unicorn: (pid 14587) 0s
# 按照官网的建议 # 如果所有服务都正常(没有down掉)还是502错误的话,重启sidekiq $ gitlab-ctl restart sidekiq
# 或者 $ gitlab-ctl hup unicorn
|
500错误修复
记录一次500错误,是由于强制关掉宿主机导致的,用502错误的修复方法无效果。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| $ gitlab-ctl status *** down: prometheu down: redis ***
$ gitlab-ctl tail
$ gitlab-ctl stop
$ cd /var/opt/gitlab/prometheus $ ls data prometheus.yml $ mv data data_old
$ cd /var/opt/gitlab/redis $ ls dump.rdb redis.conf redis.socket temp-56637.rdb $ mv dump.rdb mump.rdb.bak $ mv temp-56637.rdb temp-56637.rdb.bak $ ls $ mump.rdb.bak redis.conf redis.socket temp-56637.rdb.bak
$ gitlab-ctl start $ gitlab-ctl restart sidekiq $ gitlab-ctl hup unicorn
|