GitLab复习资料整理

GitLab通过YUM最新版本介绍与部署

GitLab是一个用于仓库管理系统的开源项目,基于Git实现在线仓库托管软件,你可以使用GitLab搭建一个类似于Github一样的系统,并在此基础上搭建起来的Web服务。
一个基于GIT的源码托管解决方案。
基于Ruby on rails开发。
集成了Nginx Redis PostgreSQL Sidekiq Prometheus等组件。
GitLab官方地址:https://about.gitlab.com/
清华大学GitLab镜像地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
GitLab官方文档:https://docs.gitlab.com/ee/administration/index.html

GitLab版本

GitLab分为社区版(CE)和企业版(EE)

  • 开源GitLab社区版(CE)
  • 开放核心GitLab企业版(EE)

GitLab安装条件

存储条件

存储空间一定要大于你想存储在GitLab中存储库中的数据大小,一定要在存储库中拥有空闲空间。
如果你希望将来灵活扩展硬盘空间,请考虑LVM进行安装,以便在需要时添加更多的硬盘。
除本地硬盘外,你还可以使用NFS存储、NAS存储,SAN或AWS及EBS存储卷上
如果你有足够的内存和CPU,GitLab的主要速度受硬盘磁道的时间限制,拥有磁盘7200转及以上或者SSD将提高GitLab的响应能力

处理器件
  • 1个核心最多支持100个用户,但由于所有工作和后台作业都在同一个核心上运行,因此应用程序可能会慢一点
  • 2核是建议的核心数,最多支持500个用户
  • 4个核心最多可支持2,000个用户
  • 8个核心最多可支持5,000个用户
  • 16个内核最多可支持10,000个用户
  • 32个核心最多可支持20,000个用户
  • 64个内核最多可支持40,000个用户
内存条件

官网给出:你至少拥有8G内存(物理内存➕交换内存)来安装和使用Gitlab操作系统和任何其他正在运行的应用程序也将使用内存,因此请记住,在运行GitLab之前,至少需要4GB可用内存。在内存更少的情况下,GitLab在重新配置运行期间会出现奇怪的错误,在使用期间会出现500个错误。

  • 4GB RAM + 4GB交换支持最多100个用户,但速度非常慢
  • 所有安装的建议内存大小为8GB RAM,最多支持100个用户
  • 16GB RAM最多支持2,000个用户
  • 32GB RAM最多支持4,000个用户
  • 64GB RAM最多可支持8,000个用户
  • 128GB RAM最多支持16,000个用户
  • 256GB RAM支持最多32,000个用户

官方建议:建议服务器上至少有2GB的swap空间,即使您当前有足够的可用内存。如果可用内存发生变化,交换将有助于减少发生错误的可能性。我们还建议将核的swappiness设置配置 为较低的值,10以便充分利用RAM,同时在需要时仍然可以使用交换。

GitLab部署

安装依赖

1.安装依赖包

[root@abcops_node2 ~]# yum install -y curl policycoreutils-python openssh-server

2.安装Postfix来发送通知邮件

[root@abcops_node2 ~]# yum install postfix -y
[root@abcops_node2 ~]# systemctl enable postfix
[root@abcops_node2 ~]# sed -i 's/inet_interfaces = localhost/inet_interfaces = all/g' /etc/postfix/main.cf
[root@abcops_node2 ~]# systemctl start postfix      或者  /usr/sbin/postfix start

img

3.安装GitLab
安装GitLab我们可以使用两种源,一种是到清华大学镜像源去下载,一种是使用GitLab官网的镜像源,GitLab服务器在国外,下载速度不理想
以下线讲解使用清华大学镜像源部署再使用GitLab官方源部署

清华大学源进行部署

#清华大学镜像源如下
[root@abcops_node2 ~]# vim /etc/yum.repos.d/tuna_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
[root@abcops_node2 ~]# yum makecache
[root@abcops_node2 ~]# yum list | grep gitlab-ce
gitlab-ce.x86_64                        12.0.3-ce.0.el7                gitlab-ce
[root@abcops_node2 ~]# yum install gitlab-ce.x86_64 -y

img

安装完成了,一个小狐狸头,还挺好看
在这里插入图片描述

安装好之后修改GitLab默认的URL为自己的IP地址或者域名

[root@abcops_node2 ~]# sed -i 's@http://gitlab.example.com@http://10.211.55.12@g' /etc/gitlab/gitlab.rb

重置配置文件

[root@abcops_node2 ~]# gitlab-ctl reconfigure

GitLab目录介绍

GitLab组件介绍

经过上面的重置配置文件过后,我们可以使用gitlab-ctl status看到GitLab的所有组件

[root@abcops_node2 ~]# gitlab-ctl status
run: alertmanager: (pid 20440) 56s; run: log: (pid 20133) 102s                      #结合prometheus监控系统的告警组件
run: gitaly: (pid 20285) 59s; run: log: (pid 19661) 183s                            #提供对Git存储库的高级RPC访问,Gitaly是一个Git RPC服务,用于处理GitLab发出的所有git调用
run: gitlab-monitor: (pid 20330) 58s; run: log: (pid 20051) 116s                    #gitlab监控组件
run: gitlab-workhorse: (pid 20308) 59s; run: log: (pid 19911) 135s                  #gitlab轻量级反向代理服务器
run: grafana: (pid 20462) 55s; run: log: (pid 20251) 72s                            #grafana监控图形展示组件
run: logrotate: (pid 19932) 129s; run: log: (pid 19957) 128s                        #日志文件管理工具
run: nginx: (pid 19902) 135s; run: log: (pid 19925) 134s                            #GitLab使用Nginx作为静态Web服务器
run: node-exporter: (pid 20324) 58s; run: log: (pid 20031) 122s                     #容器监控组件
run: postgres-exporter: (pid 20454) 56s; run: log: (pid 20173) 98s                  #psql数据库监控系统
run: postgresql: (pid 19686) 180s; run: log: (pid 19735) 177s                       #GitLab采用postgresql作为数据库
run: prometheus: (pid 20423) 57s; run: log: (pid 20100) 108s                        #prometheus监控系统
run: redis: (pid 19530) 192s; run: log: (pid 19542) 189s                            #redis用户会话,缓存,Sidkiq的队列
run: redis-exporter: (pid 20335) 58s; run: log: (pid 20074) 112s                    #redis缓存数据库监控系统
run: sidekiq: (pid 19869) 142s; run: log: (pid 19887) 139s                          #用于在后台执行队列任务(异步执行)
run: unicorn: (pid 19838) 148s; run: log: (pid 19865) 145s                          #Web请求(UI,API,Git,over,HTTP)
GitLab目录介绍:

1.GitLab各个组件日志目录

/var/log/gitlab/

在这里插入图片描述

2.GitLab各个组件的应用路径及gitlab-ctl reconfigure命令编译后的应用和配置文件

/var/opt/gitlab/

在这里插入图片描述

3.GitLab默认存储库位置

/var/opt/gitlab/git-data/repositories/

4.GitLab应用代码和相应的依赖程序

/opt/gitlab/

5.GitLab配置文件目录

/etc/gitlab

img

6.GitLab备份文件目录

/var/opt/gitlab/backups/

GitLab-ctl常用命令介绍

gitlab-ctl reconfigure:重置配置文件
gitlab-ctl show-config:验证配置文件
gitlab-ctl restart:重启GitLab
gitlab-ctl start:启动GitLab
gitlab-ctl stop:关闭GitLab
gitlab-ctl status:查看GitLab状态
gitlab-ctl tail nginx:查看gitlab中的nginx日志(动态查看),如果要看其它组件日志,把Nginx换成组件名称即可

GitLab进程

GitLab默认包含很多组件一起启动,我们可以查看GiLab的进程状态

在这里插入图片描述

还可以使用ps -ef|grep 组件名称来查看各个组件的进程

访问GitLab

GitLab默认使用80端口对外提供服务
访问地址:http://ip
首次访问会让你设置密码,需要八位密码
在这里插入图片描述

密码设置过后进行登录
默认的账号为root,密码为你刚才设置的密码
在这里插入图片描述
在这里插入图片描述

