CICD实战(二)-----gitlab的安装与配置

1、安装gitlab所需要的依赖包与工具

bash 复制代码
sudo yum install wget net-tools
sudo yum install curl policycoreutils openssh-server openssh-clients postfix -y

2、配置清华源

bash 复制代码
vim /etc/yum.repo.d/gitlab-ce.repo

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

3、安装git、gitlab

可以分别安装Git客户端和Gitlab社区版(Gitlab有两大版本,ee为商业版本,ce为社区版本)。安装包较大,大约有1个G左右,因此需要我们耐心等待。

bash 复制代码
yum install -y git gitlab-ce

4、下载完成执行启动命令

bash 复制代码
gitlab-ctl reconfigure

5、gitlab启动后,可以查看设备监听端口

bash 复制代码
netstat -lnt

6、查看gitlab的状态

bash 复制代码
gitlab-ctl status

7、访问gitlab的web页面
http://192.168.242.154

尝试访问Gitlab的web页面(注:可能需要等待较长时间),接下来,会进入一个设置密码的页面,(注意,由于一些BUG,有可能我们无法进入到设置密码页面,此时Gitlab就无法登录,这时我们需要重置Gitlab的密码

有时,我们因为长时间没有使用Gitlab,而忘记了管理员用户的密码,从而导致无法登录系统的状况,又或者是由于系统BUG,Gitlab在初次安装完成后,没有出现设置密码的页面,直接出现了登录的页面,从而导致我们无法继续登录配置使用。出现这种情况,我们就需要重置Gitlab的密码了。

首先,在Gitlab设备上,执行命令:

bash 复制代码
gitlab-rails console -e production

之后,执行以下命令

bash 复制代码
user=User.where(id:1).first
user.password='zxc000...'
user.password_confirmation='zxc000...'
user.save


#exit退出来
exit

完成上述配置,就可以去web登录了,账号root,密码为刚才修改的,如果没有生效的话,重启一下gitlab

相关推荐
百思可瑞教育11 分钟前
Spring Cloud Gateway 负载均衡全面指南
运维·负载均衡·北京百思可瑞教育·百思可瑞教育·北京百思教育
hello_ world.21 分钟前
RHCA10NUMA
linux
神秘人X7071 小时前
Linux高效备份:rsync + inotify实时同步
linux·服务器·rsync
轻松Ai享生活1 小时前
一步步学习Linux initrd/initramfs
linux
轻松Ai享生活1 小时前
一步步深入学习Linux Process Scheduling
linux
绵绵细雨中的乡音3 小时前
网络基础知识
linux·网络
Peter·Pan爱编程3 小时前
Docker在Linux中安装与使用教程
linux·docker·eureka
kunge20134 小时前
Ubuntu22.04 安装virtualbox7.1
linux·virtualbox
清溪5494 小时前
DVWA中级
linux
MUY09904 小时前
应用控制技术、内容审计技术、AAA服务器技术
运维·服务器