- Edit the daemon configuration file:
$ vim /etc/docker/daemon.json
- Add the following lines to file:
{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" } }
- Restart the docker daemon:
systemctl restart docker
- Chinese File with mirrors
{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" }, "registry-mirrors": [ "https://dockerhub.azk8s.cn", "https://n6mdpfki.mirror.aliyuncs.com", "https://reg-mirror.qiniu.com", "http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn", "https://registry.docker-cn.com" ] }
执行 lsof +L1 rsyslogd 2163711 root 38w REG 253,1 28035581675 0 395729 /var/log/messages-202210071665085022 (deleted) 这个rsyslogd 占了20多G的日志 执行systemctl stop rsyslog 解决
评论
发表评论