006. Gitlab组件介绍

Gitlab组件

[root@master tools]# gitlab-ctl status    #检查服务状态
run: gitaly: (pid 26704) 2201s; run: log: (pid 25672) 2576s       
run: gitlab-monitor: (pid 26715) 2201s; run: log: (pid 25775) 2569s #
run: gitlab-workhorse: (pid 26724) 2201s; run: log: (pid 25571) 2595s #轻量级的反向代理服务器
run: logrotate: (pid 26733) 2200s; run: log: (pid 25608) 2582s  #用于处理日志.
run: nginx: (pid 26740) 2200s; run: log: (pid 25590) 2588s   #作为静态web资源服务器的
run: node-exporter: (pid 26746) 2199s; run: log: (pid 25719) 2575s
run: postgres-exporter: (pid 26752) 2199s; run: log: (pid 25829) 2561s
run: postgresql: (pid 26761) 2198s; run: log: (pid 25350) 2639s
run: prometheus: (pid 26804) 2198s; run: log: (pid 25810) 2562s
run: redis: (pid 26813) 2198s; run: log: (pid 25278) 2645s
run: redis-exporter: (pid 26817) 2197s; run: log: (pid 25789) 2568s
run: sidekiq: (pid 26831) 2195s; run: log: (pid 25553) 2601s
run: unicorn: (pid 26855) 2194s; run: log: (pid 25515) 2603s

Gitlab工作流程

gitlab基础命令

gitlab-ctl tail       #查看gitlab日志.
gitlab-ctl reconfigure    #重新配置gitlab
gitlab-ctl restart        #重启所有gitlab服务,gitlab-ctl restart [服务名]  重启指定服务. 
gitlab-ctl stop         #停止所有gitlab服务,gitlab-ctl 停止 [服务名]  停止指定服务. 
gitlab-ctl status       #查看所有服务状态, gitlab-ctl status [服务名] 查看指定服务状态

Gitlab日志

gitlab默认日志路径:  /var/log/gitlab

[root@master gitlab]# ll /var/log/gitlab/
total 0
drwx------ 2 git               root        95 Dec 17 18:21 gitaly     
drwx------ 2 git               root        95 Dec 17 18:18 gitlab-monitor
drwx------ 2 git               root       188 Dec 16 01:57 gitlab-rails
drwx------ 2 git               root        30 Dec 16 01:57 gitlab-shell
drwx------ 2 git               root        95 Dec 17 18:28 gitlab-workhorse
drwx------ 2 root              root        95 Dec 17 18:21 logrotate
drwxr-x--- 2 root              gitlab-www 131 Dec 16 01:58 nginx
drwx------ 2 gitlab-prometheus root        95 Dec 17 18:21 node-exporter
drwx------ 2 gitlab-psql       root        95 Dec 17 18:21 postgres-exporter
drwx------ 2 gitlab-psql       root        95 Dec 17 18:21 postgresql
drwx------ 2 gitlab-prometheus root        95 Dec 17 18:20 prometheus
drwxr-xr-x 2 root              root        28 Dec 16 01:56 reconfigure
drwx------ 2 gitlab-redis      root        95 Dec 17 18:18 redis
drwx------ 2 gitlab-redis      root        95 Dec 17 18:21 redis-exporter
drwx------ 2 git               root        95 Dec 17 18:19 sidekiq
drwx------ 2 git               root       147 Dec 17 18:22 unicorn

#综合日志查看:
gitlab-ctl  tail 
gitlab-ctl tail nginx    #只查看nginx日志.

Gitlab目录

#gitlab库的默认存储目录:
/var/opt/gitlab/git-data/repositories/


#gitlab默认日志路径:  /var/log/gitlab/
#该目录存储了gitlab组件产生的日志
[root@master gitlab]# ll /var/log/gitlab/
total 0
drwx------ 2 git               root        95 Dec 17 18:21 gitaly
drwx------ 2 git               root        95 Dec 17 18:18 gitlab-monitor
drwx------ 2 git               root       188 Dec 16 01:57 gitlab-rails
drwx------ 2 git               root        30 Dec 16 01:57 gitlab-shell
drwx------ 2 git               root        95 Dec 17 18:28 gitlab-workhorse
drwx------ 2 root              root        95 Dec 17 18:21 logrotate
drwxr-x--- 2 root              gitlab-www 131 Dec 16 01:58 nginx
drwx------ 2 gitlab-prometheus root        95 Dec 17 18:21 node-exporter
drwx------ 2 gitlab-psql       root        95 Dec 17 18:21 postgres-exporter
drwx------ 2 gitlab-psql       root        95 Dec 17 18:21 postgresql
drwx------ 2 gitlab-prometheus root        95 Dec 17 18:20 prometheus
drwxr-xr-x 2 root              root        28 Dec 16 01:56 reconfigure
drwx------ 2 gitlab-redis      root        95 Dec 17 18:18 redis
drwx------ 2 gitlab-redis      root        95 Dec 17 18:21 redis-exporter
drwx------ 2 git               root        95 Dec 17 18:19 sidekiq
drwx------ 2 git               root       147 Dec 17 18:22 unicorn


