CentOS7安装Gitlab13详细步骤

news/2024/9/24 6:28:14

环境配置

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的端口所以冲突了

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/46618.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

解决JS跨域访问的问题

在被访问 的服务器IIS中 Access-Control-Allow-Origin 添加请求的服务器的域名

mysql数据表插入数据后,获取自增字段值的方法

mysql数据表插入数据后,获取自增字段值的方法 mysql数据表如果有字段的值是自增的,即创建表时该字段使用了auto_increment,当插入数据时,获取该字段自增值的方法是select LAST_INSERT_ID()或者select @@IDENTITY,这两种方法都是面向数据库连接(connection)的,即只要…

基于BP神经网络的64QAM解调算法matlab性能仿真

1.算法运行效果图预览 2.算法运行软件版本 MATLAB2022A3.部分核心程序% 第一部分:加载并可视化数据 % load data.mat real1 = [-7 -7 -7 -7 -7 -7 -7 -7 -5 -5 -5 -5 -5 -5 -5 -5 ...-1 -1 -1 -1 -1 -1 -1 -1 -3 -3 -3 -3 -3 -3 -3 -3 ...+7 +7 +7 +7 +7 +7 +7 +7 +5 +5 +5 +5…

testng + mockito + spring boot test 基本操作

代码地址 https://gitee.com/bzrj/thresh-boot 如何使用在 thresh-dependencies 目录执行 mvn clean install 在跟目录执行 make效果 jacocoallure关键配置 thresh-test此模块包含了测试需要的依赖 定义了两个 testng 监听thresh-report 此模块专门用于聚合 jacoco 和 allure 的…

【球类识别系统】图像识别Python+卷积神经网络算法+人工智能+深度学习+TensorFlow

一、介绍 球类识别系统,本系统使用Python作为主要编程语言,基于TensorFlow搭建ResNet50卷积神经网络算法模型,通过收集 美式足球, 棒球, 篮球, 台球, 保龄球, 板球, 足球, 高尔夫球, 曲棍球, 冰球, 橄榄球, 羽毛球, 乒乓球, 网球, 排球等15种常见的球类图像作为数据集,然后…

[春秋云镜] Initial

Initial是一套难度为简单的靶场环境,完成该挑战可以帮助玩家初步认识内网渗透的简单流程。该靶场只有一个flag,各部分位于不同的机器上。[春秋云镜] Initial**整套网络环境拓扑:**​​ 一、打进内网 开局一个ip:39.101.184.25,fscan扫一下 ​​ 存在thinkphp5.0.23的漏洞,…

Vite-Wechat网页聊天室|vite5.x+vue3+pinia+element-plus仿微信客户端

基于Vue3+Pinia+ElementPlus仿微信网页聊天模板Vite5-Vue3-Wechat。 vite-wechat使用最新前端技术vite5+vue3+vue-router@4+pinia+element-plus搭建网页端仿微信界面聊天系统。包含了聊天、通讯录、朋友圈、短视频、我的等功能模块。支持收缩侧边栏、背景壁纸换肤、锁屏、最大化…

6月27日云技术研讨会 | 中央集中架构新车型功能和网络测试解决方案

会议摘要“软件定义汽车”新时代下,整车电气电气架构向中央-区域集中式发展已成为行业共识,车型架构的变革带来更复杂的整车功能定义、更多的新技术的应用(如SOA服务化、TSN等)和更短的车型研发周期,对整车和新产品研发的质量验证提出更高的要求。本次研讨会经纬恒润将结合…