常用命令
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 status
run: alertmanager: (pid 224124) 81166s; run: log: (pid 223418) 81323s
run: gitaly: (pid 224146) 81166s; run: log: (pid 223304) 81324s
run: gitlab-monitor: (pid 224167) 81166s; run: log: (pid 223352) 81324s
run: gitlab-workhorse: (pid 224192) 81165s; run: log: (pid 223250) 81325s
run: logrotate: (pid 236092) 1964s; run: log: (pid 223251) 81325s
run: nginx: (pid 227942) 80560s; run: log: (pid 223181) 81326s
run: node-exporter: (pid 224294) 81164s; run: log: (pid 223308) 81324s
run: postgres-exporter: (pid 224307) 81163s; run: log: (pid 223428) 81323s
run: postgresql: (pid 224318) 81163s; run: log: (pid 223216) 81325s
run: prometheus: (pid 224327) 81162s; run: log: (pid 223417) 81323s
run: redis: (pid 224371) 81162s; run: log: (pid 223215) 81325s
run: redis-exporter: (pid 224376) 81162s; run: log: (pid 223354) 81324s
run: sidekiq: (pid 227863) 80573s; run: log: (pid 223158) 81326s
run: 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