gitlab 打开页面出现502错误解决办法
|
GitLab常用命令 sudogitlab-ctlstart#启动所有gitlab组件; sudogitlab-ctlstop#停止所有gitlab组件; sudogitlab-ctlrestart#重启所有gitlab组件; sudogitlab-ctlstatus#查看服务状态; sudogitlab-ctlreconfigure#重新配置更新 sudovim/etc/gitlab/gitlab.rb#修改默认的配置文件; gitlab-rakegitlab:checkSANITIZE=true--trace#检查gitlab; sudogitlab-ctltail#查看日志; 解决思路: 1.首先确认部署gitlab机器硬件是否满足条件:cpu:2核和内存:8g (最低性能要求),如果不满足,该问题只能通过更换机器解决。 2.检查gitlab是否是使用8080端口,且8080端口是否被抢占使用(大部分都是改原因导致) 修改gitlab的默认端口 >>>vim/etc/gitlab/gitlab.rb #大概在240行左右 unicorn['listen']='127.0.0.1' unicorn['port']=8181 #每次重新配置,都需要执行sudogitlab-ctlreconfigure >>>sudogitlab-ctlreconfigure 3. 检查gitlab的状态,查看nginx日志,查看进程状态,在做判断。 使用gitlab-ctl status命令查看gitlab的状态 >>>gitlab-ctlstatus run:logrotate:(pid21402)86s;run:log:(pid1209)3957915s run:nginx:(pid21457)85s;run:log:(pid1207)3957915s run:postgresql:(pid22444)44s;run:log:(pid1201)3957915s run:redis:(pid21790)73s;run:log:(pid1200)3957915s run:sidekiq:(pid22443)44s;run:log:(pid1205)3957915s run:unicorn:(pid1096)55171s,gotTERM;run:log:(pid1202)3957915s 查看gitlab的错误日志记录 >>>cd/var/log/gitlab/nginx/ >>>catcatgitlab_error.log 2018/08/0703:12:32[error]27179#0:*56upstreamprematurelyclosedconnectionwhilereadingresponseheaderfromupstream,client:192.168.3.240,server:192.168.3.99,request:"GET/HTTP/1.1",upstream:"http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/",host:"192.168.3.99:12345" 2018/08/0703:17:52[error]21461#0:*1connect()tounix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socketfailed(111:Connectionrefused)whileconnectingtoupstream,client:192.168.3.221,host:"192.168.3.99:12345" 2018/08/0703:21:37[error]21462#0:*3connect()tounix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socketfailed(111:Connectionrefused)whileconnectingtoupstream,host:"192.168.3.99:12345" 使用命令:gitlab-ctl tail用来获取详细信息 >>>gitlab-ctltail ==>/var/log/gitlab/postgresql/current<== 2019-12-24_10:30:01.87878FATAL:couldnotwritelockfile"postmaster.pid":Nospaceleftondevice ==>/var/log/gitlab/unicorn/current<== 2019-12-24_10:30:02.15926masterfailedtostart,checkstderrlogfordetails ==>/var/log/gitlab/postgresql/current<== 2019-12-24_10:30:02.90281FATAL:couldnotwritelockfile"postmaster.pid":Nospaceleftondevic 比如这里提示错误:could not write lock file "postmaster.pid": No space left on device,告诉我们由于电脑硬盘没有空余存储空间来存储postmaster.pid文件,导致启动失败。 参考文章: (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