#应用代码和响应依赖程序目录:
[root@master gitlab]# ll /opt/gitlab/
total 1624
drwxr-xr-x  2 root root     108 Dec 16 01:45 bin
-rw-r--r--  1 root root  157364 Nov 24  2017 dependency_licenses.json
drwxr-xr-x 18 root root     218 Dec 16 01:57 embedded
drwxr-xr-x  6 root root     166 Dec 16 01:58 etc
drwxr-xr-x  2 root root     243 Dec 16 01:58 init
-rw-r--r--  1 root root 1460869 Nov 24  2017 LICENSE
drwxr-xr-x  2 root root    4096 Dec 16 01:45 LICENSES
drwxr-xr-x  2 root root     243 Dec 16 01:58 service
drwxr-xr-x 15 root root     243 Dec 16 01:58 sv
drwxr-xr-x  3 root root      21 Dec 16 01:57 var
-rw-r--r--  1 root root   19881 Nov 24  2017 version-manifest.json
-rw-r--r--  1 root root    8696 Nov 24  2017 version-manifest.txt

#gitlab配置文件目录:
[root@master gitlab]# ll  /etc/gitlab/
total 84
-rw------- 1 root root 72677 Dec 16 01:55 gitlab.rb
-rw------- 1 root root  9663 Dec 16 01:57 gitlab-secrets.json
drwxr-xr-x 2 root root     6 Dec 16 01:57 trusted-certs


#备份文件生成的目录:
/var/opt/gitlab/backups/

#gitlab数据目录:
[root@master gitlab]# ll /var/opt/gitlab/
total 8
drwx------ 2 git               root         6 Dec 16 01:57 backups
-rw------- 1 root              root        38 Dec 16 01:58 bootstrapped
drwx------ 2 git               root        46 Dec 16 02:04 gitaly
drwx------ 3 git               root        26 Dec 16 01:57 git-data
drwxr-xr-x 3 git               root        20 Dec 16 01:57 gitlab-ci
drwxr-xr-x 2 git               root        32 Dec 16 01:58 gitlab-monitor
drwxr-xr-x 9 git               root       160 Dec 16 01:57 gitlab-rails
drwx------ 2 git               root        24 Dec 16 01:57 gitlab-shell
drwxr-x--- 2 git               gitlab-www  54 Dec 16 02:04 gitlab-workhorse
drwx------ 3 root              root        71 Dec 16 08:44 logrotate
drwxr-x--- 9 root              gitlab-www 163 Dec 16 02:04 nginx
drwxr-xr-x 3 root              root        32 Dec 16 01:58 node-exporter
drwx------ 2 gitlab-psql       root        26 Dec 16 01:58 postgres-exporter
drwxr-xr-x 3 gitlab-psql       root        81 Dec 16 02:04 postgresql
drwxr-x--- 3 gitlab-prometheus root        40 Dec 16 01:58 prometheus
drwxr-x--- 2 gitlab-redis      git         60 Dec 17 18:43 redis
-rw-r--r-- 1 root              root        40 Dec 16 01:57 trusted-certs-directory-hash

#gitlab仓库数据目录:
ll /var/opt/gitlab/git-data/repositories/

关闭私有仓库注册

企业中,一般都是来人后创建gitlab账户进行分配,而不需要用户主动注册,所以注册功能需要关闭.

现有的私有仓库有注册功能:

关闭注册功能:

设置好了,下拉到底下 save

检查效果:

此时登录页面只有Sign in 没有 Sign up按钮了

gitlab自定义标题

配置效果:

除此之外还可以设置logo,这里就不设置了..浪费青春!
http://IP/admin/appearance

微信赞赏

支付宝赞赏

原文地址:https://www.cnblogs.com/superlinux/p/15385124.html