Distributed storage cluster, storage engine, two-copy storage method and device

By adopting a two-replica strategy in the distributed storage system, storing replicas of data blocks in RAID0 and RAIDX logical volumes, and prioritizing the use of RAIDX logical volumes for data operations, the data integrity problem under the two-replica mechanism is solved, achieving high reliability and high performance data protection.

CN114610235BActive Publication Date: 2025-12-05NEW H3C BIG DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210193755.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2025-12-05
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

In a distributed storage system with a two-replica mechanism, there is a risk of data integrity corruption, especially the inability to recover data when both physical disks fail simultaneously.

Method used

A two-replica storage strategy is adopted, storing two copies of the data blocks in different types of RAID0 and RAIDX logical volumes respectively. RAIDX logical volumes are used preferentially for data writing and reading, and the high redundancy of RAIDX logical volumes is used for data protection.

Benefits of technology

It improves the data integrity and security of distributed storage clusters, can tolerate the failure of any two physical disks, and maintains data availability and performance superior to three-replica storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610235B_ABST
    Figure CN114610235B_ABST
Patent Text Reader

Abstract

The application provides a distributed storage cluster, a storage engine, a two-copy storage method and equipment, and is used for solving the data integrity technical problem under the two-copy mechanism of the distributed storage. The distributed storage cluster provided by the application deploys raid0 and raidx two types of raid logical volumes, adopts a two-copy copy storage strategy, and stores two copies of a data block Chunk of a logical volume LUN of the distributed storage cluster in different types of raid logical volumes on different storage nodes. The raidx refers to a disk redundancy array with a redundancy degree of 3, 5, 6 or higher. The application can further guarantee the data integrity and security of the distributed storage cluster.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication and cloud computing technology, and particularly relates to a distributed storage cluster, a storage engine, a two-copy storage method and equipment. BACKGROUND

[0002] The traditional network storage system uses a centralized storage server to store all data. The centralized storage server can become a bottleneck of system performance and is the focus of reliability and security, and cannot meet the needs of large-scale storage applications.

[0003] Distributed storage is to store data on multiple independent devices. An extensible system structure is used to share the storage load by using multiple storage servers, and a location server is used to locate the storage information. The distributed storage not only improves the reliability, availability and access efficiency of the system, but also is easy to expand.

[0004] The distributed storage usually uses a multi-copy mechanism, generally two copies or three copies, and each copy is stored on a different storage node. The available storage space of the storage cluster is the sum of the storage space of each distributed storage node in the cluster divided by the number of copies.

[0005] When the distributed storage uses a two-copy mechanism, the possibility of double physical disk failure of the two copies can occur, which can cause data integrity damage. Double disk failure refers to the possibility of failure of a physical disk used to create a logical volume on a storage node, which increases with the increase of power-on time and usage capacity. When the first physical disk fails in the cluster, there is a certain probability that another physical disk will fail during the replacement of the failed disk while the storage system is restoring old data to the new physical disk. When the two copies of the data are on the two failed physical disks, it will cause unrecoverable data damage, which damages the data integrity of the storage cluster.

[0006] To avoid the problem of unrecoverable data, a three-copy or more than three-copy mechanism can be used to solve the double disk failure problem of two copies. Because more than three copies are stored on different physical disks of more than three different nodes, two disks can be tolerated to fail at the same time. When two disks fail and two copies are damaged, one copy is still available. However, the maximum available capacity of the storage cluster using three copies is lower than that of two copies. The former is the total available storage space of the cluster / 3, and the latter is the total available storage space of the cluster / 2. Moreover, the performance of three copies is lower than that of two copies because of the strict consistency of distributed storage. Three copies require simultaneous writing of three copies, while two copies only require simultaneous writing of two copies. SUMMARY

[0007] Therefore, the application provides a distributed storage cluster, a storage engine, a two-copy storage method and equipment, which are used to solve the technical problem of data integrity in a two-copy mechanism of a distributed storage.

[0008] According to an aspect of the embodiment of the application, the application provides a two-copy storage method of a distributed storage cluster, which is applied to a distributed storage cluster having a plurality of storage nodes.

[0009] The distributed storage cluster adopts a two-copy storage strategy.

[0010] The distributed storage cluster has two types of redundant array of independent disks (RAID) storage pools, one of which is a RAID0 storage pool composed of RAID0 logical volumes, and the other of which is a RAIDx storage pool composed of RAIDx logical volumes.

[0011] The two copies of the same chunk of the distributed storage cluster are respectively stored in different types of RAID logical volumes on different storage nodes.

[0012] Further, when the storage engine of the distributed storage cluster receives a data write request, the step of writing data by the storage engine comprises:

