Centos部署GitLab-备份恢复
- 其他
- 2025-07-21 19:26:56

1. 下载rpm包 wget mirrors.tuna.tsinghua.edu /gitlab-ce/yum/el7/gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm 2. 安装依赖 yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python 3. rpm安装 rpm -ivh gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm 4. 修改gitlab配置文件信息,指定服务ip和端口号 # [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: ##! docs.gitlab /omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab #external_url 'http://gitlab.example ' #将url修改ip和端口或者域名 external_url 'http://192.168.56.11:80' 5. 初始化配置 gitlab-ctl reconfigure 6. 重启服务 gitlab-ctl restart 7. 直接访问 http://192.168.56.11:80 8. 备份旧环境数据 # 命令备份 备份文件路径 /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. 重新加载配置文件 gitlab-ctl stop gitlab-ctl reconfigure gitlab-ctl start 11. 将备份数据上传恢复地址修改备份数据恢复地址 修改备份数据存放地址
12. 停服务 停止gitlab部分服务,保证恢复过程中有数据写入 gitlab-ctl stop unicorn gitlab-ctl stop sidekiq 13. 开始恢复 gitlab-rake gitlab:backup:restore BACKUP=1700647561_2023_11_22_13.12.15_gitlab_backup.tarCentos部署GitLab-备份恢复由讯客互联其他栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“Centos部署GitLab-备份恢复”