【Git】如何检查 Ubuntu 系统上 gitLab 是否开启

Ubuntu 检查 GitLab 是否运行(Omnibus 官方安装包,主流方式)

1. 查看 gitlab 服务状态(最推荐)

bash 复制代码
sudo gitlab-ctl status

输出示例(正常运行):

复制代码
run: gitaly: (pid 1234) 1234s; run: log: (pid 1230) 1235s
run: gitlab-workhorse: (pid 1236) 1234s; run: log: (pid 1231) 1235s
run: nginx: (pid 1237) 1234s; run: log: (pid 1232) 1235s
run: postgresql: (pid 1238) 1234s; run: log: (pid 1233) 1235s
run: redis: (pid 1239) 1234s; run: log: (pid 1234) 1235s
run: sidekiq: (pid 1240) 1234s; run: log: (pid 1235) 1235s
run: unicorn: (pid 1241) 1234s; run: log: (pid 1236) 1235s
  • run: = 正常运行
  • down: = 已停止

只看汇总简化输出:

bash 复制代码
sudo gitlab-ctl status | grep down

无输出代表全部组件正常。

2. 查看系统 systemd 服务

GitLab 整套托管在 gitlab-runsvdir

bash 复制代码
systemctl status gitlab-runsvdir
  • active (running):GitLab 总服务已启动
  • inactive (dead):完全关闭

3. 端口监听检测(验证 Web 服务可访问)

默认 GitLab 使用 80/443 端口:

bash 复制代码
# 查看80、443端口监听
ss -tlnp | grep -E "80|443"

看到 nginx 进程即 Web 服务正常。

4. 快速启停命令备用

bash 复制代码
# 启动
sudo gitlab-ctl start
# 停止
sudo gitlab-ctl stop
# 重启
sudo gitlab-ctl restart
# 重载配置(改gitlab.rb后执行)
sudo gitlab-ctl reconfigure

5. 源码部署 GitLab(非 omnibus 安装,极少用)

如果是手动源码编译,用:

bash 复制代码
# 检查 unicorn/puma、redis、postgresql、nginx 进程
ps aux | grep -E "unicorn|puma|redis|postgres"

补充:判断机器是否安装过 GitLab

bash 复制代码
# 存在配置文件即代表已安装
ls /etc/gitlab/gitlab.rb

文件不存在 = 未安装 GitLab。

相关推荐
lar_slw10 小时前
git删除上一次提交
git
一叶龙洲21 小时前
win11与Ubuntu之间同步配置、插件
linux·运维·ubuntu
QN1幻化引擎1 天前
SFA 信号场注意力:用8KB参数换248x KV Cache压缩,边缘设备也能跑长序列
人工智能·算法·gitee·gitlab
leoZ2311 天前
Git 集成实战完全指南(四):Git 冲突解决
大数据·git·elasticsearch
阿里云云原生1 天前
研发福音:云效 AI 智能评审正式支持 GitLab 集成,VPC 内网即可实现自动审阅
gitlab
小秋求学记.1 天前
Linux_Ubuntu的相关问题
linux·运维·ubuntu
枫荷1 天前
Git LFS 大文件优化说明
git
ly-272531 天前
Ubuntu重启之后挂载盘符变更应该怎么修复
linux·ubuntu
techdashen1 天前
不用再反复 stash:用 Git Worktree 同时开发多个分支
大数据·git·elasticsearch