1. Install the pre-installation software

13.7.1 Version requires a minimum of 4G memory (2G or 3G should also be acceptable)

# enable SSHD, HTTP, HTTPS services (if you do not plan to use port 443, Sudo yum install -y curl policycoreutils-python openssh-server sudo systemctl enable SSHD sudo systemctl enable start sshd sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo Sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfixCopy the code

2. Install the Gitlab-CE warehouse

/etc/yum. Repos. D /gitlab-ce. Repo  [gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ Gpgcheck =0 enabled=1Copy the code

3. Install gitlab – ce

sudo yum install gitlab-ce -y
Copy the code

4. Configuration

Vim /etc/gitlab/gitlab.rb external_url 'http://abc.com' The HTTPS service must be enabled vim /etc/gitlab/gitlab.rb external_url "https://abc.com" mkdir /etc/gitlab/ssl chmod 755 /etc/gitlab/ssl cp Abc.com.key abc.com.pem /etc/gitabl/ SSL / # The name of the private key and certificate must be the same as the domain name # HTTP redirection HTTPS (HTTPS is enabled by default, and HTTP is automatically disabled, Vim /etc/gitlab/gitlab.rb external_url "https://abc.com" nginx["redirect_http_to_https"] = true Data (optional) git_data_dirs ({" default "= > {" path" = > "/ var/usr/local/gitlab/git - data"}}) #. As long as the modified gitlab rb file, Run reconfigure to take effect sudo gitlab-ctl reconfigureCopy the code

5. Start and close

Sudo gitlab-ctl start # Restart all gitlab components gitlab-ctl stop # restart all gitlab components gitlab-ctl restart # check the status gitlab-ctl statusCopy the code

6. 502

1. After the service is started, page 502 is displayed

2. Gitlab-ctl status is used to check which component fails to be started

3. CD /var/log/gitlab to view logs of the component that fails to be started

4. Port conflicts are common. Go to the gitlab.rb configuration file according to the component name and change the port of the corresponding component

Reload the configuration gitlab-ctl configure and then restart the service gitlab-ctl restart

5. If the component fails to be started, no obvious error is displayed in the log. The fault may be caused by insufficient memory

6. After modifying gitlab.rb again or increasing virtual memory, 502 page still appears again. Please wait 3 minutes, or try another browser

7. Install gitlab – runner

  1. Download the binary installation package

    sudo curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64"
    Copy the code
  2. chmod

    chmod +x /usr/local/bin/gitlab-runner
    Copy the code
  3. Create a user

    useradd --comment "Gitlab Runner" --create-home gitlab-runner --shell /bin/bash
    Copy the code
  4. Installation services

    gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
    gitlab-runner start
    Copy the code
  5. Registered Runner

    2. Run the Shared Runner and run the url and token. Settings > CI/CD > expand the Runners > Copy url and token Settings > CI/CD > expand the Runners > Copy url and token 4. Gitlab-runner register Enter url, token, and other information as promptedCopy the code
  6. Cancel the Runner

    gitlab-runner unregister --name test-runner
    Copy the code

Reference 7.

Docs.gitlab.com/omnibus/REA…

Mirrors.tuna.tsinghua.edu.cn/help/gitlab…