[0013] The storage engine searches for the metadata of the chunk of the data to be written, and obtains the storage positions of the two copies corresponding to the chunk.

[0014] The RAID volume types and the current states of the logical volumes of the two copies are obtained.

[0015] It is determined whether the states of the RAIDx logical volumes in the logical volumes of the two copies are normal.

[0016] When the state of the RAIDx logical volume is normal, the copy in the RAIDx logical volume is preferentially written with the data to be written.

[0017] Further, when the storage engine of the distributed storage cluster receives a data read request, the step of reading data by the storage engine comprises:

[0018] The storage engine searches for the metadata of the chunk of the data to be read, and obtains the storage positions of the two copies corresponding to the chunk.

[0019] The RAID volume types and the current states of the logical volumes of the two copies are obtained.

[0020] It is determined whether the states of the RAIDx logical volumes in the logical volumes of the two copies are normal.

[0021] When the state of the raidx logical volume is normal, the to-be-read data is read from the copy in the raidx logical volume preferentially.

[0022] Further, the raidx logical volume is a logical volume created based on a raid3, raid5, raid6 or higher redundancy disk redundancy array.

[0023] Based on an aspect of an embodiment of the present application, the present application further provides a distributed storage cluster:

[0024] The distributed storage cluster has a plurality of storage nodes;

[0025] The distributed storage cluster adopts a 2-copy copy storage strategy;

[0026] The distributed storage cluster has two types of raid storage pools, one of which is a raid0 storage pool composed of raid0 logical volumes, and the other of which is a raidx storage pool composed of raidx logical volumes.

[0027] The two copies of the same data block Chunk of the distributed storage cluster are respectively stored in different types of raid logical volumes on different storage nodes.

[0028] Further, when the storage engine of the distributed storage cluster receives a data write request, the storage engine finds the metadata of the data block of the to-be-written data, and obtains the storage locations of the two copies corresponding to the data block.

[0029] The storage engine obtains the raid volume type and the current state of the logical volume where the two copies are located, and determines whether the state of the raidx logical volume in the logical volume where the two copies are located is normal.

[0030] When the state of the raidx logical volume is normal, the storage engine preferentially writes the to-be-written data to the copy in the raidx logical volume.

[0031] Further, when the storage engine of the distributed storage cluster receives a data read request, the storage engine finds the metadata of the data block where the to-be-read data is located, and obtains the storage locations of the two copies corresponding to the data block.

[0032] The storage engine obtains the raid volume type and the current state of the logical volume where the two copies are located, and determines whether the state of the raidx logical volume in the logical volume where the two copies are located is normal.

[0033] When the state of the raidx logical volume is normal, the to-be-read data is read from the copy in the raidx logical volume preferentially.

[0034] Further, the raidx logical volume is a logical volume created based on a raid3, raid5, raid6 or higher redundancy disk redundancy array.

[0035] Based on an aspect of the embodiment of the application, the application further provides a storage engine of a distributed storage cluster, the storage engine comprising:

[0036] The writing module is configured to, when receiving a data writing request, find metadata of a first data block to which data to be written is to be written, acquire storage locations of a first copy and a second copy corresponding to the first data block, acquire a raid volume type and a current state of a logical volume in which the first copy and the second copy are located, judge whether a state of a raidx logical volume in the logical volume in which the first copy and the second copy are located is normal, and when the state of the raidx logical volume is normal, preferentially write the data to be written to a copy in the raidx logical volume.

[0037] The reading module is configured to, when receiving a data reading request, find metadata of a second data block in which data to be read is located, acquire storage locations of a third copy and a fourth copy corresponding to the second data block, acquire a raid volume type and a current state of a logical volume in which the third copy and the fourth copy are located, judge whether a state of a raidx logical volume in the logical volume in which the third copy and the fourth copy are located is normal, and when the state of the raidx logical volume is normal, preferentially read the data to be read from a copy in the raidx logical volume.

[0038] The distributed storage cluster provided by the application deploys raid0 and raidx two types of raid logical volumes, adopts a 2-copy copy storage strategy, and stores 2 copies of a data block Chunk of a logical volume LUN of the distributed storage cluster in different types of raid logical volumes on different storage nodes respectively. The raidx refers to a raid3, raid5, raid6 or higher redundancy disk redundancy array. The application can further guarantee data integrity and security of the distributed storage cluster. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the application or the prior art. Obviously, the drawings in the following description are only some embodiments described in the application, and other drawings can also be obtained by those skilled in the art according to these drawings of the embodiments of the application.

[0040] Figure 1An example of a storage configuration mode in a distributed storage cluster and deployment of two data replicas in the distributed storage cluster in an embodiment of the present application;

[0041] Figure 2 An example of a storage configuration mode in a distributed storage cluster and deployment of two data replicas in the distributed storage cluster in another embodiment of the present application;

[0042] Figure 3 A flow chart of a two-replica data write step in a distributed storage cluster provided in an embodiment of the present application;

[0043] Figure 4 A flow chart of a two-replica data read step in a distributed storage cluster provided in an embodiment of the present application;

[0044] Figure 5 An electronic device structure schematic diagram for implementing a method step performed by a storage engine in a distributed storage cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The terminology used in the present application merely describes specific embodiments, and is not intended to limit the present application. The singular forms "a", "an" and "the" used in the present application are intended to include the plural forms, unless the context clearly indicates otherwise. The term "and / or" used in the present application means any or all possible combinations of one or more associated listed items.

[0046] It should be understood that although the terms first, second, third, etc. can be used in this application to describe various information, these terms are not intended to limit the present application. These terms are only used to distinguish one type of information from another type of information. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information, without departing from the scope of the present application. In addition, depending on the context, the word "if" used herein can be interpreted as "when" or "in response to determining" or "in response to ascertaining".

[0047] The application aims to provide a distributed storage cluster, a storage engine, and a two-copy storage method and device, and solve the technical problem of data integrity in a two-copy mechanism of the distributed storage.

[0048] To achieve the application purpose of the application, the technical solution of the application needs to at least perform the following configuration and deployment strategies of the distributed storage:

[0049] Storage configuration and deployment strategy 1: the distributed storage cluster adopts a two-copy distribution strategy.

[0050] That is, the technical solution of the application is specially improved for the two-copy mechanism of the distributed storage.

[0051] The copies in the application are divided into two levels, one is a distributed storage level copy, and the other is a disk redundant array level copy. The copy mechanism of the distributed storage refers to a mechanism that, in order to guarantee the integrity and security of data, the data written into the distributed storage cluster is copied into multiple copies with the same content, and the copies are stored in different storage nodes. The copy mechanism of the disk redundant array (RAID) refers to a mechanism that the data stored in the RAID is stored in multiple disks in a redundant check manner. The data may be stored in different disks in blocks, and when a disk fails, the data on the failed disk can be recovered through the data and check data in other non-failed disks.

[0052] Storage configuration and deployment strategy 2: two types of raid storage pools need to be deployed in the distributed storage cluster, one is a raid0 storage pool, and the other is a raidx storage pool.

[0053] In the raid0 storage pool, each disk can be configured as raid0, and each volume in the raid0 must correspond to a physical disk. Assuming that two disks are used to form two raid0 volumes, when one disk is damaged, both raid0 volumes will be damaged.

[0054] raidx refers to a disk redundant array with a redundancy degree of 3, 5, 6, or higher. For example, when raidx is raid5, in the raid5 storage pool, multiple disks can be used to form multiple raid5 volumes, and each volume includes at least three physical disks.

[0055] Preferably, in the distributed storage cluster, the total number of raid0 logical volumes in the raid0 storage pool is the same as the total number of raidx logical volumes in the raidx storage pool. If the total number of raid0 logical volumes and the total number of raidx logical volumes are not the same, it will cause a certain waste of storage space and management difficulties, so the preferred solution is that the total number of raid0 logical volumes and the total number of raidx logical volumes are as same as possible, that is, the total storage space of raid0 logical volumes and the total storage space of raidx logical volumes are as same as possible, so that the storage space is maximally utilized.

[0056] Storage configuration and deployment strategy 3: The two data replicas stored in the distributed storage cluster are respectively distributed on different raid logical volumes of different storage nodes.

[0057] One of the two data replicas of the distributed storage needs to be deployed in the raid0 storage pool, and the other data replica is deployed in the raidx storage. The data replicas are distributed in different storage nodes to prevent business interruption and data loss caused by single node failure of the storage node. The data replicas are respectively stored in raid0 logical volumes and raidx logical volumes, so that the technical effect of obtaining high storage space utilization while avoiding data loss caused by double physical disk damage can be achieved.

[0058] Figure 1 For the storage configuration mode in the distributed storage cluster and the deployment of the two data replicas in the distributed storage cluster in an embodiment of the application. The distributed storage cluster in the embodiment includes three storage nodes, and a raid0 storage pool and a raid5 storage pool are deployed on each storage node. Each raid0 logical volume in each raid0 storage pool corresponds to a physical disk. In each raid5 storage pool, each raid5 logical volume is composed of three physical disks. When the to-be-stored data A enters the distributed storage cluster, based on the two-copy storage strategy of the cluster configuration, the data A is copied into two identical copies, namely copy A1 and copy A2. Based on the technical solution of the application, the two copies are respectively stored in different types of storage pools on two different storage nodes, one in the raid0 storage pool in the storage node 1 and the other in the raid5 storage pool in the storage node 3. Raid5 is usually composed of three physical disks, and each data block is divided and stored in three physical disks, for example, two physical disks are used as data disks and one physical disk is used as a parity disk. When any one of the three physical disks is damaged, the damaged data can be recovered through the other two physical disks. Figure 1The storage configuration in the example distributed storage cluster is 2 raid0 logical volumes, 2 raid5 logical volumes for each node, and a total of 5 disks, wherein 2 disks form two raid0 logical volumes, 3 disks form two raid5 logical volumes, and 3 nodes each have 2 raid0 logical volumes and 2 raid5 logical volumes, a total of 6 raid0 logical volumes and 6 raid5 logical volumes.

