In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to analyze the disk quota of overlay2 storage drivers, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
Why use overlay2?
The default storage driver on docker centos is devicemapper's loop-lvm mode, which simulates block devices with files and is not recommended for production.
Direct lvm is not an out-of-the-box mode and doesn't bother to configure it.
The most important thing is that device mapper does not work in the case of docker in docker. A typical scenario is that when using drone, building a docker image will not work properly.
Excessive number of overlay storage driver layers will result in too many file links and may deplete inode
So at present, overlay2 is a better choice.
Kernel
If you use a low kernel, you may not be able to run some other basic FROM images, such as running FROM ubuntu images on centos systems with overlay2 (not necessarily).
We provide a free kernel rpm package here, which has been running in our production environment for nearly a year without any problems.
Using the xfs file system
It is impossible to limit the size of each container to 10 gigabytes without using xfs, and a misoperation of a container may result in a complete occupation of the machine disk.
We used lvm to get a partition to make the xfs file system, and of course you don't need lvm.
one
two
three
four
five
six
seven
eight
nine
If which lvs & > / dev/null; then
Echo ""; echo-e "Remove last docker lv and mount."
Lvremove k8s/docker-y
Lvcreate-y-n docker k8s-L 100G
Mkfs.xfs-n ftype=1-f / dev/mapper/k8s-docker
Mkdir-p / var/lib/docker
Mount-o pquota,uqnoenforce / dev/mapper/k8s-docker / var/lib/docker
Echo-e "/ dev/mapper/k8s-docker / var/lib/docker xfs defaults,pquota 0" > > / etc/fstab
Fi
If overlay2 does not do some special operations, cadvisor cannot monitor how many disks are actually used in the container. It can only be monitored normally through xfs and quota configuration.
Configure to use overlay2 1
two
three
four
five
six
seven
eight
nine
ten
eleven
# cat / etc/docker/daemon.json
{
"storage-opts": [
"overlay2.override_kernel_check=true"
"overlay2.size=10G"
]
"log-driver": "json-file"
"log-opts": {
"max-size": "10m"
}
}
Systemctl daemon-reload systemctl restart docker
In this way, the disk size of each container can be limited to 10G.
After reading the above, do you have any further understanding of how to analyze the disk quota of overlay2 storage drivers? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.