GitLab 是一個用于倉庫管理系統的開源項目,使用Git作為代碼管理工具,并在此基礎上搭建起來的web服務
軟體包所選位址
https://packages.gitlab.com/gitlab/gitlab-ce
gitlab安裝的插件比較多,吃記憶體比較高,建議安裝底版本
部署安裝
# pwd
/data
# wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.3.11-ce.0.el7.x86_64.rpm
# ll
總用量 16
-rw-r--r-- 1 root root 15355 3月 19 13:50 gitlab-ce-11.3.11-ce.0.el7.x86_64.rpm
# yum -y install gitlab-ce-11.3.11-ce.0.el7.x86_64.rpm
# cp /etc/gitlab/gitlab.rb{,.bak}
修改gitlab配置檔案
# vim /etc/gitlab/gitlab.rb
# diff /etc/gitlab/gitlab.rb{,.bak}
13c13
< external_url 'http://gitlab.linux.com'
---
> external_url 'http://gitlab.example.com'
gitlab啟動初始化操作
# gitlab-ctl reconfigure
gitlab啟動
# gitlab-ctl start
timeout: down: alertmanager: 0s, normally up, want up
ok: run: gitaly: (pid 4035) 113s
ok: run: gitlab-monitor: (pid 4056) 113s
ok: run: gitlab-workhorse: (pid 4005) 114s
ok: run: logrotate: (pid 3030) 206s
ok: run: nginx: (pid 2996) 212s
ok: run: node-exporter: (pid 3244) 194s
ok: run: postgres-exporter: (pid 4492) 86s
ok: run: postgresql: (pid 2720) 257s
ok: run: prometheus: (pid 4088) 112s
ok: run: redis: (pid 2645) 263s
ok: run: redis-exporter: (pid 3289) 182s
ok: run: sidekiq: (pid 2965) 219s
ok: run: unicorn: (pid 2922) 225s

設定首次登陸密碼
使用者名:root
至此看樣子是部署完成了。明天結合jenkins來個自動化部署kubernetes pod
簡單介紹元件
nginx:靜态Web伺服器
gitlab-shell:用于處理Git指令和修改authorized keys清單,gitlab是以Git為底層的,操作實際上最後就是調用gitlab-shell指令進行處理。
gitlab-workhorse:輕量級的反向代理伺服器
logrotate:日志檔案管理工具
postgresql:資料庫
redis:緩存資料庫
sidekiq:用于在背景執行隊列任務(異步執行)
unicorn:GitLab Rails應用是托管在這個伺服器上面的
gitlab元件日志路徑:/var/log/gitlab
gitlab配置路徑:/etc/gitlab/ 路徑下有gitlab.rb配置檔案
應用代碼群組件依賴程式:/opt/gitlab
各個元件存儲路徑: /var/opt/gitlab/
倉庫預設存儲路徑 /var/opt/gitlab/git-data/repositories
版本檔案備份路徑:/var/opt/gitlab/backups/
nginx安裝路徑:/var/opt/gitlab/nginx/
redis安裝路徑:/var/opt/gitlab/redis
過手如登山,一步一重天