1、官網安裝文檔:https://about.gitlab.com/downloads/#centos7
創(chuàng)新互聯(lián)專注于中大型企業(yè)的網站設計制作、網站制作和網站改版、網站營銷服務,追求商業(yè)策劃與數(shù)據(jù)分析、創(chuàng)意藝術與技術開發(fā)的融合,累計客戶成百上千家,服務滿意度達97%。幫助廣大客戶順利對接上互聯(lián)網浪潮,準確優(yōu)選出符合自己需要的互聯(lián)網運用,我們將一直專注成都品牌網站建設和互聯(lián)網程序開發(fā),在前進的路上,與客戶一起成長!sudo yum install curl policycoreutils openssh-server openssh-clients sudo systemctl enable sshd sudo systemctl start sshd sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld2、配置官網鏡像源
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce由于國內特殊網絡,使用官網鏡像源較慢,在次提供國內鏡像源
清華大學鏡像源:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
新建 /etc/yum.repos.d/gitlab-ce.repo
,內容為
再執(zhí)行
sudo yum makecache sudo yum install gitlab-ce安裝完成后目錄結構如下
[root@docker gitlab]# tree /opt/gitlab/ -L 1 /opt/gitlab/ ├── bin ├── dependency_licenses.json ├── embedded ├── etc ├── init ├── LICENSE ├── LICENSES ├── service ├── sv ├── var ├── version-manifest.json └── version-manifest.txt 8 directories, 4 files [root@docker gitlab]# tree /etc/gitlab/ -L 1 /etc/gitlab/ ├── gitlab.rb ├── gitlab-secrets.json └── trusted-certs主要集成了如下服務
# tree /opt/gitlab/sv/ -L 1 /opt/gitlab/sv/ ├── gitaly ├── gitlab-monitor ├── gitlab-workhorse ├── logrotate ├── nginx ├── node-exporter ├── postgres-exporter ├── postgresql ├── prometheus ├── redis ├── redis-exporter ├── sidekiq └── unicorn3、配置gitlab地址
# cat /etc/gitlab/gitlab.rb |grep ^external_url external_url 'http://192.168.99.101'默認url地址是http://{hostname}
4、重載配置并啟動
gitlab-ctl reconfigure啟動時確保80、8060、8080、9090、9100、9121、9168、9187這些端口沒有占用,否則啟動失敗
5、查看啟動狀態(tài)
# gitlab-ctl status run: gitaly: (pid 5435) 2522s; run: log: (pid 4150) 3071s run: gitlab-monitor: (pid 5441) 2522s; run: log: (pid 4585) 3023s run: gitlab-workhorse: (pid 5445) 2522s; run: log: (pid 4203) 3065s run: logrotate: (pid 5456) 2521s; run: log: (pid 4305) 3053s run: nginx: (pid 5737) 2439s; run: log: (pid 4264) 3059s run: node-exporter: (pid 5471) 2520s; run: log: (pid 4415) 3041s run: postgres-exporter: (pid 5478) 2520s; run: log: (pid 4514) 3029s run: postgresql: (pid 5487) 2519s; run: log: (pid 3858) 3170s run: prometheus: (pid 5490) 2519s; run: log: (pid 4372) 3047s run: redis: (pid 5497) 2518s; run: log: (pid 3744) 3181s run: redis-exporter: (pid 5502) 2518s; run: log: (pid 4449) 3035s run: sidekiq: (pid 5804) 2371s; run: log: (pid 4104) 3077s run: unicorn: (pid 5540) 2515s; run: log: (pid 4049) 3083s6、gitlab啟動、停止、重啟等操作
[root@docker gitlab]# gitlab-ctl stop ok: down: gitaly: 0s, normally up ok: down: gitlab-monitor: 0s, normally up ok: down: gitlab-workhorse: 1s, normally up ok: down: logrotate: 0s, normally up ok: down: nginx: 1s, normally up ok: down: node-exporter: 0s, normally up ok: down: postgres-exporter: 0s, normally up ok: down: postgresql: 0s, normally up ok: down: prometheus: 0s, normally up ok: down: redis: 1s, normally up ok: down: redis-exporter: 0s, normally up ok: down: sidekiq: 0s, normally up ok: down: unicorn: 0s, normally up [root@docker gitlab]# gitlab-ctl start ok: run: gitaly: (pid 14482) 0s ok: run: gitlab-monitor: (pid 14488) 1s ok: run: gitlab-workhorse: (pid 14491) 0s ok: run: logrotate: (pid 14500) 0s ok: run: nginx: (pid 14506) 1s ok: run: node-exporter: (pid 14514) 0s ok: run: postgres-exporter: (pid 14520) 1s ok: run: postgresql: (pid 14526) 0s ok: run: prometheus: (pid 14534) 1s ok: run: redis: (pid 14544) 0s ok: run: redis-exporter: (pid 14548) 0s ok: run: sidekiq: (pid 14559) 1s ok: run: unicorn: (pid 14562) 0s [root@docker gitlab]# gitlab-ctl status run: gitaly: (pid 14482) 12s; run: log: (pid 4150) 3982s run: gitlab-monitor: (pid 14488) 12s; run: log: (pid 4585) 3934s run: gitlab-workhorse: (pid 14491) 11s; run: log: (pid 4203) 3976s run: logrotate: (pid 14500) 11s; run: log: (pid 4305) 3964s run: nginx: (pid 14506) 11s; run: log: (pid 4264) 3970s run: node-exporter: (pid 14514) 10s; run: log: (pid 4415) 3952s run: postgres-exporter: (pid 14520) 10s; run: log: (pid 4514) 3940s run: postgresql: (pid 14526) 9s; run: log: (pid 3858) 4081s run: prometheus: (pid 14534) 9s; run: log: (pid 4372) 3958s run: redis: (pid 14544) 8s; run: log: (pid 3744) 4092s run: redis-exporter: (pid 14548) 8s; run: log: (pid 4449) 3946s run: sidekiq: (pid 14559) 8s; run: log: (pid 4104) 3988s run: unicorn: (pid 14562) 7s; run: log: (pid 4049) 3994s [root@docker gitlab]# gitlab-ctl restart ok: run: gitaly: (pid 14624) 0s ok: run: gitlab-monitor: (pid 14630) 0s ok: run: gitlab-workhorse: (pid 14633) 1s ok: run: logrotate: (pid 14645) 0s ok: run: nginx: (pid 14651) 1s ok: run: node-exporter: (pid 14659) 0s ok: run: postgres-exporter: (pid 14665) 1s ok: run: postgresql: (pid 14674) 0s ok: run: prometheus: (pid 14684) 0s ok: run: redis: (pid 14695) 1s ok: run: redis-exporter: (pid 14699) 0s ok: run: sidekiq: (pid 14705) 1s ok: run: unicorn: (pid 14710) 0s [root@docker gitlab]#另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。