Centos7 Installation Deployment Sinicized Gitlab

Keywords: Linux GitLab Nginx yum git

Environment centos7, memory at least 4G, Gitlab is memory intensive.
GitHub Installation Reference: https://about.gitlab.com/install/
Component Installation Reference: https://docs.gitlab.com/ce/development/architecture.html

install

  1. Configure Yum Source
    Use the domestic software mirror station, here use Tsinghua University's open source software mirror station.
    cat /etc/yum.repos.d/tsinghua.repo

    [gitlab-ce]
    name=Gitlab CE Repository
    baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
    gpgcheck=0
    enabled=1
  2. install
    Installation-related dependencies

    yum install curl policycoreutils-python openssh-server

    Then update the package cache and install it

    yum makecache
    yum install gitlab-ce

    When a fox head appears at the end of the installation, the installation is successful.

  3. Start Configuration
    directory structure
    /opt/gitlab home directory
    /etc/gitlab/profile directory
    /var/log/gitlab/log directory
    Modify Configuration
    vim /etc/gitlab/gitlab.rb

    external_url 'http://10.10.10.55'#This means that if nginx modifies the port, it must also have a port inside the external_url
    gitlab_rails['time_zone'] = 'Asia/Shanghai'    #time zone
    unicorn['worker_processes'] = 4    #Depending on the number of server CPU cores
    nginx['listen_port'] = 80   #The default Nginx port is 80, which uses the existing Nginx service from gitlab, or of course, the Nginx service you installed.

    After modifying the configuration, it needs to be executed to reload the configuration:

    gitlab-ctl reconfigure

    Gitlab start: gitlab-ctl start
    Gitlab view status: gitlab-ctl status

    run: alertmanager: (pid 28348) 10561s; run: log: (pid 16612) 18335s
    run: gitaly: (pid 28362) 10561s; run: log: (pid 16611) 18335s
    run: gitlab-exporter: (pid 28383) 10560s; run: log: (pid 16617) 18335s
    run: gitlab-workhorse: (pid 28398) 10560s; run: log: (pid 16604) 18335s
    run: grafana: (pid 28407) 10559s; run: log: (pid 16621) 18335s
    run: logrotate: (pid 9348) 3359s; run: log: (pid 16616) 18335s
    run: nginx: (pid 28426) 10559s; run: log: (pid 16613) 18335s
    run: node-exporter: (pid 28510) 10558s; run: log: (pid 16619) 18335s
    run: postgres-exporter: (pid 28516) 10558s; run: log: (pid 16618) 18335s
    run: postgresql: (pid 28523) 10557s; run: log: (pid 16615) 18335s
    run: prometheus: (pid 28532) 10557s; run: log: (pid 16599) 18335s
    run: redis: (pid 28550) 10556s; run: log: (pid 16596) 18335s
    run: redis-exporter: (pid 28554) 10556s; run: log: (pid 16605) 18335s
    run: sidekiq: (pid 28563) 10556s; run: log: (pid 16614) 18335s
    run: unicorn: (pid 28569) 10555s; run: log: (pid 16603) 18335s

    Log in to Gitlab

    Gitlab default user root, first login prompt to change password

  4. Gitlab structure
    When Gitlab starts, users and directories are created based on the configuration definition, and components that are dependent by default are in the / var/opt/gitlab directory.
    The main components of Gitlab are:
    Nginx, postgresql, redis, unicorn, sidekiq.This can also be seen using the gitlab-ctl status command.

    Nginx: web Access Entry
    postgresql: database, or mysql
    redis: caching, distributing tasks
    sidekiq: Background task, mainly responsible for e-mail, from redis
    unicorn:gitlab main process
    gitlab-workhorse: A reverse proxy server that handles requests that are not related to the main process unicorn s
    gitaly: Background service that handles all git calls made by Gitlab
    Sinicization
    1. Prepare the environment
    Prepare to install the Chinese package directory.
    Cd/opt/src/Download
    git clone https://gitlab.com/xhang/gitlab.git

    2. View clone to download the patch version in Chinese

    # cat /opt/src/gitlab/VERSION 
    12.3.5

    3. Stop gitlab

    gitlab-ctl stop

    4. View installed versions:

    head -1 /opt/gitlab/version-manifest.txt
    gitlab-ce 12.4.2

    5. Get the Hanghua Bag:

    cd /opt/src/gitlab
    git diff origin/12.3.5-stable origin/12.3.5-stable-zh > /tmp/12.3.5.diff

    6. Update patches to gitlab:

    # yum -y install patch
    cd /tmp/
    #patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 12.3.5.diff

    Execute Install Patch and skip directly if the following problem occurs, i.e. keep returning and skipping.Because the patch pack has some newer patch files, they are not available on gitlab.

    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    |diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
    |index 976d32a..7967edb 100644
    |--- a/app/assets/javascripts/awards_handler.js
    |+++ b/app/assets/javascripts/awards_handler.js

    7. Reload the configuration and start Gitlab:

    gitlab-ctl reconfigure & gitlab-ctl start

    Log back in to Gitlab.

Posted by jackliu97 on Mon, 11 Nov 2019 16:17:45 -0800