使用gitlab-runner 經(jīng)常會(huì)遇到一個(gè)問(wèn)題
故障現(xiàn)場(chǎng)
- 系統(tǒng)環(huán)境 centos 7, docker 下的 gitlab-runner
npm WARN tar ENOSPC: no space left on device, write Unhandled rejection Error: ENOSPC: no space left on device, write npm ERR! cb() never called! npm ERR! This is an error with npm itself. Please report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-08-16T08_39_27_535Z-debug.log
排查過(guò)程
- 登錄到gitlab-runner 服務(wù)器, 查看磁盤(pán)利用率
df -h
文件系統(tǒng) 容量 已用 可用 已用% 掛載點(diǎn) /dev/sda2 48G 48G 0 100% / devtmpfs 63G 0 63G 0% /dev tmpfs 63G 0 63G 0% /dev/shm tmpfs 63G 2.8G 61G 5% /run tmpfs 63G 0 63G 0% /sys/fs/cgroup /dev/sda3 228G 19G 210G 9% /export /dev/sdb1 22T 13T 9.7T 56% /data tmpfs 13G 0 13G 0% /run/user/0
-
/dev/sda2
容量已經(jīng)用完了, 檢查一下本機(jī)docker存儲(chǔ)位置$ sudo docker info | grep "Docker Root Dir WARNING: You're not using the default seccomp profile WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled Docker Root Dir: /var/lib/docker
- 果然是存在
/dev/sda2
這個(gè)分區(qū)下
解決方案
將docker存儲(chǔ)位置掛載到
/dev/sdb1
下
- 停用docker
service docker stop
- 遷移文件
mv /var/lib/docker /data/docker ln -s /data/docker /var/lib/docker
- 重啟docker
service docker start
- 重啟container
$ docker ps -a $ docker start gitlab-runner