• GitLab 知识树(三):gitlab指定版本安装


    说明

    1. root@ali-hn-lw-jenkins:~# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
    2. 8.14.4-ee

    备份来自8.14.4-ee,现在准备恢复一份在新服务器上,同时新服务器上gitlab使用社区版
    EE版本的备份不能直接恢复到CE版本,恢复的时候需要版本相同
    因此首先安装8.14.4-ee,恢复数据后,再降级8.14.4-ee到8.14.4-ce

    ubuntu16.04 安装指定版本gitlab

    18.04根据核心名字来选择如xenial该成bionic

    1. wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/ubuntu/pool/xenial/main/g/gitlab-ee/gitlab-ee_8.14.4-ee.0_amd64.deb
    2. dpkg -i gitlab-ee_8.14.4-ee.0_amd64.deb

    头一次安装,配置文件不完善,需要修改

    1. vim /etc/gitlab/gitlab.rb
    2. external_url 'http://gitlab.51sw.cc'
    3. gitlab_rails['lfs_enabled'] = true
    4. gitlab_rails['lfs_storage_path'] = "/data/lfs/lfs-objects"
    5. gitlab_rails['manage_backup_path'] = true
    6. gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
    7. gitlab_rails['backup_archive_permissions'] = 0644 # See: https://docs.gitlab.com/ce/raketasks/backup_restore.html#backup-archive-permissions
    8. gitlab_rails['backup_pg_schema'] = 'public'
    9. gitlab_rails['backup_keep_time'] = 604800
    10. # 根据需要开启白名单
    11. #gitlab_rails['rack_attack_git_basic_auth'] = {
    12. #'enabled' => true,
    13. #'ip_whitelist' => ["127.0.0.1","172.16.108.21","172.16.108.22"],
    14. #'maxretry' => 10,
    15. #'findtime' => 60,
    16. #'bantime' => 3600
    17. }
    18. unicorn['port'] = 9090
    19. #在gitlab服务器上集成jenkins
    20. #nginx['custom_nginx_config'] = "include /var/opt/gitlab/nginx/conf/jenkins.conf;"

    重新读取配置,同时会启动服务

    gitlab-ctl reconfigure

    拷贝备份文件到/var/opt/gitlab/backups目录下

    导入备份

    gitlab-rake gitlab:backup:restore BACKUP=1393513186

    导入备份报错

    1. ACCES: Permission denied @rb_file_s_rename
    2. Restoring lfs objects ...
    3. rake aborted!
    4. Errno::EACCES: Permission denied @ rb_file_s_rename - (/data/lfs/lfs-objects, /data/lfs/lfs.1532511121)
    5. # Solution:
    6. chown -R git.root /data/lfs/
    7. chmod 700 /data/lfs/

    下载gitlab 8.14.4-ce

    wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/xenial/main/g/gitlab-ce/gitlab-ce_8.14.4-ce.0_amd64.deb

    停止、卸载8.14.4-ee并安装8.14.4-ce版

    dpkg -r 并不会删除数据和配置文件

    1. dpkg -l | grep gitlab
    2. gitlab-ctl stop
    3. gitlab-ctl uninstall
    4. dpkg -r gitlab-ee
    5. dpkg -i gitlab-ce_8.14.4-ce.0_amd64.deb

    重置root密码

    1. gitlab-rails console -e production
    2. # 低版本可以尝试使用下面一句命令:
    3. gitlab-rails console production
    4. user=User.where(id:1).first
    5. user.password='Nginx801'
    6. user.password_confirmation='Nginx801'
    7. user.save!

    转载自:gitlab指定版本安装 · 笔记 · 看云 

  • 相关阅读:
    zookeeper基础学习之六: zookeeper java客户端curator
    Python自动查重之原理、方法与实践详解
    基于springboot的社区疫情管理系统源码
    tcpip.sys是什么文件,tcpip.sys蓝屏的解决办法
    【云开发】- 在小程序端操作云存储
    C++中struct和class的区别
    Selenium上传文件与webdriver_helper的用法(Web UI)
    【数据结构】树和二叉树的概念及结构(一)
    Go : const rotates恒定旋转(附完整源码)
    Fabric.js 铅笔笔刷
  • 原文地址:https://blog.csdn.net/qq_43538925/article/details/126252871