gitlab安装 备份 恢复

    xiaoxiao2022-06-23  39

    1、gitlab官网下载

    https://about.gitlab.com/downloads/#centos6

    2、依据官网下载说明执行

    curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce #下载非常慢,找到一个国内镜像源

    找到

    /gitlab-ce/yum/el6/

    执行wget url即可 安装 Confure and start GitLab

    3. C sudo gitlab-ctl reconfigure onfigure and start GitLab

    输入gitlab安装服务器地址:192.168.1.xx即可访问 注册账号: 3、Gitlab配置更改

    gitlab所有的工程目录都在/var/opt/gitlab/

    # ls /var/opt/gitlab/

    所有的配置在/etc/gitlab/gitlab.rb中修改,修改完配置后执行gitlab-ctl reconfigure生效

    4、备份

    gitlab-rake gitlab:backup:create

    默认备份文件路径:/var/opt/gitlab/backups

    小技巧:查看默认备份路径 grep -n "gitlab_rails" gitlab.rb

    gitlab修改备份路径

    修改/etc/gitlab/gitlab.rb文件

    gitlab_rails['backup_path'] = '/mnt/backups'

    linux服务器间远程copy: scp 1473824454_gitlab_backup.tar root@192.168.1.21:/opt 5、设置linux下用scp传输无需输入密码文件

    a)  在主机A上执行如下命令来生成配对密钥:

    ssh-keygen -t rsa

    b)  将 .ssh 目录中的 id_rsa.pub 文件复制到 主机B 的 ~/.ssh/ 目录中,并改名为  authorized_keys。

    scp .ssh/id_rsa.pub 10.0.6.132:/root/.ssh/authorized_keys

     

    以后从A主机scp到B主机就不需要密码了。

    6、自动备份

    转载请注明原文地址: https://ju.6miu.com/read-1123492.html

    最新回复(0)