CentOS 7.x gitlab on VM or phyical machine

From Notes_Wiki

Home > CentOS > CentOS 7.x > DevOps > Version Control > gitlab > CentOS 7.x gitlab on VM or phyical machine

There is updated article on this at Rocky 8.x gitlab install on a new machine

Obtain VM

In case of AWS cloud use below to create and get access to instance before installing gitlab.

  1. Create EC2 or lightsail instance of desired type in desired region. 4GB memory is recommended. With just 1GB memory setup will fail. With 2GB memory and 4GB swap the setup works properly.
  2. Throught AWS firewall allow TCP ports 22, 80, 443 and possibly ICMP echo-request
  3. Create and download identity key file. chmod 400 on downloaded pem file.
  4. SSH to server with user centos.
  5. sudo su -
  6. yum -y install vim
  7. Enable direct root access with personal key pair. Optionally allow root access from AWS keypair also.
  8. Set appropriate hostname
  9. CentOS 7.x adding swap space using file
  10. Storing date / time along with commands in history
  11. Add A record for chosen FQDN in public DNS. This would allow setup to get lets encrypt SSL certificates for https access.


Install gitlab

  1. sudo yum install -y curl policycoreutils-python
  2. Configure gmail based outgoing emails via postfix
  3. curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
  4. sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
    If FQDN is not there then directly use 'yum install -y gitlab-ee' without setting environment variable
  5. If machine has enough resources the setup would succeed and we can access gitlab at specified URL.
  6. Setup new root password
  7. Login with user root and chosen password.


Low RAM related error

If machine has less than 4GB RAM it might show below error:

There was an error running gitlab-ctl reconfigure:

ruby_block[authorize Grafana with GitLab] (monitoring::grafana line 92) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s:
Command exceeded allowed execution time, process terminated
---- Begin output of /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://gitlab.sbarjatiya.com.com/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' ----
STDOUT: 
STDERR: 
---- End output of /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://gitlab.sbarjatiya.com.com/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' ----
Ran /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://gitlab.sbarjatiya.com.com/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' returned

Running handlers complete
Chef Client failed. 5 resources updated in 18 minutes 03 seconds


Refer:


Home > CentOS > CentOS 7.x > DevOps > Version Control > gitlab > CentOS 7.x gitlab on VM or phyical machine