Centos部署GitLab-备份恢复

1. 下载rpm包

bash 复制代码
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm

2. 安装依赖

bash 复制代码
yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python

3. rpm安装

bash 复制代码
rpm -ivh gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm

4. 修改gitlab配置文件信息,指定服务ip和端口号

bash 复制代码
# [root@localhost ~]# vim /etc/gitlab/gitlab.rb
#末行模式执行  /external_url/

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
#external_url 'http://gitlab.example.com'
#将url修改ip和端口或者域名
external_url 'http://192.168.56.11:80'

5. 初始化配置

bash 复制代码
 gitlab-ctl reconfigure

6. 重启服务

bash 复制代码
gitlab-ctl restart

7. 直接访问

bash 复制代码
http://192.168.56.11:80

8. 备份旧环境数据

bash 复制代码
# 命令备份  备份文件路径 /var/opt/gitlab/backups/1700647561_2023_11_22_13.12.15_gitlab_backup.tar
gitlab-backup create
# 手动备份
/etc/gitlab/gitlab-secrets.json
/etc/gitlab/gitlab.rb

9. 修改新环境配置文件

修改备份数据恢复地址

修改备份数据存放地址

10. 重新加载配置文件

bash 复制代码
gitlab-ctl stop
gitlab-ctl reconfigure
gitlab-ctl start

11. 将备份数据上传恢复地址

修改备份数据恢复地址

修改备份数据存放地址

12. 停服务

bash 复制代码
停止gitlab部分服务,保证恢复过程中有数据写入
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq

13. 开始恢复

bash 复制代码
gitlab-rake gitlab:backup:restore BACKUP=1700647561_2023_11_22_13.12.15_gitlab_backup.tar
相关推荐
其实防守也摸鱼11 分钟前
CTF Web 6 题全解 Writeup
linux·sql·学习·算法·安全·ctf·xss
qq_4017004117 分钟前
CAN 开源库大全(嵌入式/上位机,适配STM32、Linux、Qt,附带Github地址)
linux·stm32·开源
AAA代码批发商1 小时前
DAYS 56【Linux 驱动深度】SPI 子系统驱动开发全指南:从架构、核心数据结构到设备驱动实战
linux·驱动开发·架构·内核开发·spi 子系统
听雨笑1 小时前
终端窗口关掉了,正在跑的活会不会死:三种起法各自的下场
linux
程序员-Benothing1 小时前
Linux CPU性能分析:top、mpstat、pidstat、perf实战
linux·运维·服务器
小诗懂技术1 小时前
Linux设备驱动并发控制总结_CSDN
linux·运维·服务器
北风toto2 小时前
银河麒麟 V10 内网 YUM 源修复实战教程(U盘中转版)
linux·服务器
小白鸽i2 小时前
【linux】麒麟桌面版安装人大金仓V8
linux·运维
Ruiery2 小时前
Linux 6.6内核内存管理深度解析(三):页表与缺页处理 — 虚拟地址怎么按需映射到物理页
linux·运维·服务器
ouynagda2 小时前
iMX6ull Linux 嵌入式驱动开发笔记(LCD / ADXL345 / SPI 子系统)
linux·arm开发·驱动开发·笔记·嵌入式硬件