常用命令
  1. gitlab-ctl reconfigure #重新编译配置
  2. gitlab-ctl start # 启动
  3. gitlab-ctl stop # 停止
  4. gitlab-ctl restart # 重启
  5. gitlab-ctl status # 查看状态
  6. gitlab-ctl tail # 查看日志
  7. vi /etc/gitlab/gitlab.rb # 修改配置

查看服务状态
  1. [root@localhost ~]# gitlab-ctl status
  2. run: alertmanager: (pid 224124) 81166s; run: log: (pid 223418) 81323s
  3. run: gitaly: (pid 224146) 81166s; run: log: (pid 223304) 81324s
  4. run: gitlab-monitor: (pid 224167) 81166s; run: log: (pid 223352) 81324s
  5. run: gitlab-workhorse: (pid 224192) 81165s; run: log: (pid 223250) 81325s
  6. run: logrotate: (pid 236092) 1964s; run: log: (pid 223251) 81325s
  7. run: nginx: (pid 227942) 80560s; run: log: (pid 223181) 81326s
  8. run: node-exporter: (pid 224294) 81164s; run: log: (pid 223308) 81324s
  9. run: postgres-exporter: (pid 224307) 81163s; run: log: (pid 223428) 81323s
  10. run: postgresql: (pid 224318) 81163s; run: log: (pid 223216) 81325s
  11. run: prometheus: (pid 224327) 81162s; run: log: (pid 223417) 81323s
  12. run: redis: (pid 224371) 81162s; run: log: (pid 223215) 81325s
  13. run: redis-exporter: (pid 224376) 81162s; run: log: (pid 223354) 81324s
  14. run: sidekiq: (pid 227863) 80573s; run: log: (pid 223158) 81326s
  15. run: unicorn: (pid 228149) 80549s; run: log: (pid 223157) 81326s
  16. 格式:
  17. 进程名称:(进程ID编号)进程运行时间(秒);进程的日志服务 进程Id 日志运行时间
  18. run 表示进程运行正常
  19. down 表示进程没有启动或者挂掉,我们可以查看服务的日志信息,来定位问题。

查看服务日志

  1. # 检查redis的日志
  2. gitlab-ctl tail redis
  3. # 检查postgresql的日志
  4. gitlab-ctl tail postgresql
  5. # 检查gitlab-workhorse的日志
  6. gitlab-ctl tail gitlab-workhorse
  7. # 检查logrotate的日志
  8. gitlab-ctl tail logrotate
  9. # 检查nginx的日志
  10. gitlab-ctl tail nginx
  11. # 检查sidekiq的日志
  12. gitlab-ctl tail sidekiq
  13. # 检查unicorn的日志
  14. gitlab-ctl tail unicorn