成功最有效的方法就是向有经验的人学习!

CICD系列gitlab安装(一)

操作系统所使用的版本:

[root@guilin ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core)

准备gitlab安装包
各大版本下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

[root@guilin ~]# yum update
[root@guilin ~]# yum localinstall https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.2.0-ce.0.el7.x86_64.rpm  #下载下来用rpm -ivh安装也可以

修改系统访问域名:

[root@guilin ~]# sed -i 's#external_url.*http://gitlab.example.com.#external_url '"'http://10.150.7.5'"'#g' /etc/gitlab/gitlab.rb
[root@guilin ~]# grep '^external_url' /etc/gitlab/gitlab.rb 
external_url 'http://10.150.7.5'

初始化数据库以及相关配置

[root@guilin ~]# gitlab-ctl reconfigure
······
Running handlers:
Running handlers complete
Chef Client finished, 525/1395 resources updated in 03 minutes 46 seconds
gitlab Reconfigured!

检查启动状态

[root@guilin ~]# gitlab-ctl status
run: alertmanager: (pid 29715) 258s; run: log: (pid 29331) 353s
run: gitaly: (pid 29556) 263s; run: log: (pid 28787) 460s
run: gitlab-monitor: (pid 29604) 262s; run: log: (pid 29200) 375s
run: gitlab-workhorse: (pid 29581) 263s; run: log: (pid 29104) 405s
run: grafana: (pid 29737) 257s; run: log: (pid 29498) 296s
run: logrotate: (pid 29138) 395s; run: log: (pid 29151) 394s
run: nginx: (pid 29114) 401s; run: log: (pid 29132) 398s
run: node-exporter: (pid 29596) 262s; run: log: (pid 29181) 385s
run: postgres-exporter: (pid 29728) 258s; run: log: (pid 29367) 347s
run: postgresql: (pid 28893) 455s; run: log: (pid 28939) 454s
run: prometheus: (pid 29619) 261s; run: log: (pid 29276) 357s
run: redis: (pid 28738) 467s; run: log: (pid 28748) 466s
run: redis-exporter: (pid 29607) 261s; run: log: (pid 29232) 363s
run: sidekiq: (pid 29079) 413s; run: log: (pid 29090) 412s
run: unicorn: (pid 29047) 419s; run: log: (pid 29074) 416s

端口

[root@guilin ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:8060            0.0.0.0:*               LISTEN      29114/nginx: master 
tcp        0      0 127.0.0.1:9121          0.0.0.0:*               LISTEN      29607/redis_exporte 
tcp        0      0 127.0.0.1:9090          0.0.0.0:*               LISTEN      29619/prometheus    
tcp        0      0 127.0.0.1:9187          0.0.0.0:*               LISTEN      29728/postgres_expo 
tcp        0      0 127.0.0.1:9093          0.0.0.0:*               LISTEN      29715/alertmanager  
tcp        0      0 127.0.0.1:9100          0.0.0.0:*               LISTEN      29596/node_exporter 
tcp        0      0 127.0.0.1:9229          0.0.0.0:*               LISTEN      29581/gitlab-workho 
tcp        0      0 127.0.0.1:9168          0.0.0.0:*               LISTEN      29604/puma 3.12.0 ( 
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      29062/unicorn maste 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      29114/nginx: master 
tcp        0      0 127.0.0.1:8082          0.0.0.0:*               LISTEN      29079/sidekiq 5.2.7 
tcp        0      0 127.0.0.1:9236          0.0.0.0:*               LISTEN      29562/gitaly        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1369/sshd           
tcp        0      0 127.0.0.1:3000          0.0.0.0:*               LISTEN      29737/grafana-serve 
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1498/master         
tcp6       0      0 :::9094                 :::*                    LISTEN      29715/alertmanager  
tcp6       0      0 ::1:9168                :::*                    LISTEN      29604/puma 3.12.0 ( 
tcp6       0      0 :::22                   :::*                    LISTEN      1369/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      1498/master  

安装结束了,现在可以打开网址设置管理员密码了。

http://10.150.7.5  #打开此网址,前面我们在配置文件中设定的。

file

赞(0) 打赏
未经允许不得转载:陈桂林博客 » CICD系列gitlab安装(一)

大佬们的评论 1

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    安装依赖 yum install policycoreutils-python

    he1年前 (2021-06-05)回复

全新“一站式”建站,高质量、高售后的一条龙服务

橙子建站.极速智能建站8折购买虚拟主机

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