Data storage method and apparatus, device, and storage medium

By combining the logical volume groups of solid-state drives and mechanical hard disks in container orchestration systems, the contradiction between high IO performance and low cost in containerized applications is solved, and high-performance and low-cost data storage is achieved.

WO2024240032A1PCT designated stage expired Publication Date: 2024-11-28JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/093393
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-19
Filing Date
2024-05-15
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

In the prior art, solid-state drives have high performance but are expensive, and mechanical hard drives have low prices but insufficient performance, making it difficult to meet high IO performance in containerized applications while controlling the cost of use.

Method used

In the target node server of the container orchestration system, the target container storage plug-in is used to divide the logical volume group of solid-state drive conversion and the logical volume group of mechanical hard disk conversion, and is used as a cache disk and a storage disk respectively to achieve high performance and low cost respectively to achieve high performance and low cost. data storage.

Benefits of technology

It realizes the data storage effect of reducing usage costs while meeting high read and write performance, avoiding the high cost problem when using solid state hard drives alone.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024093393_28112024_PF_FP_ABST
    Figure CN2024093393_28112024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data storage method and apparatus, a device, and a storage medium. The method is applied to a target node server in a container orchestration system, comprising: creating a target deployment unit on the basis of a target persistent storage volume claim; in response to a binding operation of the target persistent storage volume claim in a target deployment unit creation process, by calling a target container storage plug-in, dividing into a first logical volume in a first volume group converted by a solid state disk and dividing into a second logical volume in a second volume group converted by a mechanical hard disk; taking the first logical volume as a cache disk, and taking the second logical volume as a storage disk; and in response to a creation completion operation of the target deployment unit, mounting the first logical volume and the second logical volume to the target deployment unit, so that application data generated by the target application during running is stored in the first logical volume and the second logical volume.
Need to check novelty before this filing date? Find Prior Art

Description

Data storage method, device, equipment and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 19, 2023, with application number 202310573947.0, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to computer technology, for example, to a data storage method, apparatus, device and storage medium. Background Art

[0003] With the rapid development of computer technology and cloud-native technologies, container orchestration systems can be used to efficiently orchestrate and manage containerized applications on cloud platforms throughout their entire lifecycle. For example, using Kubernetes to manage containerized applications across multiple node servers on a cloud platform makes deploying containerized applications simpler and more efficient.

[0004] Currently, when deploying containerized applications, solid-state drives or mechanical hard drives are usually used directly as storage drives for the applications, thereby achieving local storage of application data.

[0005] However, in the process of implementing this application, the inventors discovered that there are at least the following problems in the related art:

[0006] Among local storage methods in related technologies, solid-state drives offer high performance but are expensive, increasing the cost of use. Meanwhile, mechanical hard drives are inexpensive but offer low performance and cannot meet the high IO performance requirements of applications.

[0007] Summary of the Invention

[0008] The embodiments of the present application provide a data storage method, apparatus, device, and storage medium to ensure high performance while reducing usage costs.

[0009] In a first aspect, an embodiment of the present application provides a data storage method, applied to a target node server in a container orchestration system, comprising:

[0010] Obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration;

[0011] In response to a bind operation of the target persistent storage volume declaration during target deployment unit creation, by calling a target container storage plug-in in the target node server, based on the target persistent storage volume declaration, a first logical volume is divided in a first volume group of the target node server and a second logical volume is divided in a second volume group, wherein the first volume group is a volume group converted from a solid-state drive and the second volume group is a volume group converted from a mechanical hard drive;

[0012] Using the first logical volume as a cache disk of the target application, and using the second logical volume as a storage disk of the target application;

[0013] In response to the target deployment unit creating completion operation, the first logical volume and the second logical volume are mounted to the created target deployment unit, so that application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

[0014] In a second aspect, an embodiment of the present application further provides a data storage device integrated into a target node server in a container orchestration system, comprising:

[0015] a target deployment unit creation module configured to obtain a target persistent storage volume declaration corresponding to a containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration;

[0016] a logical volume creation module, configured to respond to a binding operation of the target persistent storage volume declaration during the target deployment unit creation process, by calling a target container storage plug-in in the target node server, and based on the target persistent storage volume declaration, divide a first logical volume in a first volume group of the target node server and divide a second logical volume in a second volume group, wherein the first volume group is a volume group converted from a solid-state drive, and the second volume group is a volume group converted from a mechanical hard drive;

[0017] a logical volume processing module configured to use the first logical volume as a cache disk of the target application and use the second logical volume as a storage disk of the target application;

