当前位置:网站首页>debian10系统问题总结
debian10系统问题总结
2022-07-07 16:00:00 【一个运维小青年】
问题一:普通用户使用不了java -version

解决方法;Root为普通用户授予JAVA权限
sudo chmod -R 755 java安装目录
sudo chown -R [username] java安装目录
已经解决
问题磁盘占用空间爆满

去/下查看文件大小
du -sh *

接着查找
最终找到问题
【已解决】docker overlay2占用大量磁盘空间处理方法
Docker 清理数据卷 volumes

处理方式1:
在使用docker时,往往会出现磁盘空间不足,导致该问题的通常原因是因为docker中部署的系统输出了大量的日志内容。
此时,可通过手动或定时任务进行清除。
针对/var/lib/docker/overlay2空间占用很大网上提供了很多解决方案,其中有些误导的说法需要去迁移路径等操作。其实磁盘空间的占用和overlay没关系(它的usage和真实的disk usage相同),它只是一个docker的虚拟文件系统,真实的文件系统是前者/dev/vda1,可以看到路径所指为根目录,所以你要去找是哪里出现了垃圾。
通常情况下与overlay2的同级目录下会有如下的目录:
网上查一下这个目录的作用,说是 overlay/overlay2表示Docker的存储驱动继续在网上搜资料,说可以看看是不是死掉容器过多的原因,使用 docker ps -a看了下,果然是。于是清理了一下无用的容器,硬盘就恢复正常了……
简单办法
多看了一下资料,发现可以使用 docker system prune来自动清理空间,参考下面:
该指令默认会清除所有如下资源:
已停止的容器(container)
未被任何容器所使用的卷(volume)
未被任何容器所关联的网络(network)
所有悬空镜像(image)。
指令默认只会清除悬空镜像,未被使用的镜像不会被删除。
添加 -a 或 --all 参数后,可以一并清除所有未使用的镜像和悬空镜像。
可以添加 -f 或 --force 参数用以忽略相关告警确认信息。
指令结尾处会显示总计清理释放的空间大小。
(https://yq.aliyun.com/articles/272173 )
另外,使用下面命令可以查看docker所占的硬盘大小,如:
docker system df

Docker 查看数据卷及磁盘使用情况
Docker 在长时间使用的情况下,经常需要删除旧的容器并创建新的容器,长此以往,Docker 的数据卷 volumes 会产生了非常多的僵尸文件,这些将是稳健大都是未绑定容器的目录

Docker 删除无用数据卷
手动删除命令
复制代码
删除所有dangling数据卷(即无用的Volume,僵尸文件)
docker volume rm $(docker volume ls -qf dangling=true)
删除所有dangling镜像(即无tag的镜像)
docker rmi $(docker images | grep “^” | awk “{
print $3}”)
删除所有关闭的容器
docker ps -a | grep Exit | cut -d ’ ’ -f 1 | xargs docker rm
复制代码
删除关闭的容器、无用的数据卷和网络,以及dangling镜像(即无tag的镜像)
注意,所有关闭的容器都会被删除,请核查是否存在关闭运行但是需要保留的容器
删除关闭的容器、无用的数据卷和网络
docker system prune
删除更彻底,可以将没有容器使用Docker镜像都删掉
docker system prune -a
重启 Docker
使用上面几个方法的命令可以有效清理 Docker 运行所产生的无用文件,且无需重启 Docker 即可生效。
Docker镜像都删掉
docker system prune -a
重启 Docker
使用上面几个方法的命令可以有效清理 Docker 运行所产生的无用文件,且无需重启 Docker 即可生效。
但是 Docker 也许存在某些 bug(内核 3.13 版本的 Docker 确诊),导致 Docker 无法清理一些无用目录,不过重启 Docker 可以解决这个问题
边栏推荐
- 漫画 | 宇宙第一 IDE 到底是谁?
- Introduction to OTA technology of Internet of things
- Ratingbar的功能和用法
- [OKR target management] value analysis
- 讨论 | AR 应用落地前,要做好哪些准备?
- SD_DATA_RECEIVE_SHIFT_REGISTER
- [OKR target management] case analysis
- Audio device strategy audio device output and input selection is based on 7.0 code
- [network attack and defense principle and technology] Chapter 4: network scanning technology
- How to implement safety practice in software development stage
猜你喜欢

什么是敏捷测试

深度学习机器学习各种数据集汇总地址

Target detection 1 -- actual operation of Yolo data annotation and script for converting XML to TXT file

机器视觉(1)——概述

带动画的列表选中js特效

Chapter 2 building CRM project development environment (building development environment)

AI 击败了人类,设计了更好的经济机制

线上比赛相关规则补充说明

目标检测1——YOLO数据标注以及xml转为txt文件脚本实战

深入浅出图解CNN-卷积神经网络
随机推荐
USB通信协议深入理解
[trusted computing] Lesson 13: TPM extended authorization and key management
Chapter 3 business function development (user login)
Tips of the week 136: unordered containers
使用OneDNS完美解决办公网络优化问题
SD_DATA_SEND_SHIFT_REGISTER
Define menus using XML resource files
Cartoon | who is the first ide in the universe?
MySQL index hit level analysis
Alertdialog create dialog
什么是敏捷测试
[network attack and defense principle and technology] Chapter 4: network scanning technology
Chapter 2 building CRM project development environment (building development environment)
Vscode three configuration files about C language
Target detection 1 -- actual operation of Yolo data annotation and script for converting XML to TXT file
mui侧边导航锚点定位js特效
Understanding of 12 methods of enterprise management
基于RGB图像阈值分割并利用滑动调节阈值
Sanxian Guidong JS game source code
【解惑】App处于前台,Activity就不会被回收了?