GitLab常用配置使用

创建对象

创建用户

新建用户
在这里插入图片描述

输入用户的相关信息
在这里插入图片描述

我这边随后又创建了dev1和dev2两个用户
在这里插入图片描述

创建用户组

在这里插入图片描述

把用户加入到用户组
在这里插入图片描述

创建项目

在这里插入图片描述

为项目添加用户

把我们刚创建的三个用户加入abcops-project项目中

[img
img

img
我把其它两个用户也加入了进来
img

这里可以看到该项目中的所有用户
img

修改用户密码

img
img
img

下面可以修改用户的密码及属性信息
img

最下面有个Save changes保存键,记得保存!!!

然后退出登录,使用我们新建的用户登录,首次登录会让用户修改密码
img

然后再重新登录

SSH KEY管理

我们新建的用户登录后,开始导入密钥

个人SSH KEY

img
img

每个机器上的ssh key是唯一的,一般我们一个账号对应一个开发者,一个开发者对应一台电脑,在开发者的电脑上生成key,然后把开发者电脑生成的key复制到开发者用户的ssh keys中,以下针对Linux、Windows、Mac OX来分别对应不用的用户导入Key
Linux对应dev1用户
Windows对应dev2用户
Mac OS对应leader领导

Linux生成Key
Linux是dev1用户的电脑
作为开发者客户端,肯定是需要使用git来上传代码到gitlab仓库的,我们这里安装下仓库

#yum安装
yum install git -y

#源码安装请参考:https://abcops.cn/git-installation-in-each-position/
#使用ssh-keygen来生成key,下面选项直接回车即可
[root@abcops_node2 /]# ssh-keygen   
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:0Y9Qah2VJ4a82PPrpgc5aG7ubMkEnvwraWyAAiRHxeY root@abcops_node2
The key's randomart image is:
+---[RSA 2048]----+
| ..o.    .oo..   |
|... o    =o.+ .  |
|o. o    =ooo o   |
|.   E ...o+o     |
|.  . o oS..+.    |
|. . . + + + .    |
| .   o B . o .   |
|      *.B   +    |
|     o *=..=.    |
+----[SHA256]-----+
[root@abcops_node2 /

把生成的公钥导入GitLab用户的ssh key
id_rsa:私钥
id_rsa.pub:公钥
复制以下公钥

img
img

Linux的Key就导入完成了

Windows生成Key
Windows对应的用户为dev2
Windows客户端需要通过git客户端来生成ssh key
所以我们要先在windows上安装git客户端
1.下载git的win版本

下载地址:https://git-scm.com/download/win

2.安装git客户端
以下简要说几个关键步骤

img
img

3.win git客户端生成ssh key密钥
安装完成后,右键选择git bash或者cmd命令行
img

同样使用ssh-keygen来生成密钥

img

生成过之后可以看到密钥在我们当前用户下的.ssh下
img

查看并复制公钥文件
img

填入gitlab中dev2用户的ssh key中
img

Mac OS生成Key
Mac 对应的用户为leader

1.Mac OS安装Git客户端

XuWeiLiang-abcops:~ xuweiliang$ brew info git                   #查看git信息
XuWeiLiang-abcops:~ xuweiliang$ brew install git -y             #安装git

2.Mac生成Key

XuWeiLiang-abcops:~ xuweiliang$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xuweiliang/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/xuweiliang/.ssh/id_rsa.
Your public key has been saved in /Users/xuweiliang/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:VpzhIZiaOtR2gmukGDLeeL7FOVHx+3zd9/u5JTQlvRI xuweiliang@XuWeiLiang-abcops
The key's randomart image is:
+---[RSA 2048]----+
|       +. o      |
|      o o+ +   . |
|   o o . .=  E. o|
|+ + * o  ..   .o.|
|+*o+ +  S.   .o. |
|oo=o. o.  o  .o..|
| .o. =     o ...+|
|   .. .     .  .=|
|   ..          +*|
+----[SHA256]-----+

3.查看公钥并复制到GitLab中

imgimg

Git上传拉取操作

开发者客户端操作:
1.克隆GitLab中的项目到本地
以下的git@xx是在gitlab的项目中所提供,客户端有两种方式和gitlab建立连接,但是一般我们都是用ssh密钥方式,安全

img

[root@abcops_node2 /]# git clone git@10.211.55.12:root/abcops-project.git

img

2.创建代码的一个分支

#首先我们要先进入项目abcops-project路径内
[root@abcops_node2 /]# cd /abcops-project/

#创建一个名叫code的分支
[root@abcops_node2 abcops-project]# git checkout -b code

#查看分支状态
[root@abcops_node2 abcops-project]# git status

3.编写代码

[root@abcops_node2 abcops-project]# echo "<h1>Welocome to abcops</h1>"  > index.html

4.提交代码

#全局设置
[root@abcops_node2 abcops-project]# git config --global user.name "dev1"        #输入此开发者客户端在gitlab中的用户名
[root@abcops_node2 abcops-project]# git config --global user.email "dev1@abcops.com"    #输入此开发者客户端在gitlab中的邮箱
[root@abcops_node2 abcops-project]# git add index.html      或者 git add .                #将文件内容添加到索引中,git add .是将当前目录都添加到索引中
[root@abcops_node2 abcops-project]# git commit -m "index.html"                  #提交我们的代码
[code (root-commit) e148e93] index.html
 1 file changed, 1 insertion(+)
 create mode 100644 index.html

5.上传代码到GitLab存储库中

[root@abcops_node2 abcops-project]# git push -u origin code
Counting objects: 3, done.
Writing objects: 100% (3/3), 235 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: 
remote: A default branch (e.g. master) does not yet exist for root/abcops-project
remote: Ask a project Owner or Maintainer to create a default branch:
remote: 
remote:   http://10.211.55.12/root/abcops-project/-/project_members
remote: 
To git@10.211.55.12:root/abcops-project.git
 ! [remote rejected] code -> code (pre-receive hook declined)
error: failed to push some refs to 'git@10.211.55.12:root/abcops-project.git'           #我这里怎么上传也没有上传成功

我看到网上有人说先使用 git pull 命令把master分支下载下来,然后再同步等等,最好都是失败
解决方法:在GitLab项目中先创建一个readme的文件

imgimg

再次上传

[root@abcops_node2 abcops-project]# git push -u origin code
Counting objects: 3, done.
Writing objects: 100% (3/3), 235 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: 
remote: To create a merge request for code, visit:
remote:   http://10.211.55.12/root/abcops-project/merge_requests/new?merge_request%5Bsource_branch%5D=code
remote: 
To git@10.211.55.12:root/abcops-project.git
 * [new branch]      code -> code
Branch code set up to track remote branch code from origin.

上传成功

img
5.查看GitLab上已经上传的代码

img

img

上传成功!!!

ISSUE管理

ISSUE管理是什么呢,一般是指leader给devs分配任务,可以通过gitlab来完成
上面我们给abcops-project项目中的leader、dev1-abcops、dev2-abcops分配了同样的权限,现在我们将leader在项目中的权限修改为所有者
img

创建milestone

接下来我们使用leader用户登录gitlab,然后创建一个milestones,被称为里程碑

imgimg
别忘了下面的Create Milestones创建里程碑按钮!!!

创建issue

当我们创建好里程碑以后,我们需要创建任务,然后把任务关联到里程碑中,再把任务分发给abcops-project中的开发者

imgimg
img

leader的任务已经分配完成,我们登录dev1和dev2来查看他们是怎么接收任务通知的
我登录了dev2,发现了两个通知信息
img

可以看到dev2的任务是审核,那就开始干活吧
img

开发者开发代码并上传
#克隆项目到本地
$ git clone git@10.211.55.12:root/abcops-project.git
#进入项目目录
$ cd abcops-project/
#创建一个分支
$ git checkout -b shenhe
#代码写入shenhe.html
$ echo "I'm dev2 and windiws" > shenhe.html
#输入全局账号及邮箱
$ git config --global user.name "dev2"
$ git config --global user.email "dev2@abcops.com"
#将当前目录添加到索引
$ git add .
#提交shenhe.html代码
$ git commit -m "shenhe.html"
#将创建的分支上传到gitlab服务器
$ git push -u origin shenhe

然后我们登录到gitlab,查看分支是否上传成功
img

合并分支到主干

还是登录dev2账号,找到项目,然后选择Merge Requests,点击创建 new merge request
imgimg

然后我们退出使用leader用户登录,会发现有消息通知说dev2发来的审核功能已经开发完毕

imgimg
img

删除过源分支后,会发现项目中没有了shenhe,点击master,却在其中

img

开发者更新本地代码

现在我们的gitlab服务器上的代码是最新版本,我们的开发者也需要同步,因此开发者在本地客户端也需要使用 git pull来更新本地代码

$ git pull

img

GitLab数据备份恢复及邮件配置

备份管理

修改gitlab.rb

在gitlab服务上的gitlab.rb配置文件中加入以下两行代码

[root@abcops_node2 abcops-project]# vim /etc/gitlab/gitlab.rb
#备份路径,建议为专业存储或者带有冗余功能的磁盘
gitlab_rails['backup_path'] = "/data/gitlab/backups"

#备份时间,默认为604800秒,时长为7天,7天过后会重新备份,然后删除上次备份
gitlab_rails['backup_keep_time'] = 604800

img

创建备份目录
[root@abcops_node2 abcops-project]# mkdir /data/gitlab/backups -p
[root@abcops_node2 abcops-project]# id git 
uid=996(git) gid=992(git) groups=992(git)
[root@abcops_node2 abcops-project]# chown -Rf git.git /data/gitlab/backups/
重置配置文件
[root@abcops_node2 abcops-project]# gitlab-ctl reconfigure
[root@abcops_node2 abcops-project]# gitlab-ctl restart
备份代码

1.加入crontab

#crontab中的命令为gitlab专用备份命令工具
[root@abcops_node2 abcops-project]# crontab -l
#GitLab Code Backup
30 00 * * * /usr/bin/gitlab-rake gitlab:backup:create

2.测试备份

[root@abcops_node2 abcops-project]# /usr/bin/gitlab-rake gitlab:backup:create

img

查看备份文件

[root@abcops_node2 abcops-project]# ls /data/gitlab/backups/
1563076060_2019_07_14_12.0.3_gitlab_backup.tar

备份文件前面的1563076060是时间戳,2019_07_14是时间
时间戳可以转换为备份时间的

[root@abcops_node2 abcops-project]# date -d @1563076060
Sun Jul 14 11:47:40 CST 2019

恢复

我们备份过后,如要尝试恢复,先把gitlab服务器中的项目代码删除掉,然后尝试恢复

删除项目代码

需要以root身份登录

img

然后它让你输入项目名称来确认删除
img
好了,已经删除,现在尝试恢复

恢复代码

1.停止数据写入服务

[root@abcops_node2 abcops-project]# gitlab-ctl stop unicorn
ok: down: unicorn: 1s, normally up
[root@abcops_node2 abcops-project]# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up

#恢复后面跟备份文件的时间戳
[root@abcops_node2 abcops-project]# gitlab-rake gitlab:backup:restore BACKUP=1563076060_2019_07_14_12.0.3
Unpacking backup ... done

2.启动数据写入服务

[root@abcops_node2 abcops-project]# gitlab-ctl start unicorn
ok: run: unicorn: (pid 1193) 1s
[root@abcops_node2 abcops-project]# gitlab-ctl start sidekiq
ok: run: sidekiq: (pid 1224) 0s

再次登录gitlab服务器页面,发现项目已经被恢复回来了
img

邮件配置

配置好邮件以后,后期如果在GitLab界面操作的某些通知,例如合并代码、权限变更、修改密码等操作会发送到用户的邮箱当中

#在gitlai.rb中加入以下代码
vim /etc/gitlab/gitlab.rb
gitlab_rails['time_zone'] = 'Asia/Shanghai'                     #时区
gitlab_rails['gitlab_email_enabled'] = true                     #是否打开mail
gitlab_rails['gitlab_email_from'] = 'abcops@abcops.com'         #发件人邮箱
gitlab_rails['gitlab_email_display_name'] = 'gitlab'            #邮箱名称
gitlab_rails['smtp_enable'] = true                              #是否打开smtp服务
gitlab_rails['smtp_address'] = "smtp.abcops.com"                #smtp邮箱服务器地址
gitlab_rails['smtp_port'] = 25                                  #smtp邮箱服务端口
gitlab_rails['smtp_user_name'] = "abcops"                       #邮箱账号
gitlab_rails['smtp_password'] = "abcops"                        #邮箱密码
gitlab_rails['smtp_domain'] = "abcops.com"                      #邮箱服务器域名
gitlab_rails['smtp_authentication'] = "login"                   #认证方式

gitlab升级

如涉及到升级请参考升级参考:https://docs.gitlab.com/ee/update/#upgrade-paths
按版本顺序升级11.10.4> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.10.14 -> 13.0.14 -> 13.1.11 -> 13.8.8 -> 13.12.15 -> 14.0.12 -> 14.9.0 -> 14.10.Z -> 15.0.2

#服务正常运行,然后去https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7下载rpm安装包
直接使用yum安装
yum localinstall -y gitlab-ce-12.0.12-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-12.1.17-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-13.0.14-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-13.1.11-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-13.8.8-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-14.9.0-ce.0.el7.x86_64.rpm

升级后异常

升级后登陆报错500 Whoops,something went wrong on our end
日志/var/log/gitlab/gitlab-rails/production.log如下:

Processing by Admin::ApplicationSettingsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "application_setting"=>{"allow_local_requests_from_hooks_and_services"=>"[FILTERED]"}}
Completed 500 Internal Server Error in 72ms (ActiveRecord: 25.0ms)

OpenSSL::Cipher::CipherError ():

lib/gitlab/crypto_helper.rb:27:in aes256_gcm_decrypt' app/models/concerns/token_authenticatable_strategies/encrypted.rb:45:inget_token'
app/models/concerns/token_authenticatable_strategies/base.rb:27:in ensure_token' app/models/concerns/token_authenticatable_strategies/encrypted.rb:32:inensure_token'
app/models/concerns/token_authenticatable.rb:40:in block in add_authentication_token_field' app/services/application_settings/update_service.rb:26:inexecute'
lib/gitlab/metrics/instrumentation.rb:161:in block in execute' lib/gitlab/metrics/method_call.rb:36:inmeasure'
lib/gitlab/metrics/instrumentation.rb:161:in execute' app/controllers/admin/application_settings_controller.rb:40:inupdate'
lib/gitlab/i18n.rb:55:in with_locale' lib/gitlab/i18n.rb:61:inwith_user_locale'
app/controllers/application_controller.rb:434:in set_locale' lib/gitlab/middleware/rails_queue_duration.rb:27:incall'
lib/gitlab/metrics/rack_middleware.rb:17:in block in call' lib/gitlab/metrics/transaction.rb:57:inrun'
lib/gitlab/metrics/rack_middleware.rb:17:in call' lib/gitlab/middleware/multipart.rb:103:incall'
lib/gitlab/request_profiler/middleware.rb:16:in call' lib/gitlab/middleware/go.rb:20:incall'
lib/gitlab/etag_caching/middleware.rb:13:in call' lib/gitlab/middleware/correlation_id.rb:16:inblock in call'
lib/gitlab/correlation_id.rb:15:in use_id' lib/gitlab/middleware/correlation_id.rb:15:incall'
lib/gitlab/middleware/read_only/controller.rb:40:in call' lib/gitlab/middleware/read_only.rb:18:incall'
lib/gitlab/middleware/basic_health_check.rb:25:in call' lib/gitlab/request_context.rb:26:incall'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in call' lib/gitlab/middleware/release_env.rb:13:incall'

gitlab-rails console进入gitalab的控制台,然后依次执行

settings = ApplicationSetting.last
settings.update_column(:runners_registration_token_encrypted, nil)

最后重启gitlab-ctl restart即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

正在输入中…………

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值