gitlab安装配置

#官方教程
    #https://about.gitlab.com
    #https://docs.gitlab.com
    #https://packages.gitlab.com/gitlab/
    #https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

    #ee版
        #https://docs.gitlab.com/ee/install/README.html
        #https://about.gitlab.com/install/#centos-7
        #https://packages.gitlab.com/gitlab/gitlab-ee/install#bash-rpm
    #ce版
        #https://docs.gitlab.com/ce/install/README.html
        #https://about.gitlab.com/install/#centos-7 #过程仿照ee版本,相应内容ee改为ce即可
        #https://packages.gitlab.com/gitlab/gitlab-ce/install#bash-rpm

    #硬件配置要求
        #https://docs.gitlab.com/ee/install/requirements.html#requirements
        CPU
            1 core supports up to 100 users but the application can be a bit slower due to having all workers and background jobs running on the same core
            2 cores is the recommended number of cores and supports up to 500 users
            4 cores supports up to 2,000 users
            8 cores supports up to 5,000 users
            16 cores supports up to 10,000 users
            32 cores supports up to 20,000 users
            64 cores supports up to 40,000 users
            More users? Run it on multiple application servers https://about.gitlab.com/solutions/high-availability/
        Memory
            You need at least 8GB of addressable memory (RAM + swap) to install and use GitLab! The operating system and any other running applications will also be using memory so keep in mind that you need at least 4GB available before running GitLab. With less memory GitLab will give strange errors during the reconfigure run and 500 errors during usage.
            4GB RAM + 4GB swap supports up to 100 users but it will be very slow
            8GB RAM is the recommended memory size for all installations and supports up to 100 users
            16GB RAM supports up to 2,000 users
            32GB RAM supports up to 4,000 users
            64GB RAM supports up to 8,000 users
            128GB RAM supports up to 16,000 users
            256GB RAM supports up to 32,000 users
            More users? Run it on multiple application servers https://about.gitlab.com/solutions/high-availability/
#非官方教程
    #https://www.cnblogs.com/weifeng1463/p/7714492.html
    #https://yq.aliyun.com/articles/74395

#定义
    GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务;类似于私有版的github平台。
#版本
    ee版是企业版,ce版是社区版
#ee版sh脚本+yum repo方式安装
    yum makecache all
    #安装前提依赖
        yum install -y curl policycoreutils-python openssh-server
        # systemctl enable sshd
        # systemctl start sshd
        firewall-cmd --permanent --add-service=http
        systemctl reload firewalld
        firewall-cmd --list-services
        #install Postfix to send notification emails.
            yum install -y postfix
            systemctl enable postfix
            systemctl start postfix
    #安装gilab企业版yum repo
        curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sh
    #安装gitlab
        yum install -y gitlab-ee
    #修改gitlab配置,并重配
        具体详见目录etc下的gitlab.rb配置文件(配置的访问url为:http://gitlab.guojingyi.cn)
        gitlab-ctl reconfigure
    #重启gitab服务
        gitlab-ctl status
        gitlab-ctl start
        gitlab-ctl stop
        gitlab-ctl restart
    #web首次访问url地址,初次root管理员需要重置密码(minimum is 8 characters)
        http://gitlab.guojingyi.cn
    #卸载
        gitlab-ctl stop
        yum remove gitlab-ee
        rm /etc/yum.repos.d/gitlab_gitlab-ee.repo
        # find /  -name gitlab -type d -exec rm -rf {} \;
        # find /  -name gitlab -type f -exec rm -rf {} \;
#ce版sh脚本+yum repo方式安装
    yum makecache all
    #安装前提依赖
        yum install -y curl policycoreutils-python openssh-server
        # systemctl enable sshd
        # systemctl start sshd
        firewall-cmd --permanent --add-service=http
        systemctl reload firewalld
        firewall-cmd --list-services
        #install Postfix to send notification emails.
            yum install -y postfix
            systemctl enable postfix
            systemctl start postfix
    #安装gilab社区版yum repo
        curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sh
    #安装gitlab
        yum install -y gitlab-ce
    #修改gitlab配置,并重配
        具体详见目录etc下的gitlab.rb配置文件(配置的访问url为:http://gitlab.guojingyi.cn)
        gitlab-ctl reconfigure
    #重启gitab服务
        gitlab-ctl status
        gitlab-ctl start
        gitlab-ctl stop
        gitlab-ctl restart
    #web首次访问url地址,初次root管理员需要重置密码(minimum is 8 characters)
        http://gitlab.guojingyi.cn
    #卸载
        gitlab-ctl stop
        yum remove gitlab-ee
        rm /etc/yum.repos.d/gitlab_gitlab-ce.repo
        # find /  -name gitlab -type d -exec rm -rf {} \;
        # find /  -name gitlab -type f -exec rm -rf {} \;
#注意:
    卸载的时候,需要彻底清理,比如/opt目录下的文件软连到/etc/sysctl.d/,否则再次安装会报错误

#高可用
    #https://about.gitlab.com/solutions/high-availability/
    
    #备份文件和数据库

    #从快照中恢复(使用快照恢复最适合单个虚拟服务器)

    #多个应用服务器

    #单个副本服务器
        heartbeat(用它来实现资源的统一调度)+drbd(实现两台机器的两块硬盘的实时完整复制(drbd即磁盘镜像) 解决了两台机器做双机时的数据一致性问题。

    #文件系统存储和DBMS辅助服务器

    #HA包装产品
        #https://docs.gitlab.com/ee/administration/high_availability/README.html

You may also like...

发表评论