Help Center> Elastic Cloud Server> Best Practices> Manually Deploying GitLab (CentOS 7.2)
Updated on 2023-11-13 GMT+08:00

Manually Deploying GitLab (CentOS 7.2)

Overview

The best practices for Huawei Cloud ECS guide you through the manual deployment of GitLab on a Linux ECS. GitLab is an open-source version management system that uses Git as the code management tool. The CentOS 7.2 64bit OS is used as an example in this section.

Prerequisites

  • The memory of the target ECS is greater than or equal to 4 GB.
  • The rule listed in the following table has been added to the security group to which the target ECS belongs. For details, see Adding a Security Group Rule.
    Table 1 Security group rule

    Transfer Direction

    Protocol/Application

    Port/Range

    Source End

    Inbound

    HTTP (80)

    80

    0.0.0.0/0

Procedure

  1. Install the dependency package.

    1. Log in to the ECS.
    2. To obtain and update the system and software, update the image source to a Huawei Cloud image source. For details, see How Can I Use an Automated Tool to Configure a Huawei Cloud Image Source (x86_64 and Arm)?
    3. Run the following command to install the dependency packages:

      sudo yum install -y curl policycoreutils-python openssh-server

    4. Run the following commands to configure automatic SSH enabling upon ECS startup and start SSH:

      sudo systemctl enable sshd

      sudo systemctl start sshd

  2. Install Postfix to send emails.

    1. Run the following command to install Postfix:

      sudo yum install postfix

    2. Run the following commands to configure automatic Postfix enabling upon ECS startup and start Postfix:

      sudo systemctl enable postfix

      sudo systemctl start postfix

  3. Add the GitLab repository and install the software package.

    1. Run the following command to add the GitLab repository:

      curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

    2. Run the following command to install GitLab:

      sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee

      Set EXTERNAL_URL to the IP address of the GitLab server, which can be the public IP address of the server or the domain name.

      • After the command is executed, you can view the software download speed and the estimated download completion time in the command output.
      • If the download speed is slow, obtain the response IP addresses of github.com at http://tool.chinaz.com/dns and select the IP address with a smaller TTL value. Then add the local DNS resolution to the hosts file on the target ECS.

      If information similar to the following is displayed, GitLab has been installed:

      Running handlers:
      Running handlers complete
      Chef Client finished, 452/672 resources updated in 01 minutes 38 seconds
      gitlab Reconfigured!
      
             *.                  *.
            ***                 ***
           *****               *****
          .******             *******
          ********            ********
         ,,,,,,,,,***********,,,,,,,,,
        ,,,,,,,,,,,*********,,,,,,,,,,,
        .,,,,,,,,,,,*******,,,,,,,,,,,,
            ,,,,,,,,,*****,,,,,,,,,.
               ,,,,,,,****,,,,,,
                  .,,,***,,,,
                      ,*,.
      
      
      
           _______ __  __          __
          / ____(_) /_/ /   ____ _/ /_
         / / __/ / __/ /   / __ `/ __ \
        / /_/ / / /_/ /___/ /_/ / /_/ /
        \____/_/\__/_____/\__,_/_.___/
      
      
      Thank you for installing GitLab!

  4. Test the GitLab deployment.

    1. Enter http://Server IP address in the address bar. If the following page is displayed, GitLab has been set up.

    2. Change the password upon your first login. Then, enter the new password to log in.