Closed emenwin closed 3 years ago
.log 文件不是日志文件, 不要删除!
*.log 文件是 leveldb 的数据文件, 正常不会有 30GB 大小, 你的使用场景是什么?
我做了一个未读文章的推服务,每个订阅用户维持一个 zset有序列表,新的文章按照发布时间 将文章唯一id 添加到zset内。 如果用户标记已读,则从表内删除
现在的处理:
在vps上重新附加了一块200G硬盘,将var/data 转移到这块硬盘上。 通过观察,log文件增加到30多G以后,log 大小会重新变为0 ,然后再继续增长。 继续观察使用情况
使用的空间继续增长了:
-rw-r--r-- 1 root root 133G May 3 08:22 001889.log
如何限制大小?或者调整业务逻辑?
如果你没有改源码, 或者做特殊的配置的话, .log 文件应该不会超过 4GB. 因为你的情况是出现了 133GB 的大小, 所以, 你需要检查一下运维工具, 把定期删除文件或者其它类似的运维脚本停掉. 你再仔细想想, 自己是否做了某些操作?
建议你找一个干净的环境, 使用默认的源码和默认的配置, 看看能否复现这个问题.
猜测应该是开始误删除 log 文件导致的。 具体原因未知
请问下var/data目录中 000xxx.log 的日志文件是如何产生的?如何禁止
该log文件非常巨大,000.ldb 文件合计700M, 而单个 000.log 文件大小就达到近30G。
系统环境:
VPS:2C8G 、50G硬盘。 个人使用,所以对于空间利用比较敏感,请问如何操作。
已经操作:
ssdb.conf logger : level -> error replication: binlog -> no
同时:
已经写了定时任务
/1 rm -rf /usr/local/ssdb/var/data/.log , 虽然文件可以删除,但ssdb 仍然持有该文件,所有导致 df -h 查看磁盘大小时,磁盘使用率始终100%,只有重启ssdb后磁盘才被释放。
配置文件如下: