Environmental centos7, memory, at least 4G, Gitlab or very memory-intensive.
GitHub Installation Reference: https://about.gitlab.com/install/
component mounting Reference: https://docs.gitlab.com/ce/development/architecture.html
installation
-
Yum source configured
to use domestic software mirror sites, where the use of open source software mirror sites Tsinghua University.
cat /etc/yum.repos.d/tsinghua.repo[gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1
-
Installation
Installation of dependenciesyum install curl policycoreutils-python openssh-server
Then perform the update and install the package cache
yum makecache yum install gitlab-ce
When installing a fox head finally appears, the installation was successful.
-
Boot configuration
directory structure
/ opt / gitlab home directory
/ etc / gitlab / profile directory
/ var / log / gitlab / log directory
modify the configuration
vim /etc/gitlab/gitlab.rbexternal_url 'http://10.10.10.55' #这如果nginx 修改端口,external_url 里面也必须带端口 gitlab_rails['time_zone'] = 'Asia/Shanghai' #时区 unicorn['worker_processes'] = 4 #依据服务器CPU核数 nginx['listen_port'] = 80 #默认Nginx端口80,这里使用gitlab已有的Nginx服务,当然也可使用自己安装的Nginx服务。
After modifying the configuration needs to be performed, reload the configuration:
gitlab-ctl reconfigure
gitlab start: gitlab-ctl Start
gitlab view the status: gitlab-ctl statusrun: alertmanager: (pid 28348) 10561s; run: log: (pid 16612) 18335s run: gitaly: (pid 28362) 10561s; run: log: (pid 16611) 18335s run: gitlab-exporter: (pid 28383) 10560s; run: log: (pid 16617) 18335s run: gitlab-workhorse: (pid 28398) 10560s; run: log: (pid 16604) 18335s run: grafana: (pid 28407) 10559s; run: log: (pid 16621) 18335s run: logrotate: (pid 9348) 3359s; run: log: (pid 16616) 18335s run: nginx: (pid 28426) 10559s; run: log: (pid 16613) 18335s run: node-exporter: (pid 28510) 10558s; run: log: (pid 16619) 18335s run: postgres-exporter: (pid 28516) 10558s; run: log: (pid 16618) 18335s run: postgresql: (pid 28523) 10557s; run: log: (pid 16615) 18335s run: prometheus: (pid 28532) 10557s; run: log: (pid 16599) 18335s run: redis: (pid 28550) 10556s; run: log: (pid 16596) 18335s run: redis-exporter: (pid 28554) 10556s; run: log: (pid 16605) 18335s run: sidekiq: (pid 28563) 10556s; run: log: (pid 16614) 18335s run: unicorn: (pid 28569) 10555s; run: log: (pid 16603) 18335s
Login gitlab
gitlab default user root, first login prompt to change the password - Gitlab structure
Gitlab and directories created according to the user defined configuration after startup, a default dependent component at / var / opt / gitlab directory.
Gitlab main components are:
Nginx, PostgreSQL, Redis, Unicorn, sidekiq. This is a gitlab-ctl status command also can view.
Nginx: web access entry
postgresql: database, or MySQL
Redis: cache, distribute tasks
sidekiq: background tasks, it is responsible for sending e-mail, tasks, from Redis
Unicorn: gitlab main process
gitlab-workhorse: a reverse proxy server that can handle the primary process unicorn unrelated request
gitaly: back-office services, call processing git all Gitlab issued
Speaking
1. prepare the environment
ready to install the finished package directory.
cd / opt / src / Downloadgit clone https://gitlab.com/xhang/gitlab.git
2. Check the clone download the finished version of this patch
# cat /opt/src/gitlab/VERSION 12.3.5
3. Stop gitlab
gitlab-ctl stop
4. Check the installed version:
head -1 /opt/gitlab/version-manifest.txt gitlab-ce 12.4.2
5. Get finished package:
cd /opt/src/gitlab git diff origin/12.3.5-stable origin/12.3.5-stable-zh > /tmp/12.3.5.diff
6. Update patch to gitlab in:
# yum -y install patch cd /tmp/ #patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 12.3.5.diff
If you install the patch to perform the following problems, skip that carriage has been skipped. Because there are some newer patch package patch file, the files are not on gitlab.
can't find file to patch at input line 5 Perhaps you used the wrong -p or --strip option? The text leading up to this was: |diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js |index 976d32a..7967edb 100644 |--- a/app/assets/javascripts/awards_handler.js |+++ b/app/assets/javascripts/awards_handler.js
7. reload the configuration and start Gitlab:
gitlab-ctl reconfigure & gitlab-ctl start
Log back Gitlab.