[0018] The logical volume mounting module is configured to mount the first logical volume and the second logical volume to the target deployment unit after the target deployment unit is created, so that the application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

[0019] In a third aspect, an embodiment of the present application further provides an electronic device, comprising:

[0020] at least one processor;

[0021] a memory configured to store at least one program;

[0022] When the at least one program is executed by the at least one processor, the at least one processor implements the data storage method provided in any embodiment of the present application.

[0023] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the data storage method provided in any embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] FIG1 is a flow chart of a data storage method provided by one embodiment of the present application;

[0025] FIG2 is an example of an architecture of a container orchestration system according to an embodiment of the present application;

[0026] FIG3 is a flowchart of another data storage method provided by an embodiment of the present application;

[0027] FIG4 is a flowchart of another data storage method provided by an embodiment of the present application;

[0028] FIG5 is a schematic structural diagram of a data storage device provided by one embodiment of the present application;

[0029] FIG6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0030] The present application will be described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to explain the present application and are not intended to limit the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the present application, not all of the structures.

[0031] Figure 1 is a flow chart of a data storage method provided by one embodiment of the present application. This embodiment is applicable to the deployment of containerized applications and the local storage of the generated application data. The method can be performed by a data storage device, which can be implemented by software and / or hardware and integrated into an electronic device. For example, the device can be integrated into a target node server in a container orchestration system.

[0032] The container orchestration system may be a system used to orchestrate and manage containerized applications. For example, the container orchestration system may be a Kubernetes system. Referring to Figure 2 , the container orchestration system may include a node server cluster and a management server. The node server cluster includes multiple node servers. Each node server is the server that actually deploys containerized applications. The management server is configured to manage multiple node servers, such as performing container scheduling and node status detection. For example, based on internal scheduling logic, the management server may schedule the containerized application currently to be deployed to a node server for deployment. The target node server refers to the node server to which the containerized application currently to be deployed is scheduled. The internal architecture of each node server is identical. For example, referring to Figure 2 , the target node server may include a proxy module, a target container storage plug-in (such as a container storage interface (CSI)), and a plug-in controller for supporting the implementation of the plug-in's functionality. The proxy module (such as kubulet) refers to an agent running on the target node server to ensure that all containers run within the deployment unit. The target container storage plug-in can be a newly added container storage interface plug-in, which can be used to create a first logical volume of the solid-state drive type and a second logical volume of the mechanical hard disk type, and combine the first logical volume and the second logical volume to cache data. The target container storage plug-in is pre-registered in the proxy module so that the proxy module can successfully call the target container storage plug-in for storage processing.

[0033] As shown in FIG1 , the method includes the following steps:

[0034] S110: Obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration.

[0035] Among them, the target application may refer to the containerized application that currently needs to be deployed in the target node server. The number of target applications can be at least one. Each target application corresponds to a container. The target persistent storage volume declaration (Persistent Volume Claim, PVC) is used to describe the configuration information of the persistent storage volume (Persistent Volume, PV) of the target application, which can be personalized based on application requirements. The deployment unit Pod is the smallest deployment unit created and managed in the target node server. Each deployment unit can run one container, or multiple containers can run at the same time. All containers in each deployment unit share network and storage space. The target deployment unit refers to the deployment unit that contains the containerized target application.

[0036] For example, if the target application needs to be deployed and released at present, the target application is containerized, and the target persistent storage volume declaration corresponding to the containerized target application is configured, and a target application deployment request containing the target persistent storage volume declaration is generated, and the target application deployment request is sent to the management server. The management server responds to the target application deployment request and dispatches the target application deployment request to the target node server. Referring to Figure 2, after the proxy module in the target node server receives the target application deployment request, it parses the target application deployment request, obtains the target persistent storage volume declaration PVC corresponding to the containerized target application, and creates a target deployment unit Pod corresponding to the target application in the target node server based on the storage configuration information in the target persistent storage volume declaration.

[0037] S120. In response to the binding operation of the target persistent storage volume declaration during the target deployment unit creation process, by calling the target container storage plug-in in the target node server, based on the target persistent storage volume declaration, a first logical volume is divided in the first volume group of the target node server and a second logical volume is divided in the second volume group, wherein the first volume group is a volume group converted from a solid-state hard drive, and the second volume group is a volume group converted from a mechanical hard drive.

