在CentOS8下安装搭建gitlab下载安装备份升级迁移记录
**CentOS 8 boot x84_64 gitlab-ce 下载安装记录**
社区版为gitlab-ce 企业版为gitlab-ee。安装时可以直接装ee,不影响ce使用。
# 下载:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/yum/ 下载对应版本,笔者使用的是 gitlab-ee-13.10.0-ee.0.el8.x86_64.rpm
# 安装:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
rpm -ivh xxx.rpm
gitlab-ctl reconfigure
gitlab-ctl restart
# 备份:
gitlab-rake gitlab:backup:create
默认放在/var/opt/gitlab/backups,可以在/etc/gitlab/gitlab.rb修改配置
注意:配置文件不会备案,注意手动备份
# 自动备份
gitlab_rails['backup_keep_time'] = 604800 #设定备份过期时间,秒,此为周
crontab -e 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create
# 还原
源
scp /var/opt/gitlab/backups/xxx_gitlab_backup.tar root@x.x.x.x:/var/opt/gitlab/backups/
目标
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
chmod 777 /var/opt/gitlab/backups/xxx_gitlab_backup.tar
gitlab-rake gitlab:backup:restore BACKUP=xxx
gitlab-ctl start
# 升级:
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh xxx.rpm
gitlab-ctl reconfigure
gitlab-ctl restart
# 服务:
**重置应用**
gitlab-ctl reconfigure
**启动所有服务**
gitlab-ctl start
**关闭所有服务**
gitlab-ctl stop
**重启所有服务**
gitlab-ctl restart
**列出所有服务**
gitlab-ctl service-list
**查看服务状态**
gitlab-ctl status
# 配置文件
/etc/gitlab/gitlab.rb 配置文件
/etc/gitlab/gitlab-secrets.json 各类密钥和token存储文件
/var/opt/gitlab/nginx/conf nginx配置文件所在的目录
/etc/postfix/main.cf postfix邮件配置文件
# ee证书
以下翻译,详见 mockingbot/gitlab-license (github.com)
**安装ruby 2.3以上**
yum install -y ruby
**安装gitlab-license库**
gem install gitlab-license
**创建license.rb**```
require "openssl"
require "gitlab/license"key_pair = OpenSSL::PKey::RSA.generate(2048)
File.open("license_key", "w") { |f| f.write(key_pair.to_pem) }public_key = key_pair.public_key
File.open("license_key.pub", "w") { |f| f.write(public_key.to_pem) }private_key = OpenSSL::PKey::RSA.new File.read("license_key")
Gitlab::License.encryption_key = private_keylicense = Gitlab::License.new
license.licensee = {"Name" => "none","Company" => "none","Email" => "example@test.com",
}
license.starts_at = Date.new(2020, 1, 1) # 开始时间
license.expires_at = Date.new(2050, 1, 1) # 结束时间
license.notify_admins_at = Date.new(2049, 12, 1)
license.notify_users_at = Date.new(2049, 12, 1)
license.block_changes_at = Date.new(2050, 1, 1)
license.restrictions = {active_user_count: 10000,
}puts "License:"
puts licensedata = license.export
puts "Exported license:"
puts data
File.open("GitLabBV.gitlab-license", "w") { |f| f.write(data) }public_key = OpenSSL::PKey::RSA.new File.read("license_key.pub")
Gitlab::License.encryption_key = public_keydata = File.read("GitLabBV.gitlab-license")
$license = Gitlab::License.import(data)puts "Imported license:"
puts $licenseunless $licenseraise "The license is invalid."
endif $license.restricted?(:active_user_count)active_user_count = 10000if active_user_count > $license.restrictions[:active_user_count]raise "The active user count exceeds the allowed amount!"end
endif $license.notify_admins?puts "The license is due to expire on #{$license.expires_at}."
endif $license.notify_users?puts "The license is due to expire on #{$license.expires_at}."
endmodule Gitlabclass GitAccessdef check(cmd, changes = nil)if $license.block_changes?return build_status_object(false, "License expired")endendend
endputs "This instance of GitLab Enterprise Edition is licensed to:"
$license.licensee.each do |key, value|puts "#{key}: #{value}"
endif $license.expired?puts "The license expired on #{$license.expires_at}"
elsif $license.will_expire?puts "The license will expire on #{$license.expires_at}"
elseputs "The license will never expire."
end
**生成证书**
ruby license.rb
生成 GitLabBV.gitlab-license license_key license_key.pub 这三个文件。
**替换默认公钥**
cp -f license_key.pub /opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub
**升级到ULTIMATE版本**```
--- /opt/gitlab/embedded/service/gitlab-rails/ee/app/models/license.rb
+++ /opt/gitlab/embedded/service/gitlab-rails/ee/app/models/license.rb
@@ -367,7 +367,7 @@enddef plan
- restricted_attr(:plan).presence || STARTER_PLAN
+ restricted_attr(:plan).presence || ULTIMATE_PLANenddef edition
**重新配置gitlab**
gitlab-ctl reconfigure
gitlab-ctl restart
**导入许可证**
登录gitlab后台,管理中心->许可证 (/admin/license),导入 GitLabBV.gitlab-license
在CentOS8下安装搭建gitlab下载安装备份升级迁移记录相关推荐
- gitlab下载安装使用,rpm包
gitlab下载安装,rpm包 gitlab下载 gitlab下载地址 gitlab文档 安装gitlab服务 安装gitlab 修改配置文件 重新配置gitlab 默认管理员root 默认初始密码文 ...
- gitlab下载安装及部署
gitlab下载安装及部署 初次操作成功,记录一下 安装依赖软件 yum -y install policycoreutils openssh-server openssh-clients postf ...
- 手机python软件下载安装,python手机下载安装教程
如何在手机上下载python 应用市场内搜索下载下载Python在您开始之前,在你的计算机将需要Python,但您可能不需要下载它. 首先检查(在命令行窗口输入python)有没有安装Python!如 ...
- Android Studio, 2020.9月最新版下载安装教程+SDK下载安装
Android Studio, 2020.9月最新版下载安装教程+SDK下载安装 一.进入官网下载 二.安装Android Studio 三.安装SDK 一.进入官网下载 1.进入Android St ...
- python软件下载安装教程,python下载安装教程
python下载安装教程 python下载安装教程:自定义安装目录,点击install进行安装,打开cmd窗口,输入python,显示python的版本,安装成功. Python语言更适合初学者,Py ...
- Android Studio安装及SDK下载安装2021
Android开发:Android Studio安装及SDK下载安装2021 首先确保系统已经安装jdk 1.8版本以上.如果不确定自己安装的版本可以这样查看:首先win+r输入cmd进入这样的页面: ...
- gitlab项目的备份与迁移
gitlab项目的备份与迁移 最近工作中需要用到gitlab项目的备份与迁移工作,因此做了一个简单的部署配置,这里小小记录一下. 一.gitlab的安装 1.安装准备 1.本人由于在centos7上部 ...
- 【Git】GitLab 下载安装与使用
一.环境准备 CentOS 7操作系统 关闭防火墙,配置好网络设置,保证可以正常上网 二.下载与安装 2.1 官方下载帮助页 GitLab官方地址 1.进入下载帮助页 2.选择Centos 7版本 3 ...
- Windows环境下用虚拟机安装使用Linux系统(下载安装CentOS7镜像+下载安装VMware+配置虚拟机和系统安装)
一.下载CentOS镜像 这是Linux的一个发行版,相比红帽子(RedHat)的企业版(Enterprise Linux)来说,这个是免费的版本,特点是兼容性和界面可能差了点,但是非常的稳定,占用资 ...
- Windows环境下MySQL8.0.26下载安装详细步骤
概述 1. MySQL Community Server 社区版本,开源免费,自由下载,但不提供官方技术支持,适用于 大多数普通用户. 2. MySQL Enterprise Edition 企业版 ...
最新文章
- srgan要训练多久_SRGAN With WGAN:让超分辨率算法训练更稳定
- 测试php连接mysql
- 五、cookie和web缓存
- sublime_REPL使用及安装教程(解决Sublime无交互问题)
- 写给程序员的最好的13条建议
- 成功解决schedule.ScheduleValueError: Invalid time format
- NIO之ByteBuffer_NIO之网络IO_与ChannelNetty初窥门径
- Python Tree库绘制多叉树的用法介绍
- HGAT-用于半监督短文本分类的异构图注意力网络
- SQL Server:查找周开始和结束日期时间
- 搭建自己的Nuget服务器
- windows和android结合,Android和Windows 10可以很好地合作的10种方式
- Linux-页、页表、页框(块)+虚拟内存
- opencv-python的人脸识别系统
- DDS通信协议与安全实践
- python学习----简易版非诚勿扰
- “L3级”自动驾驶落地指导思想:高速辅助人,低速替代人
- 2016用户体验行业调查报告
- Unsupervised Hyperspectral Mixed Noise Removal Via Spatial-Spectral Constrained Deep Image Prior
- 【python】B站电影爬虫