当前位置:网站首页>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 可以解决这个问题
边栏推荐
- 什么是敏捷测试
- Sanxian Guidong JS game source code
- swiper左右切换滑块插件
- 仿今日头条APP顶部点击可居中导航
- Chapter 2 build CRM project development environment (database design)
- Automated testing: a practical skill that everyone wants to know about robot framework
- Functions and usage of serachview
- Deep learning - make your own dataset
- What skills can you master to be a "master tester" when doing software testing?
- Face recognition attendance system based on Baidu flying plasma platform (easydl)
猜你喜欢

讨论| 坦白局,工业 AR 应用为什么难落地?

Functions and usage of viewflipper

Taffydb open source JS database
![Easy to understand [linear regression of machine learning]](/img/db/f300457165de7ab12aefac8842330f.jpg)
Easy to understand [linear regression of machine learning]

面试官:页面很卡的原因分析及解决方案?【测试面试题分享】

Function and usage of textswitch text switcher

zdog.js火箭转向动画js特效

What is agile testing

Sanxian Guidong JS game source code

Click on the top of today's headline app to navigate in the middle
随机推荐
ViewSwitcher的功能和用法
List selection JS effect with animation
【解惑】App处于前台,Activity就不会被回收了?
[trusted computing] Lesson 13: TPM extended authorization and key management
仿今日头条APP顶部点击可居中导航
Import requirements in batches during Yolo training Txt
Deep learning machine learning various data sets summary address
[trusted computing] Lesson 10: TPM password resource management (II)
Deep learning - make your own dataset
JS pull down the curtain JS special effect display layer
Tips for this week 131: special member functions and ` = Default`
MySQL index hit level analysis
Chapter 1 Introduction to CRM core business
企业经营12法的领悟
Machine vision (1) - Overview
Robot engineering lifelong learning and work plan-2022-
toast会在程序界面上显示一个简单的提示信息
[trusted computing] Lesson 12: TPM authorization and conversation
SD_DATA_SEND_SHIFT_REGISTER
[answer] if the app is in the foreground, the activity will not be recycled?