常用命令
gitlab-ctl reconfigure #重新编译配置gitlab-ctl start # 启动gitlab-ctl stop # 停止gitlab-ctl restart # 重启gitlab-ctl status # 查看状态gitlab-ctl tail # 查看日志vi /etc/gitlab/gitlab.rb # 修改配置
查看服务状态
[root@localhost ~]# gitlab-ctl statusrun: alertmanager: (pid 224124) 81166s; run: log: (pid 223418) 81323srun: gitaly: (pid 224146) 81166s; run: log: (pid 223304) 81324srun: gitlab-monitor: (pid 224167) 81166s; run: log: (pid 223352) 81324srun: gitlab-workhorse: (pid 224192) 81165s; run: log: (pid 223250) 81325srun: logrotate: (pid 236092) 1964s; run: log: (pid 223251) 81325srun: nginx: (pid 227942) 80560s; run: log: (pid 223181) 81326srun: node-exporter: (pid 224294) 81164s; run: log: (pid 223308) 81324srun: postgres-exporter: (pid 224307) 81163s; run: log: (pid 223428) 81323srun: postgresql: (pid 224318) 81163s; run: log: (pid 223216) 81325srun: prometheus: (pid 224327) 81162s; run: log: (pid 223417) 81323srun: redis: (pid 224371) 81162s; run: log: (pid 223215) 81325srun: redis-exporter: (pid 224376) 81162s; run: log: (pid 223354) 81324srun: sidekiq: (pid 227863) 80573s; run: log: (pid 223158) 81326srun: unicorn: (pid 228149) 80549s; run: log: (pid 223157) 81326s格式:进程名称:(进程ID编号)进程运行时间(秒);进程的日志服务 进程Id 日志运行时间run 表示进程运行正常down 表示进程没有启动或者挂掉,我们可以查看服务的日志信息,来定位问题。
查看服务日志
# 检查redis的日志gitlab-ctl tail redis# 检查postgresql的日志gitlab-ctl tail postgresql# 检查gitlab-workhorse的日志gitlab-ctl tail gitlab-workhorse# 检查logrotate的日志gitlab-ctl tail logrotate# 检查nginx的日志gitlab-ctl tail nginx# 检查sidekiq的日志gitlab-ctl tail sidekiq# 检查unicorn的日志gitlab-ctl tail unicorn