A data storage method, device, apparatus and storage medium
Patent Information
- Application Number
- CN202310573947.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-05-19
AI Technical Summary
[0005]现有的本地存储方式中,固态硬盘性能很高,但是价格昂亏,会增加使用成本
[0023] In a container orchestration system, the target node server 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 target deployment unit creation process, the target container storage plugin is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group on the target node server, based on the target persistent storage volume declaration. The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application. In response to the completion of the target deployment unit creation operation, the first and second logical volumes are mounted to the created target deployment unit, allowing application data generated during the target application's runtime to be stored in the first and second logical volumes, thus achieving local storage of application data. Since the first volume group is a volume group converted from solid-state drives (SSDs) and the second volume group is a volume group converted from hard disk drives (HDDs), the first logical volume is a solid-state drive type logical volume, and the second logical volume is a HDD type logical volume. Therefore, using the first logical volume as the cache disk for the target application ensures high performance, while using the second logical volume as the storage disk for the target application results in lower usage costs. Compared to using only solid-state drives (SSDs), this embodiment combines SSDs and hard disk drives (HDDs) to reduce operating costs while maintaining high performance.
Smart Images

Figure CN116661686B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and more particularly to a data storage method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of computer technology and cloud-native technology, container orchestration systems can be used to efficiently orchestrate and manage containerized applications throughout their entire lifecycle on cloud platforms. For example, using Kubernetes to manage containerized applications on multiple node servers in a cloud platform makes deploying containerized applications simpler and more efficient.
[0003] Currently, when deploying containerized applications, solid-state drives (SSDs) or hard disk drives (HDDs) are typically used as the application's storage disks to achieve local storage of application data.
[0004] However, in the process of realizing this invention, the inventors discovered at least the following problems in the prior art:
[0005] Among existing local storage options, solid-state drives (SSDs) offer high performance but are expensive, increasing usage costs. Hard disk drives (HDDs), on the other hand, are inexpensive but have low performance, failing to meet the high I / O performance requirements of applications. Summary of the Invention
[0006] This invention provides a data storage method, apparatus, device, and storage medium to ensure high performance while reducing usage costs.
[0007] In a first aspect, embodiments of the present invention provide a data storage method applied to a target node server in a container orchestration system, comprising:
[0008] Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the target deployment unit corresponding to the target application in the target node server;
[0009] In response to the binding operation of the target persistent storage volume declaration during the creation process of the target deployment unit, the target container storage plugin in the target node server is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives.
[0010] The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application.
[0011] In response to the completion of the creation 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 its operation is stored in the first logical volume and the second logical volume.
[0012] Secondly, embodiments of the present invention also provide a data storage device, integrated into a target node server in a container orchestration system, comprising:
[0013] The target deployment unit creation module is used to obtain the target persistent storage volume declaration corresponding to the containerized target application, and create the target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration;
[0014] The logical volume creation module is used 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 plugin in the target node server, based on the target persistent storage volume declaration, a first logical volume is partitioned in the first volume group and a second logical volume is partitioned in the second volume group of the target node server. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives.
[0015] A logical volume processing module is used to use the first logical volume as a cache disk for the target application and the second logical volume as a storage disk for the target application.
[0016] The logical volume mounting module is used to mount the first logical volume and the second logical volume to the created target deployment unit in response to the completion operation of the 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.
[0017] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0018] One or more processors;
[0019] Memory, used to store one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the data storage method provided in any embodiment of the present invention.
[0021] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data storage method as provided in any embodiment of the present invention.
[0022] One embodiment of the above invention has the following advantages or beneficial effects:
[0023] In a container orchestration system, the target node server 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 target deployment unit creation process, the target container storage plugin is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group on the target node server, based on the target persistent storage volume declaration. The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application. In response to the completion of the target deployment unit creation operation, the first and second logical volumes are mounted to the created target deployment unit, allowing application data generated during the target application's runtime to be stored in the first and second logical volumes, thus achieving local storage of application data. Since the first volume group is a volume group converted from solid-state drives (SSDs) and the second volume group is a volume group converted from hard disk drives (HDDs), the first logical volume is a solid-state drive type logical volume, and the second logical volume is a HDD type logical volume. Therefore, using the first logical volume as the cache disk for the target application ensures high performance, while using the second logical volume as the storage disk for the target application results in lower usage costs. Compared to using only solid-state drives (SSDs), this embodiment combines SSDs and hard disk drives (HDDs) to reduce operating costs while maintaining high performance. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart of a data storage method provided in one embodiment of the present invention;
[0026] Figure 2 This is an example of the architecture of a container orchestration system according to one embodiment of the present invention;
[0027] Figure 3 This is a flowchart of a data storage method provided in one embodiment of the present invention;
[0028] Figure 4 This is a flowchart of a data storage method provided in one embodiment of the present invention;
[0029] Figure 5This is a schematic diagram of the structure of a data storage device provided in one embodiment of the present invention;
[0030] Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0031] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0032] Figure 1 This is a flowchart illustrating a data storage method according to an embodiment of the present invention. This embodiment is applicable to the deployment of containerized applications and the local storage of their generated application data. The method can be executed by a data storage device, which can be implemented in software and / or hardware and integrated into an electronic device. For example, the device can be integrated into the target node server of a container orchestration system.
[0033] In this context, a container orchestration system can be a system used to orchestrate and manage containerized applications. For example, a container orchestration system could refer to the Kubernetes system. See also... Figure 2 A container orchestration system can include a cluster of node servers and a management server. The node server cluster consists of multiple node servers. Each node server is the server where the containerized application is actually deployed. The management server manages the multiple node servers, such as performing container scheduling and node status checks. For example, the management server can use its internal scheduling logic to schedule the containerized application to be deployed to a specific node server. The target node server is the node server to which the containerized application is scheduled for deployment. Each node server has the same internal architecture. For example, see [link to documentation]. Figure 2 The target node server may include an agent module, a target container storage plugin (such as the CSI container storage interface), and a plugin controller to support the plugin's functionality. The agent module (such as kubulet) is an agent running on the target node server to ensure that containers run within deployment units. The target container storage plugin may be a newly added container storage interface plugin that creates a first logical volume of SSD type and a second logical volume of HDD type, and combines the first and second logical volumes to cache data. The target container storage plugin is pre-registered in the agent module so that the agent module can successfully invoke the target container storage plugin for storage processing.
[0034] like Figure 1As shown, the method specifically includes the following steps:
[0035] S110. Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the target deployment unit corresponding to the target application in the target node server.
[0036] The target application refers to the containerized application that needs to be deployed on the target node server. There can be one or more target applications. Each target application corresponds to one container. The target persistent volume claim (PVC) is the configuration information describing the persistent volume (PV) of the target application, and it can be customized based on application requirements. A deployment unit (Pod) is the smallest deployment unit created and managed on the target node server. Each deployment unit can run one container, or multiple containers simultaneously. All containers within each deployment unit share network and storage space. A target deployment unit refers to a deployment unit containing the containerized target application.
[0037] Specifically, if a target application needs to be deployed, the target application is containerized, a 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 sent to the management server. The management server responds to the target application deployment request and schedules it to the target node server. See also... Figure 2 After receiving the target application deployment request, the proxy module in the target node server parses the target application deployment request, obtains the target persistent storage volume declaration (PVC) corresponding to the containerized target application, and creates the 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.
[0038] S120. In response to the binding operation of the target persistent storage volume declaration during the creation process of the target deployment unit, by calling the target container storage plugin in the target node server, based on the target persistent storage volume declaration, a first logical volume is partitioned in the first volume group of the target node server and a second logical volume is partitioned in the second volume group, wherein the first volume group is a volume group converted from solid-state drives and the second volume group is a volume group converted from mechanical hard drives.
[0039] Each node server has one container storage plugin. The target container storage plugin is the container storage plugin in the target node server. A volume group is a storage pool composed of one or more physical volumes, on which one or more logical volumes can be created. A physical volume refers to a solid-state drive (SSD) partition or a hard disk drive (HDD) partition. A physical volume is the basic storage logical block of Logical Volume Manager (LVM). One hard disk partition can correspond to one physical volume. LVM can logically combine one or more hard disk partitions, essentially using one large hard disk. When the space on a certain hard disk is insufficient, partitions from other hard disks can be added, thereby achieving dynamic management of storage capacity and improving storage flexibility. The first volume group is obtained by converting at least one SSD in the target node server. Solid-state drives (SSDs) are hard drives made of solid-state electronic storage chip arrays, with fast read and write speeds. The second volume group is obtained by converting at least one HDD in the target node server. Hard disk drives (HDDs) mainly consist of platters, read / write heads, a disk spindle, and a control motor, and their unit cost is low, making them suitable for large-capacity storage. The first logical volume is a solid-state drive (SSD) logical volume partitioned within the first volume group. The second logical volume is a hard disk drive (HDD) logical volume partitioned within the second volume group. File systems can be created on both the first and second logical volumes. Both logical volumes are used as local storage media.
[0040] Specifically, see Figure 2 During the creation of the target deployment unit, the agent module performs an operation to bind the target persistent storage volume declaration. When this operation is executed, the agent module calls the target container storage plugin to create a first logical volume and a second logical volume. For example, based on the storage configuration information in the target persistent storage volume declaration, the target container storage plugin can use the logical volume manager to create a first logical volume with a specified storage capacity and system file format in the first volume group of the target node server, and a second logical volume with a specified storage capacity and system file format in the second volume group. Thus, the target container storage plugin can obtain two different types of logical volumes: a first logical volume of solid-state drive type and a second logical volume of hard disk drive type.
[0041] It should be noted that after obtaining the target persistent storage volume declaration, the target container storage plugin is not immediately invoked to create the first and second logical volumes. Instead, the target container storage plugin is invoked to create the first and second logical volumes only when the target deployment unit is bound to the target persistent storage volume declaration during its creation process. This allows the first and second logical volumes to be created on the target node server only after the target deployment unit is scheduled to be deployed to the target node server. This ensures that the first and second logical volumes can be mounted to the created target deployment unit. Furthermore, the creation of the first and second logical volumes is completed before the target deployment unit is created, thus guaranteeing the success of the mounting and preventing mounting errors due to scheduling issues, which could lead to application data loss.
[0042] S130. Use the first logical volume as the cache disk for the target application and the second logical volume as the storage disk for the target application.
[0043] Specifically, see Figure 2 After creating two different types of first and second logical volumes for the target application, the independent first and second logical volumes can be aggregated and cached using a caching method. This allows the solid-state drive (SSD) type first logical volume to serve as the cache disk for the target application, and the hard disk drive (HDD) type second logical volume to serve as the storage disk. This enables application data generated by the target application to be cached on the first logical volume before being written to the second logical volume, thereby accelerating read and write performance. By combining the SSD type first logical volume and the HDD type second logical volume for data storage, storage performance comparable to using only SSDs can be achieved. Since using the low-cost HDD type second logical volume as the storage disk results in lower usage costs compared to using only SSDs, this embodiment satisfies the target application's high read and write performance requirements while controlling usage costs, ensuring that the overall cost remains low.
[0044] For example, S130 may include: using a flash cache method to use the first logical volume as the cache disk of the target application and the second logical volume as the storage disk of the target application.
[0045] Flash caching involves adding a caching layer between the file system and the device driver. It allows a first logical volume (SSD) to act as a cache disk for a second logical volume (HDD), which in turn acts as the final data storage disk. In other words, flash caching aggregates the independent first and second logical volumes into a single virtual, cached block device. By utilizing flash caching, high-performance, low-cost local storage can be achieved.
[0046] S140. In response to the completion of the creation 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 its operation is stored in the first logical volume and the second logical volume.
[0047] Specifically, see Figure 2 After creating a target deployment unit through the target container storage plugin, the target container storage plugin mounts the aggregated first and second logical volumes (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 and second logical volumes 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.
[0048] In 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, the target container storage plugin is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration. The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application. In response to the completion of the target deployment unit creation operation, the first and second logical volumes 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 and second logical volumes, thereby achieving local storage of application data. Since the first volume group is a volume group converted from solid-state drives (SSDs) and the second volume group is a volume group converted from hard disk drives (HDDs), the first logical volume is a solid-state drive type logical volume, and the second logical volume is a HDD type logical volume. Therefore, using the first logical volume as the cache disk for the target application results in high performance, while using the second logical volume as the storage disk for the target application results in low usage costs. Compared to using only solid-state drives (SSDs), this embodiment combines SSDs and hard disk drives (HDDs) to reduce operating costs while maintaining high performance.
[0049] Based on the above technical solution, before S110, it may further include: determining the target solid-state drive in the target node server based on the solid-state drive configuration information corresponding to the target node server, and converting the target solid-state drive into a first volume group; determining the target mechanical hard drive in the target node server based on the mechanical hard drive configuration information corresponding to the target node server, and converting the target mechanical hard drive into a second volume group.
[0050] The solid-state drive (SSD) configuration information is pre-configured based on business requirements, representing the available SSDs on the target node server that can be converted into volume groups. The hard disk drive (HDD) configuration information is also pre-configured based on business requirements, representing the available HDDs on the target node server that can be converted into volume groups.
[0051] Specifically, before deploying the containerized target application, based on the SSD configuration information of the target node server, all specified target SSDs on the target node server are identified, and all target SSDs are initially set as the first volume group, thus converting all target SSDs into the first volume group. Similarly, based on the HDD configuration information of the target node server, all specified target HDDs on the target node server are identified, and all target HDDs are initially set as the second volume group, thus converting all target HDDs into the second volume group. By pre-converting the disks based on their configuration information, the first logical volume can be created directly in the converted first volume group and the second logical volume can be created directly in the converted second volume group when deploying the target application, thereby improving the efficiency of logical volume creation. At the same time, the disk configuration information also enables dynamic configuration of volume groups, further improving storage flexibility.
[0052] Figure 3 This is a flowchart illustrating a data storage method according to an embodiment of the present invention. Based on the aforementioned embodiments, this embodiment optimizes the step of "dividing a first logical volume in the first volume group of the target node server and a second logical volume in the second volume group based on the target persistent storage volume declaration." Explanations of terms that are the same as or corresponding to those in the aforementioned embodiments are not repeated here.
[0053] See Figure 3 The data storage method provided in this embodiment specifically includes the following steps:
[0054] S310. Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the target deployment unit corresponding to the target application in the target node server.
[0055] S320, in response to the binding operation of the target persistent storage volume declaration during the creation process of the target deployment unit, determines 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 plugin in the target node server.
[0056] 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 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 drive or a single hard drive partition, and it is not limited by the total storage capacity of a single hard drive or a single hard drive partition.
[0057] Specifically, during the creation of the target deployment unit, the agent module performs an operation to bind the target persistent storage volume declaration. When this operation is executed, the agent module calls the target container storage plugin to create the first and second logical volumes. For example, in the target container storage plugin, the target cache ratio in the target persistent storage volume declaration is multiplied by the target storage capacity, and the result is the target cache capacity.
[0058] S330. Create a first logical volume with the target cache capacity in the first volume group of the target node server.
[0059] Specifically, in the target container storage plugin, a first logical volume with the target cache capacity is partitioned in the first volume group of the target node server through the logical volume manager.
[0060] For example, S330 may include: partitioning a basic logical volume with the 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 the first logical volume.
[0061] 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.
[0062] Specifically, when creating the first logical volume, the target container storage plugin can first partition a basic logical volume with the 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.
[0063] S340. Create a second logical volume with the target storage capacity in the second volume group of the target node server.
[0064] Specifically, in the target container storage plugin, a second logical volume with the target storage capacity is partitioned in the second volume group of the target node server through the logical volume manager.
[0065] For example, S340 may include: partitioning a basic logical volume with the 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 the second logical volume.
[0066] Specifically, similar to the first logical volume creation process, the target container storage plugin can first partition 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.
[0067] S350: Use the first logical volume as the cache disk for the target application and the second logical volume as the storage disk for the target application.
[0068] S360, In response to the completion of the creation of the target deployment unit, mount the first logical volume and the second logical volume to the created target deployment unit, so that the application data generated by the target application during its operation is stored in the first logical volume and the second logical volume.
[0069] 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 into a first volume group of the target node server, and a second logical volume with the target storage capacity into a second volume group of the target node server. This allows for dynamic configuration of the capacity space of the first and second logical volumes, further improving storage flexibility.
[0070] Figure 4 This is a flowchart illustrating a data storage method according to an embodiment of the present invention. Based on the above embodiments, this embodiment optimizes the step of "data storing application data generated by the target application during operation into the first logical volume and the second logical volume". Explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0071] See Figure 4 The data storage method provided in this embodiment specifically includes the following steps:
[0072] S410. Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the target deployment unit corresponding to the target application in the target node server.
[0073] S420, in response to the binding operation of the target persistent storage volume declaration during the creation process of the target deployment unit, by calling the target container storage plugin in the target node server, based on the target persistent storage volume declaration, a first logical volume is partitioned in the first volume group of the target node server and a second logical volume is partitioned in the second volume group.
[0074] S430. Use the first logical volume as the cache disk for the target application and the second logical volume as the storage disk for the target application.
[0075] S440, In response to the completion operation of the target deployment unit creation, mount the first logical volume and the second logical volume to the created target deployment unit.
[0076] S450. Based on the caching policy configuration information in the target persistent storage volume declaration, determine the target caching policy corresponding to the target application.
[0077] The target caching strategy refers to the method by which application data generated by the target application is cached and stored. For example, the target caching strategy can be a write-back strategy or a write-through strategy.
[0078] Specifically, caching strategies can be pre-configured in the target persistent storage volume declaration, allowing different caching strategies to be configured for different applications, thereby meeting personalized needs. For example, the caching strategy configured in the target persistent storage volume declaration can be used as the target caching strategy for the target application.
[0079] S460. Based on the target caching strategy, the application data generated by the target application during its operation is stored in the first logical volume and the second logical volume.
[0080] Specifically, when storing application data generated by the target application during its operation, the application data can be cached based on the configured target caching strategy, thereby achieving storage performance consistent with that of a solid-state drive.
[0081] For example, S460 may include: if the target caching policy is a write-back policy, then all application data generated by the target application during its operation is first stored in the first logical volume, and then all application data is stored in the second logical volume when a write-back instruction is detected.
[0082] Specifically, the write-back strategy first caches all generated application data in the first logical volume, which is a cache disk. When the operating system needs to write back, it sends a write-back command. Upon receiving the write-back command, all application data cached in the cache disk is written back to the second logical volume, which is a storage disk, thus achieving high read and write performance.
[0083] For example, S460 may further include: if the target caching strategy is a write-through strategy, then all application data generated by the target application during runtime is simultaneously stored in the first logical volume and the second logical volume.
[0084] Specifically, the write-through strategy caches all generated application data in the first logical volume and simultaneously stores the cached application data in the second logical volume, thereby achieving synchronous data storage and providing high storage performance.
[0085] The technical solution of this embodiment determines the target caching strategy corresponding to the target application based on the caching strategy configuration information in the target persistent storage volume declaration, and stores the application data generated by the target application during its operation into the first logical volume and the second logical volume based on the target caching strategy. This allows for dynamic configuration of the caching strategy to meet different personalized needs.
[0086] The following are embodiments of the data storage device provided in this invention. This device and the data storage methods in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the data storage device, please refer to the embodiments of the above data storage methods.
[0087] Figure 5 This is a schematic diagram of a data storage device provided in an embodiment of the present invention. This embodiment is applicable to situations where containerized applications are deployed and their generated application data is stored locally. Figure 5 As shown, the device is integrated into the target node server of the container orchestration system, specifically including: target deployment unit creation module 510, logical volume creation module 520, logical volume processing module 530 and logical volume mounting module 540.
[0088] The target deployment unit creation module 510 is used to obtain the target persistent storage volume declaration corresponding to the containerized target application, and create the target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration.
[0089] The logical volume creation module 520 is used 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 plugin in the target node server, based on the target persistent storage volume declaration, it divides a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives.
[0090] The logical volume processing module 530 is used to use the first logical volume as the cache disk of the target application and the second logical volume as the storage disk of the target application.
[0091] The logical volume mounting module 540 is used to mount the first logical volume and the second logical volume to the created target deployment unit in response to the completion operation of the 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.
[0092] In 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, the target container storage plugin is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration. The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application. In response to the completion of the target deployment unit creation operation, the first and second logical volumes 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 and second logical volumes, thereby achieving local storage of application data. Since the first volume group is a volume group converted from solid-state drives (SSDs) and the second volume group is a volume group converted from hard disk drives (HDDs), the first logical volume is a solid-state drive type logical volume, and the second logical volume is a HDD type logical volume. Therefore, using the first logical volume as the cache disk for the target application results in high performance, while using the second logical volume as the storage disk for the target application results in low usage costs. Compared to using only solid-state drives (SSDs), this embodiment combines SSDs and hard disk drives (HDDs) to reduce operating costs while maintaining high performance.
[0093] Optionally, the logical volume creation module 520 includes:
[0094] The target cache capacity determination unit is used to determine the target cache capacity based on the target cache ratio and target storage capacity in the target persistent storage volume declaration;
[0095] The first logical volume creation unit is used to partition a first logical volume with the target cache capacity in the first volume group of the target node server.
[0096] The second logical volume creation unit is used to partition a second logical volume with the target storage capacity from the second volume group of the target node server.
[0097] Optionally, the first logical volume creation unit is specifically used for:
[0098] In the first volume group of the target node server, a basic logical volume with the target cache capacity is partitioned; based on the target file system format in the target persistent storage volume declaration, the basic logical volume is formatted to obtain the first logical volume.
[0099] Optionally, the logical volume processing module 530 is specifically used for:
[0100] By using Flashcache, the first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application.
[0101] Optionally, the device further includes:
[0102] The target caching strategy determination module is used to determine the target caching strategy corresponding to the target application based on the caching strategy configuration information in the target persistent storage volume declaration.
[0103] The data storage module is used to store the application data generated by the target application during its operation into the first logical volume and the second logical volume, based on the target caching strategy.
[0104] Optionally, the data storage module is specifically used for:
[0105] If the target caching strategy is a write-back strategy, then all application data generated by the target application during its operation will first be stored in the first logical volume, and then all application data will be stored in the second logical volume when a write-back instruction is detected.
[0106] If the target caching strategy is a write-through strategy, then all application data generated by the target application during its operation will be stored simultaneously in the first logical volume and the second logical volume.
[0107] Optionally, the device further includes:
[0108] The disk conversion module is used to determine the target solid-state drive in the target node server based on the solid-state drive configuration information of the target node server before obtaining the target persistent storage volume declaration corresponding to the containerized target application, and convert the target solid-state drive into a first volume group; and to determine the target mechanical hard drive in the target node server based on the mechanical hard drive configuration information of the target node server, and convert the target mechanical hard drive into a second volume group.
[0109] The data storage device provided in the embodiments of the present invention can execute the data storage method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the data storage method.
[0110] It is worth noting that in the embodiments of the above data storage device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy distinction between each other and are not used to limit the scope of protection of the present invention.
[0111] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 6 A block diagram is shown of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 6 The electronic device 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0112] like Figure 6 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0113] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0114] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0115] 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. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0116] 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 or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0117] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0118] Processing unit 16 executes various functional applications and data processing by running programs stored in system memory 28, such as implementing a data storage method provided in this embodiment, the method including:
[0119] Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the target deployment unit corresponding to the target application in the target node server;
[0120] In response to the binding operation of the target persistent storage volume declaration during the creation process of the target deployment unit, the target container storage plugin in the target node server is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives.
[0121] The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application.
[0122] In response to the completion of the creation 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 its operation is stored in the first logical volume and the second logical volume.
[0123] Of course, those skilled in the art will understand that the processor can also implement the technical solutions of the data storage method provided in any embodiment of the present invention.
[0124] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the program implements the data storage method steps provided in any embodiment of the present invention, the method comprising:
[0125] Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the target deployment unit corresponding to the target application in the target node server;
[0126] In response to the binding operation of the target persistent storage volume declaration during the creation process of the target deployment unit, the target container storage plugin in the target node server is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives.
[0127] The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application.
[0128] In response to the completion of the creation 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 its operation is stored in the first logical volume and the second logical volume.
[0129] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0130] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying 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. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0131] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0132] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0133] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0134] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A data storage method, characterized in that, Target node servers used in container orchestration systems include: Obtain the target persistent storage volume declaration corresponding to the containerized target application, and based on the target persistent storage volume declaration, create the 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 during the creation process of the target deployment unit, the target container storage plugin in the target node server is invoked to partition a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives. The first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application. In response to the completion of the creation 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 its operation is stored in the first logical volume and the second logical volume.
2. The method according to claim 1, characterized in that, The step of partitioning a first logical volume in the first volume group and a second logical volume in the second volume group of the target node server based on the target persistent storage volume declaration includes: The target cache capacity is determined based on the target cache ratio and target storage capacity in the target persistent storage volume declaration; A first logical volume with the target cache capacity is partitioned out from the first volume group of the target node server; A second logical volume with the target storage capacity is partitioned out from the second volume group of the target node server.
3. The method according to claim 2, characterized in that, In the first volume group of the target node server, a first logical volume with the target cache capacity is partitioned, including: Within the first volume group of the target node server, a basic logical volume with the target cache capacity is partitioned; Based on the target file system format in the target persistent storage volume declaration, the underlying logical volume is formatted to obtain the first logical volume.
4. The method according to claim 1, characterized in that, The step of using the first logical volume as the cache disk for the target application and the second logical volume as the storage disk for the target application includes: By using Flashcache, the first logical volume is used as the cache disk for the target application, and the second logical volume is used as the storage disk for the target application.
5. The method according to claim 1, characterized in that, The application data generated by the target application during its operation is stored in the first logical volume and the second logical volume, including: Based on the caching policy configuration information in the target persistent storage volume declaration, the target caching policy corresponding to the target application is determined; Based on the target caching strategy, the application data generated by the target application during its operation is stored in the first logical volume and the second logical volume.
6. The method according to claim 5, characterized in that, Based on the target caching strategy, the application data generated by the target application during its operation is stored in the first logical volume and the second logical volume, including: If the target caching strategy is a write-back strategy, then all application data generated by the target application during its operation will first be stored in the first logical volume, and then all application data will be stored in the second logical volume when a write-back instruction is detected. If the target caching strategy is a write-through strategy, then all application data generated by the target application during its operation will be stored simultaneously in the first logical volume and the second logical volume.
7. The method according to any one of claims 1-6, characterized in that, Before obtaining the target persistent storage volume declaration corresponding to the containerized target application, the following steps are also included: Based on the solid-state drive configuration information corresponding to the target node server, the target solid-state drive in the target node server is determined, and the target solid-state drive is converted into the first volume group; Based on the mechanical hard drive configuration information corresponding to the target node server, the target mechanical hard drive in the target node server is determined, and the target mechanical hard drive is converted into a second volume group.
8. A data storage device, characterized in that, The target node servers integrated into the container orchestration system include: The target deployment unit creation module is used to obtain the target persistent storage volume declaration corresponding to the containerized target application, and create the target deployment unit corresponding to the target application in the target node server based on the target persistent storage volume declaration; The logical volume creation module is used 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 plugin in the target node server, based on the target persistent storage volume declaration, a first logical volume is partitioned in the first volume group and a second logical volume is partitioned in the second volume group of the target node server. The first volume group is a volume group converted from solid-state drives, and the second volume group is a volume group converted from mechanical hard drives. A logical volume processing module is used to use the first logical volume as a cache disk for the target application and the second logical volume as a storage disk for the target application. The logical volume mounting module is used to mount the first logical volume and the second logical volume to the created target deployment unit in response to the completion operation of the 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.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data storage method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the data storage method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method, device, and system for host machine volume allocation
CN106126123A
Snapshot rollback method and device
CN110502187A