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
Obtain VM
In case of AWS cloud use below to create and get access to instance before installing gitlab.
- 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.
- Throught AWS firewall allow TCP ports 22, 80, 443 and possibly ICMP echo-request
- Create and download identity key file. chmod 400 on downloaded pem file.
- SSH to server with user centos.
- sudo su -
- yum -y install vim
- Enable direct root access with personal key pair. Optionally allow root access from AWS keypair also.
- Set appropriate hostname
- CentOS 7.x adding swap space using file
- Storing date / time along with commands in history
- Add A record for chosen FQDN in public DNS. This would allow setup to get lets encrypt SSL certificates for https access.
Install gitlab
- sudo yum install -y curl policycoreutils-python
- Configure gmail based outgoing emails via postfix
- curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
- 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
- If machine has enough resources the setup would succeed and we can access gitlab at specified URL.
- Setup new root password
- Login with user root and chosen password.
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