[0038] Each node server has a container storage plug-in. The target container storage plug-in is the container storage plug-in in the target node server. A volume group is a storage pool consisting of at least one physical volume, on which at least one logical volume can be created. A physical volume refers to a solid-state drive partition or a mechanical hard drive partition. A physical volume is the basic storage logic block of the Logical Volume Manager (LVM). Each hard drive partition corresponds to a physical volume. LVM logically aggregates at least one hard drive partition, creating the equivalent of a large hard drive. When the space on a hard drive is insufficient, partitions from other hard drives can be added, enabling dynamic management of storage capacity and improving storage flexibility. The first volume group is converted from at least one solid-state drive in the target node server. Solid-state drives (SSDs) are hard drives made of solid-state electronic memory chip arrays and offer fast read and write speeds. The second volume group is converted from at least one mechanical hard drive in the target node server. Mechanical hard drives (HDDs) primarily consist of platters, magnetic heads, disk spindles, and control motors. They have low unit costs and are suitable for large-capacity storage. The first logical volume is a solid-state drive logical volume partitioned from the first volume group. The second logical volume is a mechanical hard drive logical volume partitioned from the second volume group. File systems can be established on the first and second logical volumes. The first and second logical volumes are used as local storage media.

[0039] For example, referring to FIG2 , the proxy module has an operation of binding the target persistent storage volume declaration during the process of creating the target deployment unit. When this operation is executed, the proxy module will call the target container storage plug-in to divide and create the first logical volume and the second logical volume. For example, based on the storage configuration information in the target persistent storage volume declaration in the target container storage plug-in, the first logical volume with the specified storage capacity and the specified system file format can be divided in the first volume group of the target node server through the logical volume manager, and the second logical volume with the specified storage capacity and the specified system file format can be divided in the second volume group. In this way, two different types of logical volumes can be obtained using the target container storage plug-in, namely, a first logical volume of the solid-state drive type and a second logical volume of the mechanical hard disk type.

[0040] It should be noted that after obtaining the target persistent storage volume declaration, the target container storage plug-in will not be called immediately to divide and create the first logical volume and the second logical volume. Instead, the target container storage plug-in will be called to divide and create the first logical volume and the second logical volume when the target deployment unit creation process is bound to the target persistent storage volume declaration. In this way, the first logical volume and the second logical volume can be created in the target node server when the target deployment unit is determined to be scheduled to the target node server, thereby ensuring that the first logical volume and the second logical volume can be mounted to the created target deployment unit, and the creation of the first logical volume and the second logical volume is completed before the target deployment unit is created, thereby ensuring the success of the mounting, and will not cause mounting errors due to scheduling problems, which will lead to loss of application data.

[0041] S130: Use the first logical volume as a cache disk of the target application, and use the second logical volume as a storage disk of the target application.

[0042] For example, referring to FIG2 , after creating two different types of first logical volumes and second logical volumes for the target application, the mutually independent first logical volumes and second logical volumes can be aggregated and cached by caching, so that the first logical volume of the solid-state drive type is used as the cache disk of the target application, and the second logical volume of the mechanical hard disk type is used as the storage disk of the target application, so that the application data generated by the target application can be cached on the first logical volume first and then written to the second logical volume, thereby accelerating the read and write performance. By combining the first logical volume of the solid-state drive type and the second logical volume of the mechanical hard disk type to store data, the storage performance consistent with that of using only a solid-state drive can be achieved. Since the low-cost second logical volume of the mechanical hard disk type is used as the storage disk, it has a lower usage cost than using only a solid-state drive. Therefore, this embodiment can control the usage cost while meeting the target application's requirements for high read and write performance, so that the cost is not too high.

[0043] Exemplarily, S130 may include: using a flash cache method to use the first logical volume as a cache disk of the target application, and using the second logical volume as a storage disk of the target application.

[0044] The Flashcache method can refer to adding a cache layer between the file system and the device driver. This method can use the first logical volume of the solid-state drive type as a cache disk for the second logical volume of the mechanical hard disk type, and the second logical volume of the mechanical hard disk type as the final data storage disk. In other words, the Flashcache method can aggregate the mutually independent first and second logical volumes into a virtual block device with cache. By utilizing the Flashcache method, high-performance and low-cost local storage can be achieved.

[0045] S140 . In response to the target deployment unit creation completion operation, mount the first logical volume and the second logical volume to the created target deployment unit, so that application data generated during the operation of the target application is stored in the first logical volume and the second logical volume.

