• 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指定版本安装 · 笔记 · 看云 

  • 相关阅读:
    Halcon机器视觉实战--分水岭分割+距离变换实现粘连物体图像分割
    数学建模学习(97):花授粉算法(FPA)寻优
    Spring boot starter 如何给配置添加idea 提示功能 spring-boot-configuration-processor
    用户授权设置全局变量为undefined?
    既然有了量化交易,技术分析还有存在的必要么?有专门收割自动交易系统的策略吗?
    C++常用23种设计模式总结(三)------装饰模式
    红帽rhce认证考试科目有哪些?
    力扣:120. 三角形最小路径和(Python3)
    数据统计和分析怎么做?spss如何做好数据分析?
    [CSS]浮动
  • 原文地址:https://blog.csdn.net/qq_43538925/article/details/126252871