磁盘空间告警处理

2019-07-31  本文已影响0人  戈羽殇雪

中午收到磁盘告警:
某分区磁盘使用率超过90%

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VGSYS-lv_root
                      9.8G  3.0G  6.3G  32% /
tmpfs                 7.8G     0  7.8G   0% /dev/shm
/dev/vda1             190M   32M  148M  18% /boot
/dev/mapper/VGSYS-lv_var
                      9.8G  443M  8.8G   5% /var
/dev/mapper/VGSYS-lv_ts
                      180G  162G   18G  91% /ts

实际上看到的/letv的空间并未占用过多空间

9.3G    app
175M    app-c
12K bin
191M    deploy
2.6G    jms-service-1
126M    jms.tar.gz
36G logs
7.2M    memcache
4.0K    record_gc.sh
109M    redis-4.0.6
123M    redis.tar.gz

实际还是df 与du 的差距:
df -h 和 du -sh 出现不同大小,尤其是出现目录满的情况下,大概率会出现,df -h
满,但du -sh占用很小
1.考虑正在跑的进程,使用的文件被删除,但是空间未释放的情况

lsof |grep deleted

2.考虑inode使用的情况
如果indode 使用过多的话,一样会出现磁盘满的情况
3.考虑磁盘挂载的情况
若挂载磁盘之前,挂载点有别的文件,挂载其他设备后,会把原来的文件变为隐藏文件,同样会占用空间

首先

lsof |grep deleted
nginx     23267  worker    2w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23267  worker   16w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23267  worker   18w      REG              253,2 119428723571  537239308 /ts/logs/nginx/upgrade-access.log-20190312 (deleted)
nginx     23268  worker    2w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23268  worker   16w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23268  worker   18w      REG              253,2 119428723571  537239308 /ts/logs/nginx/upgrade-access.log-20190312 (deleted)
nginx     23269  worker    2w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23269  worker   16w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23269  worker   18w      REG              253,2 119428723571  537239308 /ts/logs/nginx/upgrade-access.log-20190312 (deleted)
nginx     23270  worker    2w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23270  worker   16w      REG              253,2       873779  537338764 /ts/logs/nginx/error.log-20190312 (deleted)
nginx     23270  worker   18w      REG              253,2 119428723571  537239308 /ts/logs/nginx/upgrade-access.log-20190312 (deleted)

实际上是删除的错误日志仍然占用空间
重启nginx 进程之后,空间就释放了

上一篇下一篇

猜你喜欢

热点阅读