[0059] Figure 2 For another embodiment of the present application, an example of the storage configuration in the distributed storage cluster and the deployment of two data replicas in the distributed storage cluster is provided. The example distributed storage cluster includes 3 storage nodes, storage node 1 is deployed with 4 raid0 logical volumes, storage node 2 and storage node 3 are each deployed with 2 raid5 logical volumes, and the number of raid0 logical volumes is the same as the number of raid5 logical volumes.

[0060] Based on the foregoing configuration and deployment strategy of the distributed storage cluster, before the cluster provides storage services to the outside, the following configuration and deployment steps need to be performed on the distributed storage cluster:

[0061] Step S1. Configure raid0 logical volumes and raid5 logical volumes according to the preset storage configuration and deployment strategy of the distributed storage cluster. The preset storage configuration and deployment strategy of the distributed storage cluster includes: using a 2-replica replica distribution strategy, distributing 2 replicas in raid0 logical volumes and raid5 logical volumes respectively, and locating raid0 logical volumes and raid5 logical volumes where the 2 replicas are located in different storage nodes.

[0062] Before creating the distributed storage cluster, the required storage space size is first determined according to the design requirements, and raid0 storage pools and raid5 storage pools are created and configured for different storage nodes according to the storage distribution strategy of two replicas.

[0063] Step S2. Configure the replica distribution strategy so that any data block Chunk in the storage space provided by the distributed storage cluster has two replicas, and the two replicas are distributed in raid0 logical volumes and raid5 logical volumes of different storage nodes.

[0064] Step S3. When the distributed storage cluster receives a read / write request for a specified data block Chunk, if the replica in the raid5 logical volume of the specified data block is normal, the replica of the specified data block in the raid5 logical volume is used preferentially; if the replica in the raid5 logical volume of the specified data block is being rebuilt, the replica of the specified data block in the raid0 logical volume is used preferentially.

[0065] In an embodiment of the present application, the step of configuring raid0 logical volumes and raidx logical volumes according to the preset storage configuration and deployment strategy of the distributed storage cluster in step S1 can further include:

[0066] Step S11: checking whether the number of physical disks of each storage node of the distributed storage cluster meets the requirement;

[0067] Since the preset storage configuration and deployment strategy of the distributed storage cluster adopted by the embodiment of the present application adopts a 2-copy replica distribution strategy and the 2 copies are respectively distributed in raid0 logical volumes and raidx logical volumes of different nodes, the total number of raid0 volumes (disk space) in the cluster is preferably required to be equal to or approximately equal to the total number of raidx volumes (disk space) in the cluster from the perspective of space utilization and convenient management;

[0068] When the capacity of each disk is the same and the number of volumes is the same, it also represents the same capacity; when the capacity of each disk is different, the total disk space of raid0 logical volumes in the cluster is required to be equal to or approximately equal to the total disk space of raidx logical volumes in the cluster.

[0069] For example, when raidx is raid5, one raid5 requires at least 3 physical disks, which can adopt a 2+1 construction mode of 2 data disks and 1 parity disk, or a 3+1 construction mode of 3 data disks and 1 parity disk. Raid0 can only require 1 physical disk.

[0070] This step needs to check whether the number of physical disks of each storage node of the distributed storage cluster meets the deployment requirement of the cluster. For example, the cluster has 3 nodes, and raid0 storage pools composed of 2 raid0 volumes and raid5 storage pools composed of 2 raid5 volumes are deployed on each node, 2 raid0 volumes require 2 physical disks, and 2 raid5 volumes require 3 physical disks.

[0071] Step S12: configuring and calculating whether the number of raid0 and raidx logical volumes of each storage node is the same;

[0072] Since the present application adopts a 2-copy distribution strategy and the 2 copies need to be deployed on different types of raid volumes of different nodes, it is necessary to configure and calculate whether the number of two types of raid volumes (i.e. disk space) configured on the storage node is the same.

[0073] For example, in an embodiment of the present application, cluster 1 has 3 storage nodes, and the number of physical disks of each storage node is 5. The following deployment mode can be adopted:

