GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务,用于企业或者私人等源代码的本地管理,功能与Github类似;安装系统为centos8
1、配置yum源,编辑文件 /etc/yum.repos.d/gitlba-ce.repo

系统默认没有改文件,新建该文件

编辑该文件,文件的内容如下
[gitlab-ce]name=Gitlab CE Repositorybaseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/gpgcheck=0enabled=1

2、更新本地yum缓存(要等一段时间,根据网络情况不同)

3、安装gitlab社区版最新版

询问是否要确定要下载,确认进行下载(需要等一段时间,根据网络状况不同)

下载失败了,看提示是镜像连接超时,没办法,只能自己手动下载了
找到要下载的包:https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-13.4.3-ce.0.el8.x86_64.rpm

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-13.4.3-ce.0.el8.x86_64.rpm/download.rpm

下载完毕之后进行安装
rpm -ivh gitlab-ce-13.4.3-ce.0.el8.x86_64.rpm

安装成功,启动所有组件sudo gitlab-ctl start,启动服务sudo gitlab-ctl reconfigure,时间比较长,需要等一会

查看一下状态,都已经启动了

gitlab常用命令(来自网络):
sudo gitlab-ctl start # 启动所有 gitlab 组件;sudo gitlab-ctl stop # 停止所有 gitlab 组件;sudo gitlab-ctl restart # 重启所有 gitlab 组件;sudo gitlab-ctl status # 查看服务状态;sudo gitlab-ctl reconfigure # 启动服务;sudo vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;sudo gitlab-ctl tail # 查看日志;
4、用浏览器访问gitlab,http://ip,发现无法访问,因为默认防火墙处于打开状态

关闭防火墙

再次访问http://ip,可以正常访问,设置root密码,可以正常使用了


本文介绍了在CentOS8系统上安装GitLab的详细过程,包括配置yum源,安装最新社区版,解决镜像连接超时问题,手动下载安装包,启动并检查GitLab服务,以及如何关闭防火墙以实现正常访问。通过这些步骤,最终成功设置了GitLab并能用root密码登录使用。
529

被折叠的 条评论
为什么被折叠?



