GitLab Installation method of

GitLab Two ways to install :

  • Compilation and installation

    • advantage : Can be customized . The database can either select MySQL, You can also choose PostgreSQL; The server can either select Apache, You can also choose Nginx.

    • shortcoming : Foreign sources are unstable , By the wall , Dependent packages are hard to download . The configuration process is tedious 、 complex , It's easy to have all kinds of problems . There's a lot of dependency , It's not easy to manage , uninstall GitLab Relative trouble .

  • adopt rpm Package installation

    • advantage : Simple installation process , Fast installation . use rpm Package installation method , Installed packages are easy to manage .

    • shortcoming : By default, the database adopts PostgreSQL, The server defaults to Nginx, It's not easy to customize .

Because the company is only equipped with one Alibaba cloud server , And no domain name is assigned . The server needs to run version control software 、bug Management software 、 Knowledge base and other programs , Only use ip Mode of access . Originally adopted GitLab+Apache+MySQL How to compile and install , And will GitLab Configured to be available through xxx.xx.xxx.xx/gitlab Form access , because bug Management software ( ZenTao ) It also runs on Apache above , The two sets of software are mutually exclusive , No solution can be found . meanwhile ,GitLab The registration of needs mailbox verification , Because the configuration methods provided on the Internet are all based on the domain name , You can't use it normally if you configure it on alicloud for many times .

therefore , You can only abandon the way you compile and install , And take rpm Package to install again .

install GitLab CE Omnibus package

yum install curl policycoreutils openssh-server openssh-clients postfix
systemctl enable sshd 
systemctl start sshd
systemctl enable postfix
systemctl start postfix

2. Add the GitLab package server and install the package

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

If you are not comfortable installing the repository through a piped script, you can find the entire script here and select and download the package manually and install using

curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-XXX.rpm/download
rpm -i gitlab-ce-XXX.rpm

3. Configure and start GitLab

sudo gitlab-ctl reconfigure

The configuration file cat /etc/gitlab/gitlab.rb

[root@git gitlab]# grep -v "#" gitlab.rb | sed '/^$/d'
external_url 'http://git.cinyi.com'
gitlab_rails['gitlab_email_from'] = 'fengjian1585@163.com'
gitlab_rails['backup_path'] = "/data/gitlab/backups"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "fengjian1585@163.com"
gitlab_rails['smtp_password'] = "123456"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
user['git_user_name'] = "Git_Senyint_Admin"
user['git_user_email'] = "fengjian1585@163.com"

In order to better manage it, we close open registration

User registration

Gitlab Modify the default directory of backup files

You can also modify /etc/gitlab/gitlab.rb To modify the default directory where backup files are stored :

gitlab_rails['backup_path'] = '/data/gitlab/backups'

/mnt/backups Change it to the directory where you want to store the backup , Use after modification gitlab-ctl reconfigure Command to reload the configuration file .

Gitlab Automatic backup

Add the following , Every morning 2 One point automatic backup :

0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create

Gitlab recovery

Again , Gitlab Recovery from backup is also very simple :

# Stop related data connection services 
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq # from 1393513186 Restore in numbered backup