[0074] The 2 physical disks in each node are configured as a raid0 storage pool, including 2 raid0 logical volumes.

[0075] The 3 physical disks in each node are configured as a raid5 storage pool, including 2 raid5 logical volumes.

[0076] According to the above configuration, in the entire distributed storage cluster:

[0077] The number of raid0 volumes = 2*3 = 6

[0078] The number of raid5 volumes = 2*3 = 6

[0079] In another embodiment, the cluster 2 has 3 storage nodes, the storage nodes 1 and 2 each have 3 physical disks, and the node 3 has 4 physical disks. The deployment manner is as follows:

[0080] The 3 physical disks in the nodes 1 and 2 are configured as a raid5 storage pool, including 2 raid5 logical volumes.

[0081] The 4 physical disks in the node 3 are configured as a raid0 storage pool, including 4 raid0 logical volumes.

[0082] According to the above configuration, in the entire distributed storage cluster:

[0083] The number of raid5 logical volumes in the cluster is 2*2 = 4

[0084] The number of raid0 logical volumes in the cluster is 4*1 = 4

[0085] When the checking of steps S11 and S12 is completed, it is determined that the number of physical disks meets the requirement and the number of two types of logical volumes is the same, and then the actual configuration and deployment operation can be started.

[0086] Step S13: calling a raid driver tool, creating the required raid0 logical volume and raidx logical volume of each storage node, and recording the raid type and capacity of each logical volume.

[0087] For example, the volume of the physical disk hdd after the raid configuration is recorded as the logical volume ldd.

[0088] ldd1 raid0 600G; ldd2 raid0 600G;

[0089] ldd3 raid5 600G; ldd4 raid5 600G;

[0090] The disk number and raid type of the logical volume are recorded.

[0091] disk0 ldd1 raid0; disk1 ldd2 raid0; disk2 ldd3 raid5; disk3 ldd4 raid5.

[0092] disk0 ldd1 raid0; disk1 ldd2 raid0; disk2 ldd3 raid5; disk3 ldd4 raid5.

[0093] Step S14: Create a distributed storage cluster, and add the created raid0 logical volume and raidx logical volume to the created distributed storage cluster.

[0094] After creating the distributed storage cluster, cluster initialization is performed, a storage service is started, and after the storage service is started, an administrator can access the storage system, create a storage volume, such as 100G and 2 copies, for the distributed storage cluster.

[0095] In an embodiment of the present application, step S2 is configured to configure a copy distribution strategy, which causes any data block Chunk in the storage space provided by the distributed storage cluster to have two copies, and the two copies are respectively distributed in raid0 logical volumes and raid5 logical volumes of different storage nodes. The process of allocating two copies of a data block Chunk of a logical volume LUN by using the copy distribution strategy is as follows:

[0096] Step S21: Select any logical volume of any storage node for copy 1.

[0097] Step S21: In other storage nodes except the storage node selected for copy 1, select a logical volume of a type different from that of the logical volume selected for copy 1 as the logical volume of copy 2.

[0098] For example, the distributed storage cluster includes 3 storage nodes, each node has 2 raid0 logical volumes and 2 raid5 logical volumes, when copy 1 is allocated to a raid0 logical volume in node 1, copy 2 can only be allocated to a raid5 logical volume in node 2 or node 3.

[0099] After completing the two-copy grouping and distribution processing of the cluster logical volume data block, the metadata service records the metadata information of each data block, such as the storage location of the copy, the type of the logical volume where the copy is located, and the like. After the administrator completes the creation of the distributed storage cluster and the copy distribution configuration, the created logical volume can be mounted to the storage cluster, and after completing the mounting of all logical volumes, the storage service can be provided to the outside.

[0100] Figure 3The distributed storage cluster two-copy data writing step flowchart provided by an embodiment of the present application is based on the configuration and deployment strategy and the replica distribution strategy of the distributed storage cluster provided by the present application. After the cluster is created, in order to improve the data writing efficiency, the storage engine of the distributed storage cluster preferentially writes data to the replica in the raidx logical volume when writing data. The replica data writing process is as follows:

[0101] Step S31. The storage engine finds the metadata of the data block to be written, and obtains the storage locations of the two replicas, replica 1 and replica 2, corresponding to the data block.

[0102] After receiving the write request, the storage engine first determines the data block Chunk to which the data is to be written. After determining the data block to be written, the metadata service module is queried for the metadata of the data block. According to the obtained metadata, the storage locations of the two replicas corresponding to the data block can be obtained. Through the metadata service, the storage node where the replica is located, the logical volume where the replica is located, and the raid volume type of the logical volume can also be obtained.

[0103] Step S32. Obtain the raid volume type of the logical volume where the two replicas are located and the current state of the logical volume.

[0104] The state of the logical volume where the replica is located can be obtained by using a raid tool through the following example command:

[0105] storcli64 / c0 / v1 show / / Applicable to lsi manufacturer raid

[0106] Step S33. Determine whether the state of the raidx logical volume in the two replicas is normal. If yes, execute step S34, otherwise execute step S35.

[0107] Step S34. Preferentially write the to-be-written data to the replica in the raidx logical volume, and then write the to-be-written data to the replica in the raid0 logical volume.

[0108] Step S35. Write the to-be-written data to the replica in the raid0 logical volume.

[0109] When the state of the raidx logical volume is rebuild, the to-be-written data can be written after the raidx logical volume recovers to normal. If the state of the raidx logical volume is offline or fail, it indicates that the raidx logical volume is unavailable, and the administrator needs to intervene.

[0110] Figure 4The distributed storage cluster two-copy data reading step flowchart provided by an embodiment of the present application is created based on the configuration and deployment strategy and the replica distribution strategy of the distributed storage cluster provided by the present application, and in order to improve the data reading efficiency, the storage engine of the distributed storage cluster preferentially reads data from the replica in the raidx logical volume when reading data. The replica data reading process is as follows:

[0111] Step S41. The storage engine searches for the metadata of the data block where the data to be read is located, and obtains the storage locations of the two replicas corresponding to the data block;

[0112] After receiving the reading request, the storage engine first determines from which data block Chunk to read data, and then searches for the metadata of the data block in the metadata service module, and obtains the storage locations of the two replicas corresponding to the data block according to the obtained metadata. Through the metadata service, the storage node where the replica is located, the logical volume where the replica is located, and the raid volume type of the logical volume can also be obtained.

[0113] Step S42. Obtain the raid volume type of the logical volume where the two replicas are located and the current state of the logical volume;

[0114] The way to obtain the state of the logical volume where the replica is located can use raid tools, for example, the current state of the specified logical volume can be obtained through the storcli64 / c0 / v1 show command.

[0115] Step S43. Determine whether the state of the raidx logical volume in the two replicas is normal, if yes, execute step S44, otherwise execute step S45;

[0116] Step S44. Preferentially read the data to be read from the replica in the raidx logical volume;

[0117] Step S45. Read the data to be read from the replica in the raid0 logical volume.

[0118] Since the read and write performance of the raidx logical volume is usually higher than that of the raid0 logical volume, the present application preferentially uses the replica in the raidx logical volume for reading and writing, which can improve the overall read and write performance of the distributed storage cluster.

[0119] The main purpose of the present application is to solve the technical problem of data integrity, reliability and security of the distributed storage cluster adopting the two-copy storage strategy in the case of simultaneous failure of two physical disks. The following analyzes and explains the protection effect of the present application on data integrity and security in different cases of simultaneous failure of two physical disks.

[0120] Case 1: In the case of two simultaneously failed or damaged physical disks in the volume of the raid0 storage pool, only one of the two copies of the same data block Chunk can be damaged, because there is another copy in the raidx storage pool, which can guarantee data integrity and security. After repairing or replacing the failed or damaged physical disk, the distributed storage cluster can recover the damaged copy data through the data recovery function.

[0121] Case 2: In the case of two simultaneously failed or damaged physical disks in the volume of the raidx storage pool, only one of the two copies of the same data block Chunk can be damaged, because there is another copy in the raid0 storage pool. If the two damaged physical disks are in different volumes of the raidx storage pool, the recovery mechanism of raid5 itself can guarantee the recovery of the copy, and the data recovery processing of the distributed storage cluster level is not needed. If the two damaged physical disks are in the same logical volume of the raidx storage pool, for example, two physical disks in a raid5 array fail or are damaged at the same time, in this case, the damaged copy data cannot be recovered by raid5 itself, and the damaged copy in the raid5 logical volume needs to be recovered using the undamaged copy in the raid0 storage pool through the data recovery function of the distributed storage cluster.

[0122] Case 3: When two simultaneously failed or damaged physical disks are in raid0 and raidx storage pools, as long as the two copies of the same data block Chunk are not in the two physical disks at the same time, the protection effect of the copy is the same as the previous two cases. If the two copies of the same data block Chunk are in the two damaged physical disks, although the copy in the raid0 storage pool is damaged, the copy in the raidx storage pool can still be recovered based on the redundancy protection mechanism of raidx, so that the copy in the raidx storage pool is available, and the distributed storage cluster can recover the damaged copy in the raid0 storage pool using the copy in the raidx storage pool through the data recovery function of the cluster, thereby guaranteeing the data integrity and security of the cluster level.