[0046] For example, referring to Figure 2, after the target deployment unit is created through the proxy module, the target container storage plug-in mounts the aggregated first logical volume and the second logical volume (at this time, the first logical volume has been used as a cache disk, and the second logical volume has been used as a storage disk) to the created target deployment unit, thereby establishing a correspondence between the first logical volume and the second logical volume and the target deployment unit. Based on this correspondence, the application data generated by the target application in the target deployment unit during operation can be cached in the first logical volume and then written back to the second logical volume, thereby achieving efficient storage of application data.

[0047] The technical solution of this embodiment is that the target node server in the container orchestration system creates a target deployment unit corresponding to the target application based on the target persistent storage volume declaration corresponding to the containerized target application; in response to the binding operation of the target persistent storage volume declaration during the creation of the target deployment unit, by calling the target container storage plug-in, based on the target persistent storage volume declaration, a first logical volume is divided from the first volume group of the target node server and a second logical volume is divided from the second volume group, the first logical volume is used as the cache disk of the target application, and the second logical volume is used as the storage disk of the target application; in response to the completion operation of the target deployment unit, the first logical volume and the second logical volume are mounted to the created target deployment unit, so that the application data generated by the target application during operation is stored in the first logical volume and the second logical volume, thereby realizing local storage of application data. Since the first volume group is a volume group converted from a solid-state drive and the second volume group is a volume group converted from a mechanical hard disk, the first logical volume is a solid-state drive type logical volume and the second logical volume is a mechanical hard disk type logical volume. Therefore, the first logical volume is used as the cache disk of the target application, so that the target application has high performance, and the second logical volume is used as the storage disk of the target application, so that the target application has low usage cost. Compared with using only a solid-state hard drive, this embodiment can reduce the cost of use while ensuring high performance by combining a solid-state hard drive with a mechanical hard drive.

[0048] On the basis of the above technical solution, before S110, it may also include: based on the solid-state hard disk configuration information corresponding to the target node server, determining the target solid-state hard disk in the target node server, and converting the target solid-state hard disk into a first volume group; based on the mechanical hard disk configuration information corresponding to the target node server, determining the target mechanical hard disk in the target node server, and converting the target mechanical hard disk into a second volume group.

[0049] The SSD configuration information is pre-configured based on business needs and is used to identify the available SSDs in the target node server that can be converted into volume groups. The HDD configuration information is pre-configured based on business needs and is used to identify the available HDDs in the target node server that can be converted into volume groups.

[0050] Exemplarily, before deploying the containerized target application, based on the solid-state drive configuration information corresponding to the target node server, all target solid-state drives specified in the target node server are determined, and all target solid-state drives are initialized to the first volume group, thereby converting all target solid-state drives to the first volume group. Similarly, based on the mechanical hard disk configuration information corresponding to the target node server, all target mechanical hard disks specified in the target node server are determined, and all target mechanical hard disks are initialized to the second volume group, thereby converting all target mechanical hard disks to the second volume group. By performing hard disk conversion based on hard disk configuration information in advance, the first logical volume can be directly created in the converted first volume group and the second logical volume can be created in the second volume group when the target application is subsequently deployed, thereby improving the efficiency of logical volume creation. At the same time, the dynamic configuration of volume groups is also realized by using hard disk configuration information, thereby improving storage flexibility.

[0051] FIG3 is a flowchart of a data storage method provided by one embodiment of the present application. This embodiment, based on the above embodiments, further refines the step of "dividing a first logical volume from a first volume group of a target node server and a second logical volume from a second volume group based on the target persistent storage volume declaration." Explanations of terms that are identical or corresponding to those in the above embodiments are omitted here.

[0052] Referring to FIG3 , a data storage method provided in this embodiment includes the following steps:

[0053] S310: Obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration.

[0054] S320. In response to the binding operation of the target persistent storage volume declaration during the target deployment unit creation process, determine the target cache capacity based on the target cache ratio and target storage capacity in the target persistent storage volume declaration by calling the target container storage plug-in in the target node server.

[0055] The target cache ratio can be the ratio between cache capacity and storage capacity, which is pre-configured in the target persistent storage volume declaration. For example, the target cache ratio is 50%. The target storage capacity can refer to the storage capacity of the target application storage disk, which is also pre-configured in the target persistent storage volume declaration. The target storage capacity can be greater than the total storage capacity of a single hard disk or a single hard disk partition, and is not limited by the total storage capacity of a single hard disk or a single hard disk partition.

[0056] For example, when creating a target deployment unit, the proxy module binds the target persistent storage volume declaration. Upon executing this operation, the proxy module calls the target container storage plugin to create the first logical volume and the second logical volume. For example, the target container storage plugin first multiplies the target cache ratio in the target persistent storage volume declaration by the target storage capacity, and the result of this multiplication is the target cache capacity.

[0057] S330: Divide a first logical volume with a target cache capacity in a first volume group of the target node server.

[0058] Exemplarily, in the target container storage plug-in, a first logical volume with a target cache capacity is divided in a first volume group of the target node server through a logical volume manager.

[0059] Exemplarily, S330 may include: dividing a basic logical volume with a target cache capacity in the first volume group of the target node server; formatting the basic logical volume based on the target file system format in the target persistent storage volume declaration to obtain a first logical volume.

[0060] The target file system format refers to the file system format of the target application pre-configured in the target persistent storage volume declaration. For example, the file system format can be ext3, ext4, or xfs.

[0061] Exemplarily, when creating the first logical volume, the target container storage plug-in can first divide a basic logical volume with a target cache capacity in the first volume group of the target node server, and then format the basic logical volume into the target file system format based on the target file system format in the target persistent storage volume declaration, thereby obtaining the first logical volume under the target file system format, so as to cache application file data in the first logical volume.

[0062] S340: Divide a second logical volume with a target storage capacity in the second volume group of the target node server.

[0063] Exemplarily, in the target container storage plug-in, a second logical volume with the target storage capacity is divided in the second volume group of the target node server through the logical volume manager.

[0064] Exemplarily, S340 may include: dividing a basic logical volume with a target storage capacity in the second volume group of the target node server; formatting the basic logical volume based on the target file system format in the target persistent storage volume declaration to obtain a second logical volume.

[0065] Exemplarily, similar to the first logical volume creation process, the target container storage plug-in can first divide a basic logical volume with the target storage capacity in the second volume group of the target node server, and then format the basic logical volume into the target file system format based on the target file system format in the target persistent storage volume declaration, thereby obtaining a second logical volume under the target file system format, so as to store application file data in the second logical volume.

[0066] S350: Use the first logical volume as a cache disk of the target application, and use the second logical volume as a storage disk of the target application.

[0067] S360: In response to the target deployment unit creation completion operation, mount the first logical volume and the second logical volume to the created target deployment unit, so that application data generated during the operation of the target application is stored in the first logical volume and the second logical volume.

[0068] The technical solution of this embodiment determines the target cache capacity based on the target cache ratio and target storage capacity in the target persistent storage volume declaration, and divides a first logical volume with the target cache capacity in the first volume group of the target node server, and divides a second logical volume with the target storage capacity in the second volume group of the target node server, so that the capacity space of the first logical volume and the second logical volume can be dynamically configured to improve storage flexibility.

[0069] FIG4 is a flowchart of a data storage method provided by one embodiment of the present application. This embodiment, based on the above embodiments, further refines the step of "storing application data generated during the operation of the target application in the first logical volume and the second logical volume." Explanations of terms identical or corresponding to those in the above embodiments are omitted here.

[0070] Referring to FIG4 , a data storage method provided in this embodiment includes the following steps:

[0071] S410: Obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration.

[0072] S420. In response to the binding operation of the target persistent storage volume declaration during the target deployment unit creation process, by calling the target container storage plug-in in the target node server, based on the target persistent storage volume declaration, a first logical volume is divided in the first volume group of the target node server and a second logical volume is divided in the second volume group.

[0073] S430: Use the first logical volume as a cache disk of the target application, and use the second logical volume as a storage disk of the target application.

[0074] S440: In response to the target deployment unit creation completion operation, mount the first logical volume and the second logical volume to the target deployment unit.

[0075] S450: Determine a target cache policy corresponding to the target application based on the cache policy configuration information in the target persistent storage volume declaration.

[0076] The target cache policy may refer to a method for caching and storing application data generated by the target application. For example, the target cache policy may be a write-back policy or a write-through policy.

[0077] For example, a caching policy can be pre-configured in the target persistent storage volume declaration so that different caching policies can be configured for different applications to meet personalized needs. For example, the caching policy configured by the caching policy configuration information in the target persistent storage volume declaration can be used as the target caching policy for the target application.

[0078] S460: Based on the target cache policy, store the application data generated during the operation of the target application into the first logical volume and the second logical volume.

[0079] Exemplarily, when storing application data generated during the operation of the target application, cache storage of the application data may be performed based on the configured target cache policy, thereby obtaining storage performance consistent with that of a solid-state drive.

[0080] Exemplarily, S460 may include: if the target cache policy is a write-back policy, first storing all application data generated by the target application during operation to the first logical volume, and then storing all application data to the second logical volume when a write-back instruction is detected.

[0081] The write-back strategy is to cache all generated application data in the cache disk of the first logical volume first. When the operating system needs to write back, it will send a write-back instruction. When the write-back instruction is received, all application data cached in the cache disk will be written back to the storage disk of the second logical volume, thereby having high read and write performance.

[0082] Exemplarily, S460 may further include: if the target cache policy is a write-through policy, storing all application data generated by the target application during operation in the first logical volume and the second logical volume simultaneously.

[0083] The write-through strategy is to cache all generated application data to the first logical volume, and at the same time store the cached application data in the second logical volume, thereby achieving synchronous storage of data and having high storage performance.

[0084] The technical solution of this embodiment determines the target cache policy corresponding to the target application based on the cache policy configuration information in the target persistent storage volume declaration, and stores the application data generated by the target application during operation in the first logical volume and the second logical volume based on the target cache policy, so that different personalized needs can be met through dynamic configuration of the cache policy.

[0085] The following is an embodiment of the data storage device provided in the embodiments of the present application. The device and the data storage methods of the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiments of the data storage device, please refer to the embodiments of the above-mentioned data storage method.

[0086] Figure 5 is a schematic diagram of the structure of a data storage device provided in an embodiment of the present application. This embodiment is applicable to the deployment of containerized applications and the local storage of the generated application data. As shown in Figure 5, the device is integrated into the target node server of the container orchestration system and includes: a target deployment unit creation module 510, a logical volume creation module 520, a logical volume processing module 530, and a logical volume mounting module 540.

[0087] The target deployment unit creation module 510 is configured to obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration;

[0088] The logical volume creation module 520 is configured to respond to the binding operation of the target persistent storage volume declaration during the target deployment unit creation process, by calling the target container storage plug-in in the target node server, and based on the target persistent storage volume declaration, divide the first logical volume in the first volume group of the target node server and divide the second logical volume in the second volume group, wherein the first volume group is a volume group converted from a solid-state drive and the second volume group is a volume group converted from a mechanical hard drive;

[0089] a logical volume processing module 530 configured to use the first logical volume as a cache disk of the target application and the second logical volume as a storage disk of the target application;

[0090] The logical volume mounting module 540 is configured to mount the first logical volume and the second logical volume to the target deployment unit after the target deployment unit is created, so that the application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

[0091] In the technical solution of this embodiment, the target node server in the container orchestration system creates a target deployment unit corresponding to the target application based on the target persistent storage volume declaration corresponding to the containerized target application; in response to the binding operation of the target persistent storage volume declaration during the creation of the target deployment unit, by calling the target container storage plug-in, based on the target persistent storage volume declaration, a first logical volume is divided from the first volume group of the target node server and a second logical volume is divided from the second volume group, the first logical volume is used as the cache disk of the target application, and the second logical volume is used as the storage disk of the target application; in response to the completion operation of the target deployment unit creation, the first logical volume and the second logical volume are mounted to the created target deployment unit, so that the application data generated by the target application during operation is stored in the first logical volume and the second logical volume, thereby realizing local storage of the application data. Since the first volume group is a volume group converted from a solid-state drive and the second volume group is a volume group converted from a mechanical hard disk, the first logical volume is a solid-state drive type logical volume and the second logical volume is a mechanical hard disk type logical volume. Therefore, the first logical volume is used as the cache disk of the target application, which makes the target application have high performance, and the second logical volume is used as the storage disk of the target application, which makes the target application have low usage cost. Compared with using only a solid-state hard drive, this embodiment can reduce the cost of use while ensuring high performance by combining a solid-state hard drive with a mechanical hard drive.

[0092] Optionally, the logical volume creation module 520 includes:

[0093] a target cache capacity determining unit configured to determine the target cache capacity based on the target cache ratio and the target storage capacity in the target persistent storage volume declaration;

[0094] A first logical volume creation unit is configured to divide a first logical volume having the target cache capacity in the first volume group of the target node server;

[0095] The second logical volume creation unit is configured to divide a second logical volume having the target storage capacity in the second volume group of the target node server.

[0096] Optionally, the first logical volume creation unit is configured as follows:

[0097] A basic logical volume with the target cache capacity is divided in the first volume group of the target node server; and the basic logical volume is formatted based on the target file system format in the target persistent storage volume declaration to obtain a first logical volume.

[0098] Optionally, the logical volume processing module 530 is configured to:

