一次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. 问题得到解决。
相关推荐
切糕师学AI15 小时前
GitLab 是什么?
gitlab
明月心9522 天前
git remote add 用法
gitlab
only_Klein3 天前
jenkins流水线报错:Connection reset by peer
ci/cd·kubernetes·gitlab·jenkins·ssl
梁萌4 天前
docker部署gitlab和gitlab runner
docker·eureka·gitlab
johnnyAndCode4 天前
Idea 设置GitLab时使用账密,而不是token的配置方法
gitlab·idea
天外飞雨4 天前
Gitlab使用
gitlab
BUTCHER54 天前
GitLab SSH 密钥配置
运维·ssh·gitlab
明月心9524 天前
GitLab使用
gitlab
明月心9525 天前
gitlab pull requets
gitlab
BUTCHER55 天前
GitLab基本设置
gitlab