The block storage logically divides the N disk logical disks by logical disk, Raid, or LVM (logical volume), and then mounts these logical disks to the host in a mapping manner. The operating system of the host thinks that these disks are physical hard disks, and it is no different from directly mounting a physical hard disk to the operating system.
The advantages of block storage are self-evident:
1. Using Raid and LVM, you can do redundant protection with multiple data;
2. Disk arrays can be used to form a large-capacity logical disk to provide external services and increase capacity;
3. Writing data to a logical disk can be converted into parallel writing to several physical disks, improving read and write efficiency.
demand
In IaaS, block storage is widely used to provide persistent volumes for virtual machines. It is generally accepted that a virtual machine can still access disk data by mounting old data volumes on other virtual machines. Affected by this, some customers naturally associate this advantage with shared storage when designing PaaS, and proposed the need to store block storage for containers in PaaS.
However, with the excellent performance in IaaS, can block storage also be included in the PaaS business?
analysis
Assuming there is a set of Ceph clusters that provide RBD block storage, let's analyze several scenarios:
scene one"I use container technology, but I'm not a deep user. I just use a command like docker run to manually start a single container. The services running in these containers consume more disk space."
This type of user is limited to using the container as a temporary tool and does not closely integrate it with the business.
1. If there is no need for persistence on the disk, consider directly mapping the host file system if the host disk space is sufficient.
2. If you want the disk to share the shared disk exclusively, or if you want to enable the container on a different host, you can reuse the previously accessed data volume; you can specify the volume-driver as ceph-rbd when you start docker. To use the block storage provided by the Ceph cluster.
The block storage driver framework diagram is as follows:
Scene two"I use container orchestration tools to manage applications, such as docker-compose, Rancher, or Kubernetes. But I only need to enable one container for each service, and there is no need for service expansion; these services are more consuming disks, I hope in After the container is restarted or rescheduled, the old data disk can still be used."
This scenario is special, and each service only corresponds to one container. Therefore, there is no need for multiple containers to simultaneously read and write a data disk. It is only necessary to ensure that the storage volume mounted before the container can still be accessed by the container after the container recovery or normal migration; that is, the storage volume to the container Automatically follow.
The migration scenario is shown below:
However, it is worth noting that:
1. Assume that the previous container is running on host-1. Correspondingly, the block storage is mounted on host-1.
2. When the original container is scheduled to the new host-2 for some reason, the orchestration framework detects the change, unloads the original block device on host-1, and then mounts it to host-2.
3. According to the process, each migration of block storage needs to be uninstalled from one host and then mounted on another host; the startup of the new container depends on the volume, so the recovery speed of the container or service depends on the block storage. Migration speed.
4. Assuming that the platform fails to detect the container failure on host-1 in time, the old container is stuck and cannot be quickly destroyed, or the host-1 suddenly loses power, Ceph Server must wait for the timeout before allowing host-2 to hang again. The RBD block that was used before it was loaded. At this point, the container startup time will become unbearable, apparently this is contrary to the advantage of the second stop of the container.
Scene threeI use container orchestration software such as Rancher or Kubernetes to manage applications. Each application has multiple microservices; each microservice corresponds to multiple containers to provide services in parallel.
Rancher
In Rancher, the application is called Stack, each stack contains one or more services; service is microservice, and microservices are divided into single tasks, only one thing. The service belongs to the concept of logic. What really does things is the containers corresponding to each service. If you want to expand the service, increase the number of containers corresponding to the service; these containers are stateless and can be scheduled to multiple hosts. They must use shared storage to ensure business continuity.
Kubernetes
In Kubernetes, the service is also done by one or more services, and the service here is similar to the overview of the service in Rancher. The service of Kubernetes is an external access point. A set of pods can be selected by means of the selector specifying labels. The service provides access proxy and load balancing for this set of pods. The external client only needs to know the port and IP exposed by the service to be able to access the service. Since the pod is stateless, as with the Rancher, the service data needs to be stored on the shared storage. It is also necessary to ensure that multiple pods corresponding to the same service can share the service data.
Block storage can only be mounted by one client (host) at the same time. When multiple containers or pods of service are dispatched to multiple hosts, block storage is difficult to cope with. At this point, the original method of sharing the file system reflects its advantages, NAS will be the best choice!
ZGAR PCC
ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.
From production to packaging, the whole system of tracking, efficient and orderly process, achieving daily efficient output. We pay attention to the details of each process control. The first class dust-free production workshop has passed the GMP food and drug production standard certification, ensuring quality and safety. We choose the products with a traceability system, which can not only effectively track and trace all kinds of data, but also ensure good product quality.
We offer best price, high quality Vape Device, E-Cigarette Vape Pen, Disposable Device Vape,Vape Pen Atomizer, Electronic cigarette to all over the world.
Much Better Vaping Experience!
ZGAR PCC E-Cigarette Vape Pen,ZGAR PCC Device Vape,ZGAR PCC Vape Pen Atomizer,Latest Disposable E-Cigarette OEM vape pen,ZGAR PCC electronic cigarette
Zgar International (M) SDN BHD , https://www.zgarecigarette.com