关闭服务
gitlab-ctl stop
启动服务
gitlab-ctl start
查看状态
gitlab-ctl status
停止或重启gitlab的postgresql数据库
gitlab-ctl stop postgresql
gitlab-ctl restart postgresql
重启gitlab的redis
gitlab-ctl stop redis
gitlab-ctl restart redis
重启gitlab的alertmanager
gitlab-ctl stop alertmanager
gitlab-ctl restart alertmanager
重启gitlab的sidekiq
gitlab-ctl stop sidekiq
gitlab-ctl restart sidekiq
重启gitlab的unicorn
gitlab-ctl stop unicorn
gitlab-ctl restart unicorn
重启gitlab的puma
gitlab-ctl stop puma
gitlab-ctl restart puma
查看gitlab运行时日志命令
gitlab-ctl tail
查看gitlab的redis日志命令
gitlab-ctl tail redis
查看gitlab的redis日志命令
gitlab-ctl tail postgresql
查看gitlab的alertmanager日志命令
gitlab-ctl tail alertmanager
查看gitlab的sidekiq日志命令
gitlab-ctl tail sidekiq
查看gitlab的unicorn日志命令,unicorn是一个web应用服务器,在gitlab14版本以后弃用
gitlab-ctl tail unicorn
查看gitlab的puma日志命令,puma是一个web应用服务器,puma替代了unicorn
gitlab-ctl tail puma
检测正在运行的gitlab是否有异常
gitlab-rake gitlab:check --trace
gitlab-rake db:migrate:status --trace
设置跳过自动备份
touch /etc/gitlab/skip-auto-backup
设置启动自动备份
rm -rf /etc/gitlab/skip-auto-backup
查看gitlab和重要组件的版本信息
gitlab-rake gitlab:env:info
查看gitlab的版本号
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
设置使用官方YUM源
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
安装比当前低的版本【一般无法正常安装成功】
rpm -Uvh --oldpackage gitlab-ce-12.3.9-ce.0.el7.x86_64.rpm
删除gitlab的redis临时数据文件
rm -rf /var/opt/gitlab/redis/dump.rdb
升级数据库
gitlab-ctl pg-upgrade
安装升级新版本
gitlab-ctl stop unicorn
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm【版本号按需填】
gitlab-ctl restart
安装新版本时跳过自动更新配置【慎用】
touch /etc/gitlab/skip-auto-reconfigure
恢复安装新版本时自动更新配置
rm -rf /etc/gitlab/skip-auto-reconfigure
gitlab的rmp下载地址:
Index of /gitlab-ce/yum/el7/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror