GitLab 常用命令


 

 

GitLab 常用命令

# 啟動所有 gitlab 組件:
gitlab-ctl start
# 停止所有 gitlab 組件:
gitlab-ctl stop
# 停止 postgresql 組件:
gitlab-ctl stop postgresql
# 停止相關數據連接服務
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 重啟所有 gitlab 組件:
gitlab-ctl restart
# 重啟 gitlab-workhorse 組件:
gitlab-ctl restart gitlab-workhorse
# 查看服務狀態
gitlab-ctl status

# 如果更改了主配置文件 [:/etc/gitlab/gitlab.rb 文件],需要用這個命令,使配置文件生效 但是會初始化除了gitlab.rb 之外的所有文件

sudo gitlab-ctl reconfigure

 

執行完上面那個命令 重啟所有 gitlab 組件

gitlab-ctl restart

針對某個服務重啟 例如重啟nginx

gitlab-ctl restart nginx

針對某個服務啟動 例如啟動nginx

gitlab-ctl start nginx

針對某個服務關閉 例如關閉nginx

gitlab-ctl stop nginx


# 查看日志 (查看gitlab整個所有的日志)
sudo gitlab-ctl tail

具體的日志文件路徑:

[root@ci-node1 src]# ll /var/log/gitlab/
total 12
drwx------ 2 git               root         95 Mar 23 23:27 gitaly
drwx------ 2 git               root         95 Mar 23 23:27 gitlab-monitor
drwx------ 2 git               root       4096 Mar 28 00:39 gitlab-rails
drwx------ 2 git               root        204 Mar 28 00:39 gitlab-shell
drwx------ 2 git               root         95 Mar 23 23:27 gitlab-workhorse
drwx------ 2 root              root         95 Mar 23 23:27 logrotate
drwxr-x--- 2 root              gitlab-www 4096 Mar 28 00:39 nginx
drwx------ 2 gitlab-prometheus root         95 Mar 23 23:27 node-exporter
drwx------ 2 gitlab-psql       root         95 Mar 23 23:27 postgres-exporter
drwx------ 2 gitlab-psql       root         95 Mar 23 23:27 postgresql
drwx------ 2 gitlab-prometheus root        235 Mar 27 23:27 prometheus
drwxr-xr-x 2 root              root         28 Mar 22 23:25 reconfigure
drwx------ 2 gitlab-redis      root        235 Mar 27 23:27 redis
drwx------ 2 gitlab-redis      root         95 Mar 23 23:27 redis-exporter
drwx------ 2 git               root        235 Mar 27 23:27 sidekiq
drwx------ 2 git               root       4096 Mar 28 00:39 unicorn

一般有問題 有報錯時候 可以看 所有輸出 gitlab-ctl tail

# 檢查 redis 的日志
sudo gitlab-ctl tail redis


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM