others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

centos7 gitlab-ce 社区版安装

访问量:1099 创建时间:2020-04-07

准备环境

[root@zb-192-168-1-139 ~]# yum -y install curl policycoreutils openssh-server openssh-clients postfix
[root@zb-192-168-1-139 ~]# wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh
[root@zb-192-168-1-139 ~]# sh script.rpm.sh 
[root@zb-192-168-1-139 ~]# systemctl start postfix && systemctl enable postfix
[root@zb-192-168-1-139 ~]# yum install -y gitlab-ce

配置gitlab

修改gitlab配置文件

[root@zb-192-168-1-139 ~]# cat /etc/gitlab/gitlab.rb | egrep -v '^#|^$'
external_url 'http://192.168.1.139'
nginx['listen_https'] = 8088

初始化gitlab

[root@zb-192-168-1-139 ~]# gitlab-ctl reconfigure

启动gitlab

[root@zb-192-168-1-139 ~]# gitlab-ctl restart
[root@zb-192-168-1-139 ~]# gitlab-ctl status
run: alertmanager: (pid 4170) 523605s; run: log: (pid 26867) 523983s
run: gitaly: (pid 4227) 523604s; run: log: (pid 24464) 524080s
run: gitlab-exporter: (pid 4234) 523604s; run: log: (pid 26462) 523999s
run: gitlab-workhorse: (pid 4250) 523603s; run: log: (pid 25723) 524029s
run: grafana: (pid 4268) 523603s; run: log: (pid 27560) 523953s
run: logrotate: (pid 14090) 1332s; run: log: (pid 26082) 524013s
run: nginx: (pid 4293) 523602s; run: log: (pid 25823) 524023s
run: node-exporter: (pid 4379) 523602s; run: log: (pid 26326) 524005s
run: postgres-exporter: (pid 4385) 523601s; run: log: (pid 26961) 523979s
run: postgresql: (pid 4422) 523601s; run: log: (pid 24714) 524074s
run: prometheus: (pid 4432) 523600s; run: log: (pid 26759) 523987s
run: redis: (pid 4446) 523600s; run: log: (pid 24279) 524086s
run: redis-exporter: (pid 4498) 523600s; run: log: (pid 26587) 523993s
run: sidekiq: (pid 4547) 523598s; run: log: (pid 25660) 524032s
run: unicorn: (pid 4582) 523596s; run: log: (pid 25503) 524038s

查看gitlab的nginx日志与配置文件(如果端口被其他程序占用,通过nginx的配置文件修改端口):

/var/opt/gitlab/nginx/logs/error.log /var/opt/gitlab/nginx/conf/gitlab-http.conf 我本机因为安装了k8s的ingress占用了80端口,修改gitlab-http.conf的端口listen *:8088;

访问 http://IP:PORT ,第一次访问会让用户设置密码,用户名为root.

在gitlab创建项目

在web中创建组 ops,在ops组中创建测试用的project opstest (用于后面的上传代码、jenkins构建image、使用)。创建过程此处省略。

登陆评论: 使用GITHUB登陆