[0123] Through the above analysis, it can be known that, by using the copy mechanism of the distributed storage cluster and the recovery ability of the hardware itself of the raid card, theoretically, any two physical disks in the cluster can be simultaneously tolerated to fail or be damaged, thereby guaranteeing the data integrity and security of the distributed storage cluster.

[0124] From the perspective of the distributed storage cluster, in the case of using a two-copy storage strategy, i.e. a two-copy mechanism, one of the two copies is stored in a raid0 volume and the other copy is stored in a raidx volume, and in the case of using the raidx logical volume to read and write copy data preferentially, the data read and write performance of the distributed storage cluster is superior to that of a storage mechanism using two or more copies without raid.

[0125] In order to guarantee data consistency, the distributed storage cluster usually has two ways when writing data, one is a strong consistency way, which requires that the two copies are written completely before returning the write result; the other is a weak consistency way, which returns the write result after writing one of the two copies, and this way sacrifices the strong consistency to improve the write performance.

[0126] The technical solution of the present application can also use the above two ways, and in the preferred embodiment of the present application, in order to exert the read and write performance of the raidx logical volume, the copy in the raidx logical volume is read or written preferentially when reading and writing data, and the writing of the copy in the raid0 logical volume is performed after the writing of the copy in the raidx logical volume is completed. Of course, the strong consistency mode can also be used, and the write result is returned after the writing of the two copies is completed, which only slightly reduces the write performance and does not affect the realization of the purpose of the present application. For example, since raid5 is composed of multiple physical disks and raid0 is composed of one physical disk, the reliability and read and write performance of the copy in the raid5 volume are higher than those of the raid0 copy, the performance of returning after writing the raid5 copy is higher than that of the strong consistency mechanism, and the high reliability is higher than that of the weak consistency.

[0127] Figure 5 The electronic device structure schematic diagram for implementing the method steps performed by the storage engine in the distributed storage cluster provided by the present application is provided for an embodiment of the present application, and the device 500 comprises a processor 510 such as a central processing unit (CPU), a communication bus 520, a communication interface 540 and a storage medium 530. The processor 510 and the storage medium 530 can communicate with each other through the communication bus 520. The storage medium 530 stores a computer program, and when the computer program is executed by the processor 510, the function of one or more steps in the method steps performed by the storage engine provided by the present application can be realized.

[0128] The storage medium can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. In addition, the storage medium can also be at least one storage device located away from the aforementioned processor. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0129] The physical disks used for creating the raid0 or raidx logical volume in the distributed storage cluster mentioned in the embodiments of the present application are only an example of the storage medium constituting the storage array, and in addition to the disk, it can also be an optical disk, a solid state disk, etc. The present application is not limited.

[0130] It should be appreciated that embodiments of the present application can be realized or implemented by computer hardware, a combination of hardware and software, or through computer instructions stored in a non-transitory storage medium. The method can be implemented in a computer program configured with a non-transitory storage medium using standard programming techniques, including a non-transitory storage medium configured with a computer program, wherein the storage medium thus configured causes the computer to operate in a specific and predefined manner. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, the program can run on a special-purpose integrated circuit programmed for this purpose. Furthermore, the operations of the processes described in the present application can be performed in any suitable order unless otherwise indicated or otherwise apparent from the context to be contrary. The processes described in the present application (or variations and / or combinations thereof) can be executed under the control of one or more computer systems configured with executable instructions and can be implemented as code (e.g., executable instructions, one or more computer programs or one or more applications) executed collectively on one or more processors, by hardware or a combination thereof. The computer program includes a plurality of instructions executable by one or more processors.

[0131] Further, the methods can be implemented in any type of computing platform operably connected to a suitable computing platform, including but not limited to a personal computer, mini-computer, mainframe, workstation, network or distributed computing environment, separate or integrated computer platforms, or in communication with charged particle tools or other imaging devices, and the like. Aspects of the present application can be implemented in machine readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage media, RAM, ROM, and the like, such that it can be read by a programmable computer to configure and operate the computer to perform the processes described herein when the storage medium or device is read by the computer. In addition, the machine readable code, or portions thereof, can be transmitted over wired or wireless networks. The present application includes these and other different types of non-transitory computer readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The present application also includes the computer itself when programmed according to the methods and techniques described herein.

[0132] The above description is only the preferred embodiment of the present application but not intended to limit the present application. The present application can be modified and changed by those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A distributed storage cluster two-copy storage method, characterized by, The method is applied to a distributed storage cluster having multiple storage nodes; The distributed storage cluster adopts a 2-copy replica storage strategy; The distributed storage cluster has two types of disk redundancy array (RAID) storage pools, one being a RAID0 storage pool composed of RAID0 logical volumes, and the other being a RAIDx storage pool composed of RAIDx logical volumes; The two copies of the same data block Chunk of the distributed storage cluster are respectively stored in different types of RAID logical volumes on different storage nodes.

