一次gitlab 502故障解决过程

  1. 通过top,发现prometheus进程占用CPU接近100%,这肯定有点异常。
  2. gitlab-ctl tail prometheus 发现有报错的情况,提示空间不足。暂时不管空间的问题。
bash 复制代码
2024-03-07_05:48:09.01515 ts=2024-03-07T05:48:09.014Z caller=main.go:1116 level=error err="opening storage failed: lock DB directory: open /var/opt/gitlab/prometheus/data/lock: no space left on device"
  1. 于是就想关掉prometheus,参考 https://blog.csdn.net/yuer5531/article/details/105491190 关掉prometheus。
bash 复制代码
gitlab-ctl stop
vim /etc/gitlab/gitlab.rb //修改prometheus
gitlab-ctl reconfigure
gitlab-ctl start
  1. gitlab-ctl reconfigure 执行失败,还是提示空间不足。
  2. df 发现空间足够。
bash 复制代码
root@debian:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           796M   11M  786M   2% /run
/dev/sda1        25G  9.5G   14G  41% /
tmpfs           3.9G   60K  3.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sdb1       2.0T  869M  1.9T   1% /git-data
  1. chatgpt 搜了一下空间不足,但是df查看是有空间的。提示inode可能用完。于是用df -i 查看,果然inode用光。
bash 复制代码
root@debian:~# df -i
Filesystem        Inodes   IUsed     IFree IUse% Mounted on
udev             1014087     339   1013748    1% /dev
tmpfs            1018501     440   1018061    1% /run
/dev/sda1        1628800 1628800         0  100% /
tmpfs            1018501       3   1018498    1% /dev/shm
tmpfs            1018501       2   1018499    1% /run/lock
/dev/sdb1      134217728   10076 134207652    1% /git-data
  1. 现在就要找到什么地方用了这么多的inode。使用find /var/opt/gitlab/ -type f。发现var/opt/gitlab/prometheus/data/wal/ 目录下存在大量的空文件。这和prometheus进程CPU占用过高有些巧合。估计就是这个地方文件过多导致。
  2. 据查prometheus是负责监控的,删掉这个目录似乎影响不大,于是删除整个目录。rm var/opt/gitlab/prometheus/data/wal/ -rf。
bash 复制代码
vim /etc/gitlab/gitlab.rb //修改prometheus
gitlab-ctl reconfigure
gitlab-ctl start
  1. 问题得到解决。
相关推荐
Littlehero_1217 小时前
关于删除gitlab中的分支
gitlab
极小狐1 天前
GitLab 安全漏洞 CVE-2025-7739 解决方案
ci/cd·gitlab·devsecops·devops·极狐gitlab
运维开发王义杰5 天前
YAML:锚点深度解析,告别重复,拥抱优雅的配置艺术
ci/cd·gitlab
hkNaruto6 天前
【Docker】openEuler 使用docker-compose部署gitlab-ce
docker·容器·gitlab
hl04069 天前
GitLab CI + Docker 自动构建前端项目并部署 — 完整流程文档
ci/cd·docker·gitlab
先天打工圣体的男人9 天前
Linux环境gitlab多种部署方式及具体使用
运维·git·gitlab
委婉待续9 天前
基于linux环境在centos7上部署gitlab
gitlab
疯狂吧小飞牛13 天前
基于ubuntu搭建gitlab
linux·ubuntu·gitlab
__Smile°15 天前
Gitlab+Jenkins+K8S+Registry 建立 CI/CD 流水线
linux·ci/cd·docker·kubernetes·gitlab·jenkins
某某15 天前
gitlab启动失败,如何解决
gitlab