背景
安装gitlab时候,8080端口被jenkins应用占用,启动gitlab时页面报502错误。
服务器运行gitlab检查:gitlab-rake gitlab:check 后发现有报错
Internal API available: FAILED - Internal API error (502)
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml
Please fix the error above and rerun the checks.
解决方法
修改/etc/gitlab/gitlab.rb 中puma端口(我的做法是放开puma所有配置,仅供参考)
[root@ZDHYW-154 gitlab]# cat /etc/gitlab/gitlab.rb | grep -E -v “#|$”
external_url ‘http://10.13.101.154:8092’
#gitlab_workhorse[‘auth_backend’] = “http://localhost:8080”
puma[‘enable’] = true
puma[‘ha’] = false
puma[‘worker_timeout’] = 60
puma[‘worker_processes’] = 2
puma[‘min_threads’] = 4
puma[‘max_threads’] = 4
puma[‘listen’] = ‘127.0.0.1’
puma[‘port’] = 8081
puma[‘socket’] = ‘/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket’
puma[‘somaxconn’] = 1024
puma[‘pidfile’] = ‘/opt/gitlab/var/puma/puma.pid’
puma[‘state_path’] = ‘/opt/gitlab/var/puma/puma.state’
puma[‘log_directory’] = “/var/log/gitlab/puma”
puma[‘per_worker_max_memory_mb’] = 850
puma[‘exporter_enabled’] = false
puma[‘exporter_address’] = “127.0.0.1”
puma[‘exporter_port’] = 8083
然后gitlab-ctl reconfigure
gitlab-ctl restart