[0099] By using a Flash cache method, the first logical volume is used as a cache disk of the target application, and the second logical volume is used as a storage disk of the target application.

[0100] Optionally, the device further comprises:

[0101] a target cache policy determination module configured to determine a target cache policy corresponding to the target application based on the cache policy configuration information in the target persistent storage volume declaration;

[0102] The data storage module is configured to store application data generated by the target application during operation into the first logical volume and the second logical volume based on the target cache policy.

[0103] Optionally, the data storage module is configured to:

[0104] If the target cache policy is a write-back policy, all application data generated by the target application during operation are first stored in the first logical volume, and all application data are stored in the second logical volume when a write-back instruction is detected;

[0105] If the target cache policy is a write-through policy, all application data generated by the target application during operation are stored in the first logical volume and the second logical volume at the same time.

[0106] Optionally, the device further comprises:

[0107] The hard disk conversion module is configured to determine the target solid-state hard disk in the target node server based on the solid-state hard disk configuration information corresponding to the target node server before obtaining the target persistent storage volume declaration corresponding to the containerized target application, and convert the target solid-state hard disk into a first volume group; determine the target mechanical hard disk in the target node server based on the mechanical hard disk configuration information corresponding to the target node server, and convert the target mechanical hard disk into a second volume group.

[0108] The data storage device provided in the embodiments of the present application can execute the data storage method provided in any embodiment of the present application, and has a corresponding functional module for executing the data storage method.

[0109] It is worth noting that in the embodiment of the above-mentioned data storage device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0110] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 shows a block diagram of an exemplary electronic device 12 suitable for implementing the embodiments of the present application. The electronic device 12 shown in Figure 6 is merely an example and should not limit the functionality and scope of use of the embodiments of the present application.

[0111] 6 , electronic device 12 is implemented as a general-purpose computing device. Components of electronic device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components (including system memory 28 and processing unit 16).

[0112] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0113] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0114] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 6 , commonly referred to as a “hard drive”). Although not shown in FIG. 6 , a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a “floppy disk”) may be provided, as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a Compact Disc-Read Only Memory (CD-ROM), a Digital Video Disc-Read Only Memory (DVD-ROM), or other optical media). In these cases, each drive may be connected to the bus 18 via one or more data media interfaces. The system memory 28 may include at least one program product having a set (eg, at least one) of program modules. These program modules are configured to perform the functions of various embodiments of the present application.

[0115] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.

[0116] The electronic device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). This communication can occur via an input / output (I / O) interface 22. Furthermore, the electronic device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) systems, tape drives, and data backup storage systems.

[0117] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a data storage method provided by an embodiment of the present invention, which includes:

[0118] Obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration;

[0119] In response to a bind operation of the target persistent storage volume declaration during target deployment unit creation, by calling a target container storage plug-in in the target node server, based on the target persistent storage volume declaration, a first logical volume is divided in a first volume group of the target node server and a second logical volume is divided in a second volume group, wherein the first volume group is a volume group converted from a solid-state drive and the second volume group is a volume group converted from a mechanical hard drive;

[0120] Using the first logical volume as a cache disk of the target application, and using the second logical volume as a storage disk of the target application;

[0121] In response to the target deployment unit creating completion operation, the first logical volume and the second logical volume are mounted to the created target deployment unit, so that application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

[0122] Of course, those skilled in the art will understand that the processor can also implement the technical solution of the data storage method provided in any embodiment of the present application.

[0123] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the data storage method provided in any embodiment of the present application are implemented. The method includes:

[0124] Obtain a target persistent storage volume declaration corresponding to the containerized target application, and create a target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration;

[0125] In response to a bind operation of the target persistent storage volume declaration during target deployment unit creation, by calling a target container storage plug-in in the target node server, based on the target persistent storage volume declaration, a first logical volume is divided in a first volume group of the target node server and a second logical volume is divided in a second volume group, wherein the first volume group is a volume group converted from a solid-state drive and the second volume group is a volume group converted from a mechanical hard drive;

[0126] Using the first logical volume as a cache disk of the target application, and using the second logical volume as a storage disk of the target application;

[0127] In response to the target deployment unit creating completion operation, the first logical volume and the second logical volume are mounted to the created target deployment unit, so that application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

[0128] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media.Computer-readable media can be computer-readable signal media or computer-readable storage media.Computer-readable storage media can be, for example, but not limited to: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof.More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM (Erasable Programmable Read-Only Memory) or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination thereof.In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0129] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0130] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination thereof.

