zoukankan      html  css  js  c++  java
  • GitLab服务器迁移

    1.背景

      由于GitLab内存消耗很大,已经影响到A服务器上的其他服务,同时考虑到代码管理服务应该单独部署在一台服务器上,因此决定从服务器A迁移到服务器B上。两台服务器均是CentOS 7,gitlab版本是gitlab-ce-9.5.6-ce.0.el7.x86_64.rpm 。注意:高版本的Gitlab无法恢复低版本备份的数据,需要注意在B服务器部署和A服务器一样版本的gitlab,部署好环境后开始备份和数据迁移。

    2.备份

      备份A服务器上的gitlab数据,执行命令gitlab-rake gitlab:backup:create RAILS_ENV=production,PS: 备份后的文件一般是位于/var/opt/gitlab/backups下。

    3.拷贝

      从A服务上拷贝gitlab数据到B服务器上,执行命令: scp root@A_ip:/var/opt/gitlab/backups/1515132280_2018_01_05_9.5.6_gitlab_backup.tar /var/opt/gitlab/backups,其中A_ip是A服务器IP地址。

    4.还原

      在B服务器的/var/opt/gitlab/backups的目录下还原gitlab数据,执行命令:gitlab-rake gitlab:backup:restore RAILS_ENV=production BACKUP=1515132280_2018_01_05_9.5.6,PS:BACKUP的参数必须与原服务器备份后的文件名一致。

    5.问题

      还原过程中报错,报错:无法 open: 权限不够,估计是拷贝过来的还原文件权限不够,执行命令:chmod 644 1515132280_2018_01_05_9.5.6_gitlab_backup.tar,再次执行还原命令即可成功。

  • 相关阅读:
    AtCoder Grand Contest 015 题解
    AtCoder Grand Contest 014 题解
    AtCoder Grand Contest 013 题解
    AtCoder Grand Contest 012 题解
    AtCoder Grand Contest 011 题解
    AtCoder Grand Contest 010 题解
    AtCoder Grand Contest 009 题解
    NOIP2017 Day2 题解
    博客园主题备份
    多项式全家桶
  • 原文地址:https://www.cnblogs.com/TechSnail/p/8213437.html
Copyright © 2011-2022 走看看