gitlab安装、备份、还原

yum install -y wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum -y install curl policycoreutils-python openssh-server perl
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
yum -y install gitlab-ce
gitlab-ctl reconfigure
firewall-cmd --permanent --list-port
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=80/udp --permanent
firewall-cmd --reload

第一步 备份数据(数据库、用户、用户组、用户密钥、权限等)
[root@localhost ~]# gitlab-backup create

[root@localhost ~]# gitlab-rake gitlab:backup:create
第二步 查看备份文件(1638345368_2021_12_01_14.5.0为备份编号)
[root@localhost ~]# ls /var/opt/gitlab/backups/
1638345368_2021_12_01_14.5.0_gitlab_backup.tar
第三步 停止数据连接
[root@localhost ~]# gitlab-ctl stop unicorn
[root@localhost ~]# gitlab-ctl stop puma
[root@localhost ~]# gitlab-ctl stop sidekiq
[root@localhost ~]# gitlab-ctl status
第四步 恢复数据(恢复指定备份编号),也可以迁移到其它服务器上进行恢复
[root@localhost ~]# gitlab-backup restore BACKUP=1638345368_2021_12_01_14.5.0

[root@localhost ~]# gitlab-rake gitlab:backup:restore BACKUP=1638345368_2021_12_01_14.5.0

上一篇:throw和throws关键子之间的区别


下一篇:C#特性的一些用法(2)