2. The method of claim 1, wherein, When the storage engine of the distributed storage cluster receives a data write request, the storage engine writes data in the following steps: The storage engine finds the metadata of the data block to be written, and obtains the storage locations of the two copies corresponding to the data block; The storage engine obtains the RAID volume type and the current state of the logical volume of the two copies, and determines whether the state of the RAIDx logical volume in the logical volume of the two copies is normal; When the state of the RAIDx logical volume is normal, the storage engine preferentially writes the data to be written to the copy in the RAIDx logical volume. When the storage engine of the distributed storage cluster receives a data read request, the storage engine reads data in the following steps:

3. The method of claim 1, wherein, The storage engine finds the metadata of the data block to be read, and obtains the storage locations of the two copies corresponding to the data block; The storage engine obtains the RAID volume type and the current state of the logical volume of the two copies, and determines whether the state of the RAIDx logical volume in the logical volume of the two copies is normal; When the state of the RAIDx logical volume is normal, the storage engine preferentially reads the data to be read from the copy in the RAIDx logical volume.

4. The method of any one of claims 1 to 3, wherein: The RAIDx logical volume is a logical volume created based on a RAID3, RAID5, RAID6, or higher redundancy disk redundancy array.

5. A distributed storage cluster, comprising: The distributed storage cluster has multiple storage nodes; The distributed storage cluster adopts a 2-copy replica storage strategy; The distributed storage cluster has two types of disk redundancy array (RAID) storage pools, one being a RAID0 storage pool composed of RAID0 logical volumes, and the other being a RAIDx storage pool composed of RAIDx logical volumes; The two copies of the same data block Chunk of the distributed storage cluster are respectively stored in different types of RAID logical volumes on different storage nodes.

6. The distributed storage cluster of claim 5, wherein: When the storage engine of the distributed storage cluster receives a data write request, the storage engine finds the metadata of the data block to be written, and obtains the storage locations of the two copies corresponding to the data block; The storage engine obtains the RAID volume type and the current state of the logical volume of the two copies, and determines whether the state of the RAIDx logical volume in the logical volume of the two copies is normal; ​ ​ When the state of the raidx logical volume is normal, the storage engine preferentially writes the to-be-written data to the replica in the raidx logical volume.

7. The distributed storage cluster of claim 5, wherein, When the storage engine of the distributed storage cluster receives a data read request, the storage engine finds metadata of a data block where the to-be-read data is located, and obtains storage locations of two replicas corresponding to the data block; The storage engine obtains raid volume types and current states of logical volumes where the two replicas are located, and determines whether the state of a raidx logical volume in the logical volumes is normal; When the state of the raidx logical volume is normal, the storage engine preferentially reads the to-be-read data from the replica in the raidx logical volume.

8. The distributed storage cluster of any one of claims 5 to 7, wherein, The raidx logical volume is a logical volume created based on a raid3, raid5, raid6 or higher redundancy disk redundancy array.

9. A storage engine of a distributed storage cluster, characterized in that, The distributed storage cluster has two types of raid storage pools, one of which is a raid0 storage pool composed of raid0 logical volumes, and the other of which is a raidx storage pool composed of raidx logical volumes; two replicas of the same data block Chunk of the distributed storage cluster are respectively stored in different types of raid logical volumes on different storage nodes; The storage engine comprises: a write module configured to, when receiving a data write request, find metadata of a first data block where to-be-written data is to be written, obtain storage locations of a first replica and a second replica corresponding to the first data block, obtain raid volume types and current states of logical volumes where the first replica and the second replica are located, determine whether the state of a raidx logical volume in the logical volumes is normal, and preferentially write the to-be-written data to the replica in the raidx logical volume when the state of the raidx logical volume is normal; a read module configured to, when receiving a data read request, find metadata of a second data block where to-be-read data is located, obtain storage locations of a third replica and a fourth replica corresponding to the second data block, obtain raid volume types and current states of logical volumes where the third replica and the fourth replica are located, determine whether the state of a raidx logical volume in the logical volumes is normal, and preferentially read the to-be-read data from the replica in the raidx logical volume when the state of the raidx logical volume is normal.

10. An electronic device, comprising: The apparatus comprises a processor, a communication interface, a storage medium and a communication bus, wherein the processor, the communication interface and the storage medium complete communication with each other through the communication bus; The storage medium is configured to store a computer program; The processor is configured to execute the computer program stored on the storage medium to implement the method steps of any one of claims 1 to 3.

Citation Information

Patent Citations

  • Active-active storage system and data processing method thereof

    CN114089923A

  • Synchronized flashcopy backup restore of a raid protected array

    US20160203055A1