温馨提示×

centos gitlab怎么续期

小樊
58
2026-09-02 20:20:15
栏目: 智能运维

在 CentOS 上“GitLab 续期”通常有两种常见含义,下面分别说明,你可以对号入座:


一、GitLab 证书续期(HTTPS 证书过期)

如果你是用 GitLab 自带的 Nginx + Let’s Encrypt 或自带证书:

1. 查看证书状态

gitlab-ctl status nginx
openssl x509 -in /etc/gitlab/ssl/yourdomain.com.crt -noout -dates

2. Let’s Encrypt 自动续期(官方 Omnibus 安装)

sudo gitlab-ctl renew-le-certs

或

sudo gitlab-rake gitlab:check

如果失败,可手动:

sudo gitlab-ctl stop nginx
sudo certbot renew
sudo gitlab-ctl start nginx

3. 自建证书续期

替换证书文件:

/etc/gitlab/ssl/yourdomain.com.crt
/etc/gitlab/ssl/yourdomain.com.key

然后:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

二、GitLab license 续期(企业版 EE)

如果是 GitLab Enterprise Edition(付费版):

1. 获取新 License

  • 登录 https://gitlab.com
  • 进入 /admin/license

2. 上传新 License

  • 浏览器访问 GitLab
  • 管理员 → Admin Area → Licenses
  • 上传新的 .gitlab-license 文件

或命令行:

sudo gitlab-rails runner "License.import_file('/path/to/license.gitlab-license')"

三、GitLab 订阅 / 服务续费(商业合同)

如果是公司采购的 GitLab 订阅:

  • 登录 GitLab 客户门户
  • 续费后重新下发 License

四、确认你的 GitLab 安装方式

rpm -qa | grep gitlab

或

cat /opt/gitlab/version-manifest.txt | head

如果你能补充:

  • GitLab 版本(gitlab-rake gitlab:env:info)
  • 是 证书过期 还是 license 过期
  • 是否 Omnibus 安装

我可以给你更精确的命令。

0 踩