gitlab-rake gitlab:backup:restore BACKUP=1393513186 # start-up Gitlab
sudo gitlab-ctl start
. Guaranteed recovery gitlab The version is the same 
. Guarantee /etc/gitlab/gitlab.rb identical
. The backup path is the same /data/gitlab/backups chown git.root /data/gitlab/backups
chmod /data/gitlab/backups
chown git.git -R /data/gitlab/backups/*
cd /data/gitlab/backups/
ls
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq gitlab-ctl status
gitlab-rake gitlab:backup:restore BACKUP=1510250560
gitlab-ctl start
gitlab-ctl status

The restore is written in the script , The new version is different from the boss
[root@gitlab data]# cat restore-gitlab.sh
#!/bin/bash cd /data/gitlab/backups/ restorename=`find /data/gitlab/backups/ -mtime -1 -name "*.tar" | awk -F "/" '{print $5}' | cut -d '_' -f 1-5` gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq chown git.root /data/gitlab/backups
chmod 700 /data/gitlab/backups
chown git.git -R /data/gitlab/backups/* gitlab-rake gitlab:backup:restore BACKUP=${restorename} gitlab-ctl start # After recovery , have access to check Check
gitlab-rake gitlab:check SANITIZE=true

When the recovery check is , There will be a problem

Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: FAILED: Failed to connect to internal API
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml
Please fix the error above and rerun the checks. Checking GitLab Shell ... Finished Checking Gitaly ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Running? ... no
Try fixing it:
sudo -u git -H RAILS_ENV=production bin/background_jobs start
For more information see:
doc/install/installation.md in section "Install Init Script"
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.

modify   vim /opt/gitlab/embedded/service/gitlab-shell/config.yml  gitlab_url  become 0.0.0.0

# GitLab user. git by default
user: git # Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://0.0.0.0:8080"
#gitlab_url: "http://127.0.0.1:8080"

gitlab The configuration file

[root@gitlab data]# grep -v "#" /etc/gitlab/gitlab.rb | sed '/^$/d'
external_url 'http://git.senyint.com'
gitlab_rails['gitlab_email_reply_to'] = 'fengjian1585@163.com'
gitlab_rails['gitlab_default_can_create_group'] = false # It is forbidden to set up projects in one's own account
gitlab_rails['backup_path'] = "/data/gitlab/backups"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qiye.163.com"
gitlab_rails['smtp_port'] =
gitlab_rails['smtp_user_name'] = "fengjian@qq.com"
gitlab_rails['smtp_password'] = ""
gitlab_rails['smtp_domain'] = "qiye.163.com"
gitlab_rails['smtp_authentication'] = :login
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = 'fengjian@senyint.com'

gitlab Install more related articles

  1. GitLab Installation instructions

    GitLab, It's a use Ruby on Rails Open source applications developed , And Github similar , Ability to browse source code , Management defects and comments , Perfect for use within the team . gitlab Is based on Ruby on Rails Of , ...

  2. Gitlab install 、 Sinicization and use

    Environmental Science :centos Close the firewall and selinux [root@Gitlab ~]# setenforce [root@Gitlab ~]# service iptables stop && ...

  3. git\CentOS6.5 in gitlab Installation tutorial

    One .Git origin : Git Is an open source distributed version control system , Agile for efficient handling of any small or large project . Git yes Linus Torvalds In order to help manage Linux An open source version developed for kernel development ...

  4. Ubuntu gitlab Install document and email notification reminder configuration

    1. Install dependency packages , Run the command sudo apt-get install curl openssh-server ca-certificates postfix 2. because gitlab Official sources may be “ wall ”, First ...

  5. gitlab Installation notes

    gitlab install To configure yum Source sudo vim /etc/yum.repos.d/gitlab-ce.repo According to the example of others on the Internet , The source of Tsinghua [gitlab-ce] name=Gitlab C ...

  6. CentOS 7 In the environment GitLab Installation and basic configuration

    The new laboratory calls for reconstruction GitLab, For me , It's the first time that I have the opportunity to participate in the construction of the laboratory as an elder . Let's share my own experience : 1. Install dependent software and set boot up yum install curlpolicycoreu ...

  7. GitLab Installation and use

    GitLab Is a use of Ruby on Rails Open source applications developed , Implement a self managed Git Project warehouse , It can be done by Web Interface to access public or private projects . GitLab Have and Github Similar functions , Be able to browse ...

  8. gitlab One of : gitlab Installation, configuration and use

    Reference resources : gitlab install and configure gitlab Download address : https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/ The official tutorial : https://about.gitl ...

  9. Gitlab Installation and localization

    Gitlab Installation and localization System environment : CentOS 7.5 IP:192.168.1.2 close selinux.firewalld gitlab-ce-10.8.4 rpm package : Download address One . Download and install g ...

  10. GITLAB Install notes

    CentOS 7 Minimum post installation operation Set time zone timedatectl set-timezone Asia/Shanghai add to Gitlab Tsinghua source vi /etc/yum.repos.d/gitlab ...

Random recommendation

  1. .NET Framework3.0/3.5/4.0/4.5 Summary of new features

    Microsoft .NET Framework 3.0 .NET Framework 3.0 A lot of new features have been added to , for example : Windows Workflow Foundation (WF) Windo ...

  2. Code bad taste special article ————Long parameter List Too long parameter list

    When I first started learning programming , The teacher said : All the things required by the method are passed in as parameters , It seems that we haven't learned yet OO This east east , Or it's a global variable , I wipe , Global variables are awesome , When we started learning, we were all using global variables , But then I worked , The manager said no ...

  3. C# download http file

    @( Programming ) using System; using System.IO; using System.Net; namespace Wisdombud.Util { public class HttpH ...

  4. Try to design LFSR Encrypting device , And use CAP4 Verify randomness

    stay CPA4 There is design in the software LFSR The function of the encryptor : Input LFSR Size , Initial key , And the feedback key . Click on Set Key Then click Show LFSR Observe LFSR, It was found that the initial key was 1101, To hexadecimal is D, feedback ...

  5. Windows phone 8 Learning notes (1) Touch input

    original text :Windows phone 8 Learning notes (1) Touch input Windows phone 8 Application With general Pc The biggest difference between applications in input mode is :Windows phone 8 Mainly rely on touch operation . therefore ...

  6. ABP Zero Single deployment , Single database , Multi tenant Architecture

    First , We should define two entries in a multi tenant system : landlord (Host): The tenant is a single case ( There's only one tenant ). Tenants are responsible for creating and managing tenants . therefore , One “ Tenant users ” Higher than all tenants , And independent of all tenants , And control them at the same time . ...

  7. Set up git Remember the user and password

     git config --global credential.helper store

  8. The front-end development —— BOM

    0. BOM vs. DOM BOM:Browser Object Model, Browser object model , Is in web Use in JavaScript The absolute core of : BOM: Provides content independent interaction with browser windows ...

  9. django Template not found (TemplateDoesNotExist at) Exception handling case of

    One .django The rendering template of is as follows : TemplateDoesNotExist at Two . Location problem : 1. The error reported above . At first I thought I couldn't find the template ( My path is not right ). Later I found that my path was correct . 2 ...

  10. Effective C++ Clause 26

    Delay the occurrence time of variable definition as much as possible We know that when we define an object, there is an indisputable fact , That's allocating memory . Let's assume that we define our own objects . The constructor and destructor of the class will be called in the process of program running . Let's make an example , Suppose it rains , You take a rain ...