环境配置
CentOS Version | 7.6 |
Gitlab Version | gitlab-ce-13.12.15-ce.0.el7.x86_64 |
下载rpm包
Gitlab历史版本下载地址:https://packages.gitlab.com/gitlab/gitlab-ce(我在这里下载的 gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm 建议使用下载工具进行下载)
wget https://d20rj4el6vkp4c.cloudfront.net/7/8/el/7/package_files/76487.rpm?t=1718811948_59a1b0efcb67106db99181bc8e4ceecdd9b6f3d9
清华大学的镜像站更新比较慢,有的老版本(如13版本)都没有更新到13版本的最新版本
安装依赖
yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python
开始rpm安装gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm文件
rpm -ivh gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm
安装完成关注以下输出,表示已经安装成功
修改gitlab配置文件信息,指定服务ip和端口号
view /etc/gitlab/gitlab.rb
修改内容如下:
将external_url后面的url替换为自己的ip+端口号,(查看端口是否被占用,防火墙是否放开)
添加配置信息
第一次配置信息,需要一定的时间,请耐心等待,直到最后看到gitlab Reconfigured! 表示配置完成。
[root@localhost ~]# gitlab-ctl reconfigure ..... ..... ..... Running handlers: Running handlers complete Chef Client finished, 426/609 resources updated in 02 minutes 55 seconds gitlab Reconfigured!
注:如果发现ip或者端口等配置信息需要更改,每次更改完之后,一定要重新加载配置 gitlab-ctl reconfigure
重启gitlab服务
看到如下的信息,“ok,run ”表示各个模块启动成功。gitlab-ctl start | stop | restart
[root@localhost ~]# gitlab-ctl restart ok: run: alertmanager: (pid 224124) 0s ok: run: gitaly: (pid 224146) 0s ok: run: gitlab-monitor: (pid 224167) 1s ok: run: gitlab-workhorse: (pid 224192) 0s ok: run: logrotate: (pid 224211) 1s ok: run: nginx: (pid 224218) 0s ok: run: node-exporter: (pid 224294) 1s ok: run: postgres-exporter: (pid 224307) 0s ok: run: postgresql: (pid 224318) 0s ok: run: prometheus: (pid 224327) 0s ok: run: redis: (pid 224371) 0s ok: run: redis-exporter: (pid 224376) 1s ok: run: sidekiq: (pid 224393) 0s ok: run: unicorn: (pid 224409) 0s
到这里已经完成了对gitlab的安装
浏览器登陆
浏览器访问,http://ip:端口号
第一次访问,直接进入更改root账号密码的页面,只需要填写密码即可,修改完,直接跳入到登陆页面
进入到gitlab页面后,即可开始创建自己项目(完成)
遇到问题
1、访问首页报502查看后台日志返现两个错误
2024-06-20_01:12:21.24719 {"timestamp":"2024-06-20T01:12:21.245Z","pid":24887,"message":"* Listening on unix:///var/opt/gitlab/gitlab-rails/sockets/gitlab.socket"} 2024-06-20_01:12:21.25125 bundler: failed to load command: puma (/opt/gitlab/embedded/bin/puma) 2024-06-20_01:12:21.25130 Errno::EADDRINUSE: Address already in use - bind(2) for "127.0.0.1" port 8080 2024-06-20_01:12:21.25131 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:288:in `initialize' 2024-06-20_01:12:21.25133 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:288:in `new' 2024-06-20_01:12:21.25134 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:288:in `add_tcp_listener' 2024-06-20_01:12:21.25135 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:168:in `block in parse' 2024-06-20_01:12:21.25139 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:152:in `each' 2024-06-20_01:12:21.25141 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/binder.rb:152:in `parse' 2024-06-20_01:12:21.25142 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/runner.rb:144:in `load_and_bind' 2024-06-20_01:12:21.25143 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/cluster.rb:342:in `run' 2024-06-20_01:12:21.25144 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/launcher.rb:182:in `run' 2024-06-20_01:12:21.25145 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/lib/puma/cli.rb:80:in `run' 2024-06-20_01:12:21.25151 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.1.1/bin/puma:10:in `<top (required)>' 2024-06-20_01:12:21.25194 /opt/gitlab/embedded/bin/puma:23:in `load' 2024-06-20_01:12:21.25197 /opt/gitlab/embedded/bin/puma:23:in `<top (required)>'
第1个报错是:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: connection refused
第2个报错是:Errno::EADDRINUSE: Address already in use - bind(2) for "127.0.0.1" port 8080
在我的环境只解决端口被占用的问题就可以了,把上面“修改gitlab配置文件信息,指定服务ip和端口号”,调整为8082就可以了(重新gitlab-ctl reconfigure/gitlab-ct restart即可)
补充:报8080端口被占用,查看8080端口发现是puma在监听8080端口;经过上诉办法调整成8082后重启,发现监听8082端口的是nginx,8080看来是puma的端口所以冲突了
标签:gems,06,puma,run,lib,步骤,gitlab,CentOS7,Gitlab13 From: https://www.cnblogs.com/mxci/p/18257783