[0131] The computer program code for performing the operations of the present application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0132] Those skilled in the art will appreciate that the modules or steps of the present application described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0133] Note that the above are only optional embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A data storage method, applied to a target node server in a container orchestration system, comprising: Obtain a target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create a target deployment unit corresponding to the target application in the target node server; In response to the binding operation of the target persistent storage volume declaration in the target deployment unit creation process, by calling the target container storage plug-in in the target node server, based on the target persistent storage volume declaration, a first logical volume is divided in the first volume group of the target node server and a second logical volume is divided in the second volume group, wherein the first volume group is a volume group converted from a solid state drive, and the second volume group is a volume group converted from a mechanical hard disk; Using the first logical volume as a cache disk of the target application, and using the second logical volume as a storage disk of the target application; In response to the target deployment unit creating completion operation, the first logical volume and the second logical volume are mounted to the created target deployment unit, so that application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

2. The method according to claim 1, wherein: The step of dividing a first logical volume in a first volume group of the target node server and a second logical volume in a second volume group based on the target persistent storage volume declaration includes: Determining a target cache capacity based on a target cache ratio and a target storage capacity in the target persistent storage volume declaration; Dividing a first logical volume having the target cache capacity in a first volume group of the target node server; A second logical volume having the target storage capacity is divided in the second volume group of the target node server.

3. The method according to claim 2, wherein: The first logical volume having the target cache capacity is divided in the first volume group of the target node server, including: A base volume with the target cache capacity is divided in the first volume group of the target node server. Logical volumes; The basic logical volume is formatted based on the target file system format in the target persistent storage volume declaration to obtain a first logical volume.

4. The method according to claim 1, wherein: The using the first logical volume as a cache disk of the target application and the using the second logical volume as a storage disk of the target application includes: By using a flash cache Flashcache method, the first logical volume is used as a cache disk of the target application, and the second logical volume is used as a storage disk of the target application.

5. The method according to claim 1, wherein: The application data generated by the target application during operation is stored in the first logical volume and the second logical volume, including: Determine a target cache policy corresponding to the target application based on the cache policy configuration information in the target persistent storage volume declaration; Based on the target cache policy, application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

6. The method according to claim 5, wherein: Based on the target cache policy, storing application data generated by the target application during operation into the first logical volume and the second logical volume includes: If the target cache policy is a write-back policy, all application data generated by the target application during operation are first stored in the first logical volume, and when a write-back instruction is detected, all application data are stored in the second logical volume; If the target cache policy is a write-through policy, all application data generated by the target application during operation are stored in the first logical volume and the second logical volume at the same time.

7. The method according to any one of claims 1 to 6, before obtaining the target persistent storage volume declaration corresponding to the containerized target application, further comprising: Based on the solid state drive configuration information corresponding to the target node server, determining a target solid state drive in the target node server, and converting the target solid state drive into a first volume group; Based on the mechanical hard disk configuration information corresponding to the target node server, determine the target node server The target mechanical hard disk in the server is converted into a second volume group.

8. A data storage device, integrated into a target node server in a container orchestration system, comprising: A target deployment unit creation module, configured to obtain a target persistent storage volume declaration corresponding to a containerized target application, and based on the target persistent storage volume declaration, create a target deployment unit corresponding to the target application in the target node server; a logical volume creation module, configured to respond to a binding operation of the target persistent storage volume declaration in a target deployment unit creation process, by calling a target container storage plug-in in the target node server, and based on the target persistent storage volume declaration, divide a first logical volume in a first volume group of the target node server and divide a second logical volume in a second volume group, wherein the first volume group is a volume group converted from a solid state drive, and the second volume group is a volume group converted from a mechanical hard disk; a logical volume processing module, configured to use the first logical volume as a cache disk of the target application and use the second logical volume as a storage disk of the target application; The logical volume mounting module is configured to mount the first logical volume and the second logical volume to the target deployment unit after the target deployment unit is created in response to the target deployment unit's creation completion operation, so that the application data generated by the target application during operation is stored in the first logical volume and the second logical volume.

9. An electronic device, comprising: at least one processor; a memory configured to store at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the data storage method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data storage method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Storage system, management method of the storage system, and program

    CN103080894A

  • Metadata acceleration method and device and storage equipment

    CN111190550A

  • Disk configuration method and device, server, electronic device and storage medium

    CN114706532A

  • Method for realizing disk acceleration based on linux kernel bcache technology in Kubernetes

    CN114840148A

  • Data storage method and device, equipment and storage medium

    CN116661686A