1、官网安装文档:https://about.gitlab.com/downloads/#centos7
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 firewalld
2、配置官网镜像源
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
,内容为
[gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1
再执行
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 └── unicorn
3、配置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、查看启动状态
# 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) 3083s
6、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]#
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。