Storage cluster management method, device, electronic device and storage medium

By obtaining the hash area information and the mapping relationship between the storage nodes, establishing the logical hash area and the storage nodes mapping, solving the problem of inflexible hash ring management, and achieving flexible hash ring management and efficient operation and maintenance.

CN114816225BActive Publication Date: 2025-08-19BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110121766.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-28
Publication Date
2025-08-19
Estimated Expiration
2041-01-28

AI Technical Summary

Technical Problem

In the prior art, the hash value of the machine is not easy to modify, resulting in inflexible management of the hash ring and machine, and inconvenient operation and maintenance.

Method used

By obtaining the mapping relationship between the hash area information and the storage node, a mapping between the hash area and the storage node is established, information is sent to the storage node to create metadata and form a copy, and a logical hash area is used to map the storage node.

Benefits of technology

It realizes flexible hash ring management, which is convenient for maintenance and modification, avoids inconvenience in hash ring and machine management, and improves operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816225B_ABST
    Figure CN114816225B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose a method, device, server and storage medium for managing a storage cluster, the method comprising: obtaining information of a hash area, the hash area being an area divided on a hash ring, the information of the hash area including a hash value of a starting point and a hash value of an end point of the hash area; obtaining a mapping relationship between a hash area and a storage node; establishing a mapping between the hash area and the storage node according to the mapping relationship; the establishing of a mapping between the hash area and the storage node according to the mapping relationship comprises: sending information of the mapped hash area to the storage node, so that the storage node stores the information as metadata and creates a copy of the hash area, the copy of the hash area being used to store data corresponding to the hash area. The storage cluster management method maps storage nodes through logical hash areas, and this mapping relationship is flexible and easy to maintain and modify.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to a storage cluster management method, a storage cluster management device, an electronic device, and a storage medium. Background Art

[0002] In the prior art, in order to map a machine to a hash ring, the specific method is: first calculate the hash value of the machine, for example, the hash value of the machine's IP address can be calculated as the hash value of the machine, and then map the machine to the hash ring through the machine's hash value, that is, it divides the hash ring through the machine's hash value. However, since the hash value of the machine is not easy to modify, the management of the hash ring and the machine is not flexible enough, and it is inconvenient for operation and maintenance. Summary of the Invention

[0003] One objective of the present disclosure is to provide a new technical solution for managing a storage cluster.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for managing a storage cluster is provided. The storage cluster includes multiple storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster. The method is applied to the management node and includes:

[0005] Obtain information about a hash region, where the hash region is a region divided on a hash ring, and the information about the hash region includes a hash value of a starting point and a hash value of an ending point of the hash region;

[0006] Get the mapping relationship between hash areas and storage nodes;

[0007] Establishing a mapping between the hash area and the storage node according to the mapping relationship;

[0008] The mapping between the hash area and the storage node is established according to the mapping relationship, including: sending information of the mapped hash area to the storage node, so that the storage node stores the information as metadata and creates a copy of the hash area, and the copy of the hash area is used to store the data corresponding to the hash area.

[0009] Optionally, after obtaining the mapping relationship between the hash area and the storage node, the method further includes:

[0010] The information of the hash area and the mapping relationship are sent to a client outside the storage cluster so that the client can read and write data.

[0011] Optionally, obtaining a mapping relationship between a hash region and a storage node includes:

[0012] Generate a mapping relationship between hash areas and storage nodes based on preset mapping conditions;

[0013] The mapping condition includes: each hash region maps at least three different storage nodes.

[0014] Optionally, after establishing a mapping between the hash area and the storage node according to the mapping relationship, the method further includes:

[0015] The information of all storage nodes mapped to the same hash area is sent to each storage node of the hash area, so that the copies of the same hash area form a copy cluster based on the master-slave mechanism.

[0016] Optionally, after establishing a mapping between the hash area and the storage node according to the mapping relationship, the method further includes:

[0017] Acquire a hash region mapped to a target storage node as a target hash region; wherein the target storage node is a storage node whose data volume exceeds a set data volume threshold;

[0018] Establishing a mapping between the target hash region and a storage node newly added to the storage cluster;

[0019] Unmap the target storage node from the target hash region.

[0020] Optionally, after establishing a mapping between the hash area and the storage node according to the mapping relationship, the method further includes:

[0021] Obtain range information of multiple second hash regions split from the first hash region;

[0022] A split instruction is issued to the first storage node so that the first storage node splits the copy of the first hash area into multiple copies of the second hash area according to the split instruction and modifies the metadata of the first storage node. The split instruction contains the range information of the second hash area, and the first storage node is the storage node corresponding to the first hash area.

[0023] Optionally, after sending the split instruction to the first storage node, the method further includes:

[0024] Establishing a mapping between the second hash region and the second storage node;

[0025] Unmap the second hash region from the first storage node.

[0026] Optionally, after establishing the mapping between the hash area and the storage node according to the mapping relationship, the method further includes:

[0027] receiving a merge instruction, wherein the merge instruction is used to merge a plurality of consecutive hash regions;

[0028] Establish a mapping between the merged hash area and the storage node;

[0029] Unmap the hash regions before merging.

[0030] According to a second aspect of an embodiment of the present disclosure, a data storage method for a storage cluster is provided. The storage cluster includes storage nodes and at least one management node, the management node being used to manage the storage nodes in the storage cluster. The method is applied to the storage nodes and includes:

[0031] Obtaining information of the corresponding hash region from the management node, storing the information as metadata and creating a copy of the hash region;

[0032] receiving data to be stored, and determining whether the data is data in the hash area according to the metadata;

[0033] In the case of data in the hash area, the data to be stored is added to the corresponding copy.

[0034] Optionally, after obtaining information of the corresponding hash region from the management node, storing the information as metadata, and creating a copy of the hash region, the method further includes:

[0035] The replica is controlled to join the replica cluster corresponding to the hash area, and the replica cluster adopts a master-slave mechanism.

[0036] According to a third aspect of an embodiment of the present disclosure, a data storage method for a storage cluster is provided, wherein the storage cluster includes multiple storage nodes and at least one management node, the management node being used to manage the storage nodes in the storage cluster. The method is applied to a client outside the storage cluster, and includes:

[0037] Obtaining information and mapping relationships of hash regions from the management node;

[0038] Determining a hash region corresponding to the data according to a hash value of the identifier of the data;

[0039] Determine the storage node to which the hash area is mapped according to the mapping relationship;

[0040] The data is sent to the storage node for storage.

[0041] According to a fourth aspect of an embodiment of the present disclosure, a management device for a storage cluster is provided, wherein the storage cluster includes multiple storage nodes and at least one management node, the management node being configured to manage the storage nodes in the storage cluster. The device is applied to the management node and includes:

[0042] A first acquisition module is configured to acquire information about a hash region, where the hash region is a region divided on a hash ring, and the information about the hash region includes a hash value of a starting point and a hash value of an ending point of the hash region;

[0043] The second acquisition module is used to obtain the mapping relationship between the hash area and the storage node;

[0044] An establishing module, configured to establish a mapping between the hash region and the storage node according to the mapping relationship;

[0045] The establishment module is specifically used to send information of the mapped hash area to the storage node, so that the storage node stores the information as metadata and creates a copy of the hash area, and the copy of the hash area is used to store data corresponding to the hash area.

[0046] According to a fifth aspect of an embodiment of the present disclosure, a data storage device of a storage cluster is provided, wherein the storage cluster includes storage nodes and at least one management node, the management node being configured to manage the storage nodes in the storage cluster, the device being applied to the storage nodes, and comprising:

[0047] A third acquisition module is used to obtain information of the corresponding hash area from the management node, store it as metadata and create a copy;

[0048] a receiving module, configured to receive data to be stored and determine whether the data is data in the hash area according to the metadata;

[0049] A storage module is used to add the data to be stored to the corresponding copy when the data is in the hash area.

[0050] According to a sixth aspect of an embodiment of the present disclosure, a data storage device of a storage cluster is provided, wherein the storage cluster includes multiple storage nodes and at least one management node, the management node being configured to manage the storage nodes in the storage cluster. The device is applied to a client outside the storage cluster, and includes:

[0051] A fourth acquisition module, configured to acquire information and mapping relationships of hash regions from the management node;

[0052] A first determining module, configured to determine a hash region corresponding to the data according to a hash value of the data identifier;

[0053] A second determining module, configured to determine the storage node to which the hash region is mapped according to the mapping relationship;

[0054] A sending module is used to send the data to the storage node for storage.

[0055] According to the seventh aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the methods described in the first, second and third aspects above.

[0056] According to an eighth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to the first, second and third aspects above is implemented.

[0057] According to the storage cluster management method, device, electronic device and storage medium of the embodiment of the present disclosure, the management node in the storage cluster obtains the information of the hash area and the mapping relationship between the hash area and the storage node, and then establishes the mapping between the hash area and the storage node based on the mapping relationship. That is, the embodiment of the present disclosure maps the storage node through the logical hash area. This mapping relationship is flexible and easy to maintain and modify.

[0058] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0060] Figure 1 is a block diagram of a hardware configuration of an electronic device that can be used to implement an embodiment of the present disclosure;

[0061] Figure 2 is a schematic flow chart of a storage cluster management method according to an embodiment of the present disclosure;

[0062] Figure 3 is a schematic diagram of the structure of a storage cluster according to an embodiment of the present disclosure;

[0063] Figure 4 is a schematic diagram of the structure of a hash ring according to an embodiment of the present disclosure;

[0064] Figure 5 is a schematic diagram of the structure of a hash ring according to another embodiment of the present disclosure;

[0065] Figure 6 is a schematic diagram of the structure of a hash ring according to the third embodiment of the present disclosure;

[0066] Figure 7 is a schematic flow chart of a data storage method of a storage cluster according to an embodiment of the present disclosure;

[0067] Figure 8 is a schematic flow chart of a data storage method of a storage cluster according to another embodiment of the present disclosure;

[0068] Figure 9 is a principle block diagram of a storage cluster management device according to an embodiment of the present disclosure;

[0069] Figure 10 is a principle block diagram of a data storage device of a storage cluster according to an embodiment of the present disclosure;

[0070] Figure 11 is a principle block diagram of a data storage device of a storage cluster according to another embodiment of the present disclosure;

[0071] Figure 12 is a principle block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0072] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.

[0073] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0074] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0075] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0076] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0077] <Hardware Configuration>

[0078] Figure 1FIG. 1 shows a hardware configuration of an electronic device 1000 that can be used to implement an embodiment of the present disclosure.

[0079] In one example, the electronic device 1000 may be a node in a storage cluster, such as a management node in the storage cluster or a storage node in the storage cluster. In addition, the node is typically a server, which may be a virtual machine or a physical machine.

[0080] In another example, the electronic device 1000 may also be a client outside the storage cluster.

[0081] like Figure 1 As shown, electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. Processor 1100 may be a central processing unit (CPU), a microprocessor (MCU), or the like. Memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), or a non-volatile memory such as a hard disk. Interface device 1300 may include, for example, a USB interface or a headphone jack. Communication device 1400 may be capable of wired or wireless communication. Display device 1500 may be, for example, an LCD display or a touchscreen display. Input device 1600 may include, for example, a touchscreen or a keyboard. A user may input / output voice information through speaker 1700 and microphone 1800.

[0082] Despite Figure 1 Although multiple devices are shown for the electronic device 1000 , the present disclosure may only involve some of the devices. For example, the electronic device 1000 only involves the memory 1200 and the processor 1100 .

[0083] In the embodiments of the present disclosure, the memory 1200 of the electronic device 1000 is used to store instructions, and the instructions are used to control the processor 1100 to execute the method provided by the embodiments of the present disclosure.

[0084] In the above description, a person skilled in the art can design instructions according to the solution disclosed in the present invention. How instructions control the operation of a processor is well known in the art and will not be described in detail here.

[0085] In an embodiment of the present disclosure, a storage cluster may include several nodes (server nodes), wherein the several nodes include multiple storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster, and other nodes except the management node are storage nodes.

[0086] <Method Example 1>

[0087] This embodiment provides a storage cluster management method, which is implemented, for example, by a management node in the storage cluster.

[0088] In this embodiment, the storage cluster may be a server cluster, which includes multiple storage nodes and at least one management node, and the management node is used to manage the storage nodes in the storage cluster. In addition, the structure of the storage cluster provided in this embodiment may be as follows: Figure 3 As shown, it includes one management node and four storage nodes. Of course, it can also be as follows Figure 4 As shown, it includes three management nodes, wherein the management method of the storage cluster can be implemented by any one of the three management nodes, and the management node as the implementation subject can be voted out by the three management nodes. Data backup can be performed between the management node as the implementation subject and the other two management nodes to avoid the management node as the implementation subject from crashing. The other two management nodes can re-elect the management node as the implementation subject, and the elected management node can continue to execute the management method of the storage cluster.

[0089] Figure 2 FIG. 1 is a flow chart of a storage cluster management method according to an embodiment of the present disclosure, such as Figure 2 As shown, the method may include the following steps S2100 to S2300:

[0090] Step S2100, obtain information of the hash area.

[0091] A hash region is typically a region demarcated on a hash ring. Information about the hash region includes the hash values of the region's starting and ending points. The hash value is calculated using a hash algorithm, such as, but not limited to, the MD5 message digest algorithm, the Digital Signature Algorithm (DSA), and the PBKDF2 algorithm.

[0092] The hash ring can be a consistent hash ring, which uses a consistent hash algorithm to organize the entire hash value space into a virtual ring. The structure of the hash ring provided in this embodiment is as follows: Figure 4 shown.

[0093] In this embodiment, the hash area can be an area divided by dividing the hash ring into equal parts. For example, Figure 4The hash ring shown is evenly divided into four parts, namely, hash region R1, hash region R2, hash region R3 and hash region R4. Among them, the hash value of the starting point of the hash region R1 can be (1), and the hash value of the ending point can be (2), the hash value of the starting point of the hash region R2 can be (2), and the hash value of the ending point can be (3), the hash value of the starting point of the hash region R3 can be (3), and the hash value of the ending point can be (4), and the hash value of the starting point of the hash region R4 can be (4), and the hash value of the ending point can be (1).

[0094] After obtaining the information of the hash area, enter:

[0095] Step S2200: Obtain the mapping relationship between the hash area and the storage node.

[0096] The mapping relationship may be stored in a mapping relationship table, which includes a plurality of mapping data, wherein one mapping data piece is a mapping relationship between information of a hash region and an identifier of its corresponding storage node.

[0097] In this embodiment, obtaining the mapping relationship between the hash area and the storage node in step S2200 may further include: generating the mapping relationship between the hash area and the storage node according to a preset mapping condition.

[0098] The preset mapping condition includes: each hash region maps to at least three different storage nodes.

[0099] by Figure 4 The hash ring shown is divided into hash region R1, hash region R2, hash region R3 and hash region R4, and Figure 3 Taking the storage node d, storage node e, storage node f and storage node g shown as examples, the above mapping relationship table includes, for example, multiple mapping data corresponding to multiple mapping relationships, wherein one mapping data may be: the information of the hash area R1 and the identifier of the storage node d, the identifier of the storage node e and the identifier of the storage node f, one mapping data may be: the information of the hash area R2 and the identifier of the storage node e, the identifier of the storage node f and the identifier of the storage node g, one mapping data may be: the information of the hash area R3 and the identifier of the storage node d, the identifier of the storage node e and the identifier of the storage node g, and one mapping data may be: the information of the hash area R4 and the identifier of the storage node d, the identifier of the storage node f and the identifier of the storage node g.

[0100] After obtaining the mapping relationship between the hash area and the storage node, enter:

[0101] Step S2300: Establish a mapping between the hash area and the storage node according to the mapping relationship.

[0102] In this embodiment, establishing a mapping between the hash region and the storage node according to the mapping relationship in step S2300 may further include:

[0103] The information of the mapped hash area is sent to the storage node so that the storage node stores the information as metadata and creates a copy of the hash area.

[0104] The copies of the above hash areas are used to store the data corresponding to the hash areas, and a copy of a hash area includes a set of data corresponding to the hash area.

[0105] Exemplarily, the information of the mapped hash region R1, the information of the hash region R3 and the information of the hash region R4 may be sent to the storage node d, so that the storage node d stores the information of the hash region R1, the information of the hash region R3 and the information of the hash region R4 as metadata and creates a copy of the hash region R1, a copy of the hash region R3 and a copy of the hash region R4. It can be understood that the metadata of the storage node d contains the hash value of the starting point and the hash value of the end point of the storage node d and the mapped hash region R1, the hash value of the starting point and the hash value of the end point of the hash region R3, and the hash value of the starting point and the hash value of the end point of the hash region R4.

[0106] The information of the mapped hash region R1, hash region R2 and hash region R3 may be sent to the storage node e so that the storage node e stores the information of the hash region R1, hash region R2 and hash region R3 as metadata and creates a copy of the hash region R1, a copy of the hash region R2 and a copy of the hash region R3.

[0107] Regarding how storage node e, storage node f, and storage node g store information as metadata and create copies of hash areas, please refer to the above introduction to storage node d, which will not be repeated here in this embodiment.

[0108] According to the storage cluster management method of the embodiment of the present disclosure, the management node in the storage cluster will obtain the information of the hash area and the mapping relationship between the hash area and the storage node, and then establish the mapping between the hash area and the storage node based on the mapping relationship. That is, the embodiment of the present disclosure maps the storage node through the logical hash area. This mapping relationship is flexible and easy to maintain and modify.

[0109] In one embodiment, after performing the steps of obtaining the hash region information in step S2100 and obtaining the mapping relationship between the hash region and the storage node in step S2200, the storage cluster management method further includes:

[0110] The hash area information and mapping relationship are sent to the client outside the storage cluster for the client to read and write data.

[0111] Exemplarily, the information of hash region R1 and the mapping relationship between hash region R1 and storage node d, storage node e and storage node f may be sent to the client, the information of hash region R2 and the mapping relationship between hash region R2 and storage node e, storage node f and storage node g may be sent to the client, the information of hash region R3 and the mapping relationship between hash region R3 and storage node d, storage node e and storage node g may be sent to the client, and the information of hash region R4 and the mapping relationship between hash region R4 and storage node d, storage node f and storage node g may be sent to the client to facilitate the client to read and write data. How the client reads and writes data may refer to the following method embodiment 3, which will not be described in detail here.

[0112] In one embodiment, after establishing a mapping between hash regions and storage nodes according to the mapping relationship in step S2300 above, the storage cluster management method may further include:

[0113] The information of all storage nodes mapped to the same hash area is sent to each storage node in the hash area, so that the copies of the same hash area form a copy cluster based on the master-slave mechanism.

[0114] The replica cluster may be a RAFT cluster, and each replica in the RAFT cluster may vote to elect a master replica and a slave replica.

[0115] Exemplarily, the information of storage node d, storage node e and storage node f mapped to hash region R1 may be sent to storage node d, storage node e and storage node f, so that the copies of hash region R1 form a copy cluster based on the master-slave mechanism. For example, there may be a master copy of hash region R1 on storage node d, and slave copies of hash region R1 on storage node e and storage node f. It can be understood that storage node d, storage node e and storage node f all store the identifier of hash region R1, the identifier of other storage nodes except their own storage node, and the identifier of the master-slave copy.

[0116] The explanations of hash regions R2, R3, and R4 are the same as those of hash region R1 above, and are not described in detail in this embodiment.

[0117] According to the method of this embodiment, the information of all storage nodes mapped to the same hash area can be sent to each storage node in the hash area, so that the copies of the same hash area form a copy cluster based on the master-slave mechanism, that is, each storage node can obtain the information of its own storage node and other storage nodes located in the same hash area. Since each storage node has a copy of the hash area, in this way, when the master copy of any hash area goes down, the other slave copies can vote to select a new master copy.

[0118] In one embodiment, after establishing a mapping between hash regions and storage nodes according to the mapping relationship in step S2300 above, the storage cluster management method further includes the following steps S3100 to S3300:

[0119] Step S3100: Obtain the hash area mapped to the target storage node as the target hash area.

[0120] The target storage node is a storage node whose data volume exceeds a set data volume threshold. The set data volume threshold can be a value set according to actual application scenarios and actual needs.

[0121] Taking the target storage node as storage node d as an example, that is, the target storage node d is a storage node whose data volume exceeds the set data volume threshold. At the same time, the hash areas mapped by the storage node d are hash area R1, hash area R3 and hash area R4. Then, any one or more of the hash area R1, hash area R3 and hash area R4 can be used as the target hash area. For example, hash area R1 can be used as the target hash area.

[0122] Step S3200: Establish a mapping between the target hash area and the storage node newly added to the storage cluster.

[0123] Continuing with the example of the target hash region being hash region R1, a mapping between the hash region R1 and the storage node h newly added to the storage cluster can be established according to step S3200.

[0124] Step S3300, unmap the target storage node and the target hash area.

[0125] In this embodiment, unmapping the target storage node and the target hash area in step S3300 may further include: issuing an instruction to the target storage node so that the target storage node deletes the area information and deletes the copy.

[0126] Continuing with the example of the target hash area being hash area R1 and the target storage node being storage node d, the management node can issue instructions to storage node d. After receiving the instructions, storage node d can delete the information of hash area R1 in its own metadata and, at the same time, delete its own copy of hash area R1.

[0127] In this embodiment, for example, the mapping relationship table between the hash region R1 and the storage nodes stored locally and on the client may be updated. The updated mapping relationship table may include information of the hash region R1 and storage nodes e, f, and h.

[0128] According to the method of this embodiment, when a new storage node is introduced into the storage cluster, the hash value of the new storage node will not be directly mapped to the hash ring as in the prior art, but a mapping between the new storage node and the target hash area will be established. That is, the new storage node is not directly bound to the hash value on the hash ring, but is mapped to the new storage node through the logical target hash area, which will not cause SLA jitter.

[0129] At the same time, since the storage node mapped to the target hash area is a storage node with a particularly large amount of data, after mapping the target hash area to a new storage node, the new storage node can recreate a copy of the target hash area, realizing data transfer and further realizing load balancing.

[0130] In one embodiment, after establishing a mapping between hash regions and storage nodes according to the mapping relationship in step S2300 above, the storage cluster management method further includes:

[0131] When any storage node in the hash area crashes, determine whether there is a master copy of the hash area on the crashed storage node; if there is a master copy of the hash area on the crashed storage node, a new master copy is re-elected by other slave copies in the hash area.

[0132] For example, when the storage node d in the hash region R1 crashes, it is first determined whether there is a master copy of the hash region R1 on the storage node d. If there is a master copy of the hash region R1, the master copy is re-elected by other slave copies in the hash region R1.

[0133] Of course, the mapping relationship table between the hash area R1 and the storage node stored locally and on the client can also be updated. Since the original mapping relationship between the storage nodes of the hash area R1 is: the information of the hash area R1 and the storage node d, the storage node e and the storage node f, the updated mapping relationship table can be the information of the hash area R1 and the storage node e and the storage node f.

[0134] According to the method of this embodiment, when any storage node in the hash area goes down, this problem is solved by modifying the logical hash area, and SLA jitter will not be caused.

[0135] In one embodiment, after the mapping between the hash region and the storage node is established according to the mapping relationship in step S2300 above, the storage cluster management method further includes the following steps S4100 to S4200:

[0136] Step S4100: Obtain range information of multiple second hash regions split from the first hash region.

[0137] The first hash region is the hash region to be split.

[0138] In this embodiment, the first hash region can be equally divided according to the target split number to obtain the range of the second hash region. The target split number can be a value set according to the actual application scenario and actual needs, and the target split number can be configured through the configuration interface.

[0139] For example, Figure 5 As shown, taking the first hash region as hash region R1 and the target split number as 2 as an example, the hash region R1 can be equally divided to obtain the second hash region R11 and the second hash region R12, wherein the hash value of the starting point of the second hash region R11 is (1), and the hash value of the ending point is (11); the hash value of the starting point of the second hash region R12 is (11), and the hash value of the ending point is (2).

[0140] Step S4200: Send a split instruction to the first storage node, so that the first storage node splits the copy of the first hash area into multiple copies of the second hash area according to the split instruction and modifies the metadata of the first storage node.

[0141] The split instruction contains range information of the second hash region, and the first storage node is a storage node corresponding to the first hash region.

[0142] Continuing with the above example, since all the storage nodes mapped to the first hash region R1 are storage node d, storage node e, and storage node f, that is, storage node d, storage node e, and storage node f each have a copy of hash region R1, here, the management node will issue a split instruction to storage node d, storage node e, and storage node f. After receiving the split instruction, storage node d, storage node e, and storage node f will split the copy of the first hash region R1 into copies of the second hash region R11 and the second hash region R12. At the same time, they will modify their own metadata based on the range information of the second hash region R11 and the range information of the second hash region R12 in the split instruction. It should be understood that at this time, the data has not been transferred to the second hash region R11 and the second hash region R12 after the split.

[0143] Step S4300: Establish a mapping between the second hash area and the second storage node.

[0144] The second storage node is a storage node that needs to perform data transfer, and the second storage node may be any one or more of the first storage nodes.

[0145] Continuing with the above example, taking the second storage node as storage node d, here, according to this step S4300, a mapping between the second hash region R11 and storage node d is established respectively, and a mapping between the second hash region R12 and storage node d is established.

[0146] Step S4400: unmap the second hash region and the first storage node.

[0147] Unmapping the second hash region and the first storage node in step S4400 may further include: issuing an instruction to the first storage node so that the first storage node deletes the region information and deletes the copy.

[0148] Continuing with the above example, here, the management node can issue instructions to storage node e and storage node f. After receiving the instructions, storage node e and storage node f can delete the region information of the second hash region R11 and the region information of the second hash region R12 in their own metadata, and at the same time, delete the copies of the second hash region R11 and the second hash region R12 stored in their own storage.

[0149] According to the method of this embodiment, when the amount of data in the copy on the first hash area is particularly large, the first hash area will be split and the data will be transferred, so that the data on each hash area is evenly distributed.

[0150] In one embodiment, after establishing a mapping between hash regions and storage nodes according to the mapping relationship in step S2300 above, the storage cluster management method further includes the following steps S5100 to S5300:

[0151] Step S5100, receiving a merge instruction.

[0152] The merge instruction is used to merge multiple consecutive hash regions to obtain a merged hash region.

[0153] For example, Figure 6 As shown, for example, the continuous hash region R1 and hash region R2 may be merged to obtain a merged hash region R21.

[0154] Step S5200: Establish a mapping between the merged hash area and the storage node.

[0155] Continuing with the above example, since all the storage nodes mapped by hash region R1 include storage node d, storage node e, and storage node f, and all the storage nodes mapped by hash region R2 include storage node e, storage node f, and storage node g, for example, according to this step S5200, only the mapping between storage node e and hash region R21, the mapping between storage node f and hash region R21, and the mapping between storage node g and hash region R21 can be established.

[0156] Step S5300: cancel the mapping relationship of the hash area before merging.

[0157] For example, on storage node e and storage node f, the copies of hash region R1 and hash region R2 are merged; on storage node g, the copy on storage node g mapped by hash region R2 is set to a copy of hash region R1 to complete synchronization; then the copies of hash region R1 and hash region R2 are merged, and the copy of hash region R1 on storage node d is deleted.

[0158] According to the method of this embodiment, when the amount of data in any hash region is small, two consecutive hash regions can be merged, thereby making the data in each hash region evenly distributed.

[0159] <Method Example 2>

[0160] This embodiment provides a data storage method for a storage cluster. The storage cluster includes storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster. The method is implemented by the storage nodes in the storage cluster, for example.

[0161] Figure 7 FIG. 1 is a flow chart of a data storage method of a storage cluster according to an embodiment of the present disclosure, such as Figure 7 As shown, the method may include the following steps S7100 to S7300:

[0162] Step S7100: Obtain information of the corresponding hash area from the management node, store it as metadata and create a copy.

[0163] In this embodiment, storage node d is used as the implementation entity. The storage node d will store the acquired information of hash region R1, hash region R3 and hash region R4 as metadata and create a copy of hash region R1, a copy of hash region R3 and a copy of hash region R4.

[0164] The information of the hash area includes the hash value of the starting point and the hash value of the ending point of the hash area.

[0165] Step S7200: Receive data to be stored and determine whether it is data in the hash area based on metadata.

[0166] In this embodiment, the storage engine pre-stores the relationship between the data identifier and the corresponding hash region. The data identifier can be the data key.

[0167] Continuing with the above example, after receiving the data to be stored, storage node d will search its own metadata to see whether the key of the data is bound to the hash area mapped by storage node d.

[0168] Step S7300: In the case of data in a hash area, the data to be stored is added to the corresponding copy.

[0169] Continuing with the above example, when storage node d finds in its own metadata that the key of the data is bound to the hash region R1 mapped by storage node d, it will add the data to the copy of the hash region R1 mapped by storage node d.

[0170] According to the data storage method of the storage cluster of the embodiment of the present disclosure, the storage node will obtain the information of the corresponding hash area from the management node, store the information as metadata and create a copy of the hash area. At the same time, after receiving the data to be stored, the storage node will determine based on the metadata that if it is data of the hash area, the storage node will add the data to be stored to the corresponding copy. That is, when the storage node of the embodiment of the present disclosure determines that the received data is data of the hash area corresponding to itself, the storage node will add the data to the copy of the corresponding hash area to facilitate data maintenance.

[0171] In one embodiment, after obtaining information of the corresponding hash region from the management node, storing the information as metadata, and creating a copy of the hash region, the data storage method of the storage cluster further includes:

[0172] Control the replica to join the replica cluster corresponding to the hash zone.

[0173] The replica cluster above uses a master-slave mechanism, and the replica cluster can be a RAFT cluster. Each replica in the RAFT cluster can vote to elect the master replica and the slave replica.

[0174] In this embodiment, for how to control the replica to join the replica cluster corresponding to the hash area, please refer to the above method embodiment 1, and this embodiment will not be described in detail here.

[0175] <Method Example 3>

[0176] This embodiment provides another data storage method for a storage cluster. The storage cluster includes multiple storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster. The method is implemented by a client outside the storage cluster, for example.

[0177] Figure 8 FIG. 1 is a flow chart of a data storage method of a storage cluster according to an embodiment of the present disclosure, such as Figure 8 As shown, the method may include the following steps S8100 to S8300:

[0178] Step S8100: Obtain hash area information and mapping relationship from the management node.

[0179] Exemplarily, what the client obtains may be the hash value of the starting point and the hash value of the end point of hash region R1, the hash value of the starting point and the hash value of the end point of hash region R2, the hash value of the starting point and the hash value of the end point of hash region R3, and the hash value of the starting point and the hash value of the end point of hash region R4.

[0180] At the same time, the mapping relationship obtained can be: the information of the hash area R1 and the identifier of the storage node d, the identifier of the storage node e and the identifier of the storage node f, a mapping data can be: the information of the hash area R2 and the identifier of the storage node e, the identifier of the storage node f and the identifier of the storage node g, a mapping data can be: the information of the hash area R3 and the identifier of the storage node d, the identifier of the storage node e and the identifier of the storage node g, a mapping data can be: the information of the hash area R4 and the identifier of the storage node d, the identifier of the storage node f and the identifier of the storage node g.

[0181] Step S8200: Determine the hash region corresponding to the data based on the hash value of the data identifier.

[0182] The hash value of the data identifier can also be calculated based on the above hash function.

[0183] Exemplarily, if the client finds that the hash value of the identifier of the data is between the hash value of the starting point and the hash value of the ending point of the hash region R1, it can be determined that the hash region corresponding to the data is the hash region R1.

[0184] Step S8300: Determine the storage node to which the hash area is mapped based on the mapping relationship.

[0185] Illustratively, the client determines that the storage nodes mapped to the hash region R1 are storage node d, storage node e, and storage node f based on the mapping relationship obtained in the above step S8100.

[0186] Step S8400: Send data to a storage node for storage.

[0187] Exemplarily, the client sends data to storage node d, storage node e, and storage node f for storage.

[0188] According to the method of the embodiment of the present disclosure, when the client needs to send data for storage, it only needs to obtain the mapping relationship between the hash area and the storage node, and the information of the hash area from the management node, and determine the hash area corresponding to the data based on the hash value of the data identifier, and determine the storage node mapped to the hash area based on the mapping relationship, and then send the data to the storage node for storage, so as to facilitate data maintenance.

[0189] <Device Example 1>

[0190] In this embodiment, a storage cluster management device is also provided. The storage cluster includes multiple storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster. The device is applied to the management node, such as Figure 9 As shown, the apparatus 9000 may include a first acquisition module 9100 , a second acquisition module 9200 and an establishment module 9300 .

[0191] The first acquisition module 9100 is used to obtain information of a hash area, where the hash area is an area divided on the hash ring.

[0192] The information of the hash area includes a hash value of a starting point and a hash value of an ending point of the hash area.

[0193] The second acquisition module 9200 is used to obtain the mapping relationship between the hash area and the storage node.

[0194] Establishing module 9300, used to establish a mapping between hash areas and storage nodes according to the mapping relationship.

[0195] In one embodiment, the establishment module 9300 may include a sending unit and a creation unit (not shown in the figure), wherein the sending unit is used to send information of its mapped hash area to the storage node, so that the storage node stores the information as metadata through the creation unit and creates a copy of the hash area, and the copy of the hash area is used to store the data corresponding to the hash area.

[0196] In one embodiment, the device 9000 also includes a sending module (not shown in the figure). After the second acquisition module 9200 obtains the mapping relationship between the hash area and the storage node, the sending module is used to send the information of the hash area and the mapping relationship to the client outside the storage cluster for the client to read and write data.

[0197] In one embodiment, when acquiring the mapping relationship between the hash region and the storage node, the second acquisition module 9200 may be used to generate a mapping relationship between the hash region and the storage node according to a preset mapping condition.

[0198] The mapping condition includes: each of the hash regions maps to at least three different storage nodes.

[0199] In one embodiment, after the establishment module 9300 establishes the mapping between the hash area and the storage node according to the mapping relationship, the sending module is also used to send the information of all storage nodes mapped by the same hash area to each storage node of the hash area, so that the copies of the same hash area form a replica cluster based on the master-slave mechanism.

[0200] In one embodiment, the device 9000 also includes a new module (not shown in the figure). After the establishment module 9300 establishes the mapping between the hash area and the storage node according to the mapping relationship, the new module is used to: obtain the hash area mapped to the target storage node as the target hash area; establish a mapping between the target hash area and the storage node newly added to the storage cluster; and unmap the target storage node and the target hash area.

[0201] The target storage node is the storage node whose data volume exceeds the set data volume threshold.

[0202] In one embodiment, the device 9000 also includes a splitting module (not shown in the figure). After the establishment module 9300 establishes the mapping between the hash area and the storage node according to the mapping relationship, the splitting module is used to: obtain the range information of multiple second hash areas split from the first hash area; send a splitting instruction to the first storage node, so that the first storage node splits the copy of the first hash area into multiple copies of the second hash area according to the splitting instruction and modifies the metadata of the first storage node.

[0203] The split instruction contains range information of the second hash area, and the first storage node is the storage node corresponding to the first hash area.

[0204] In one embodiment, the split module may include a creation unit and a removal unit (not shown in the figure), wherein the creation unit is configured to create a mapping between the second hash region and the second storage node, and the removal unit is configured to remove the mapping between the second hash region and the first storage node.

[0205] In one embodiment, the device 9000 also includes a merging module (not shown in the figure). After the establishment module 9300 establishes the mapping between the hash area and the storage node according to the mapping relationship, the merging module is used to receive a merging instruction; establish a mapping between the merged hash area and the storage node; and cancel the mapping relationship of the hash area before the merge.

[0206] The merge instruction is used to merge multiple consecutive hash regions.

[0207] <Device Example 2>

[0208] In this embodiment, a data storage device for a storage cluster is also provided. The storage cluster includes storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster. The device is applied to the storage node, such as Figure 10 As shown, the device 10000 may include a third acquisition module 10100 , a receiving module 10200 and a storage module 10300 .

[0209] The third acquisition module 10100 is used to obtain information of the corresponding hash area from the management node, store it as metadata and create a copy.

[0210] The receiving module 10200 is used to receive the data to be stored and determine whether it is the data in the hash area based on the metadata.

[0211] The storage module 10300 is used to add the data to be stored to the corresponding copy in the case of data in the hash area.

[0212] In one embodiment, the device 10000 also includes a joining module (not shown in the figure). After the third acquisition module 10100 obtains the information of the corresponding hash area from the management node, stores the information as metadata and creates a copy of the hash area, the joining module is used to control the copy to join the replica cluster corresponding to the hash area, and the replica cluster adopts a master-slave mechanism.

[0213] <Device Example 3>

[0214] In this embodiment, a data storage device of a storage cluster is also provided. The storage cluster includes storage nodes and at least one management node. The management node is used to manage the storage nodes in the storage cluster. The device is applied to a client outside the storage cluster, such as Figure 11 As shown, the apparatus 11000 may include a fourth acquisition module 11100 , a first determination module 11200 , a second determination module 11300 and a sending module 11400 .

[0215] The fourth acquisition module 11100 is configured to acquire information and mapping relationships of hash regions from the management node.

[0216] The first determining module 11200 is configured to determine a hash region corresponding to the data according to a hash value of the data identifier.

[0217] The second determination module 11300 is configured to determine the storage node to which the hash area is mapped according to the mapping relationship.

[0218] The sending module 11400 is configured to send the data to the storage node for storage.

[0219] <Electronic Equipment Example>

[0220] An embodiment of the present disclosure provides an electronic device 12000, including a processor 12100 and a memory 12200. The memory 12200 stores computer instructions. When the computer instructions are executed by the processor 12100, the method provided by any of the above embodiments is implemented.

[0221] <Medium Example>

[0222] An embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the method provided in any of the aforementioned embodiments is implemented.

[0223] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0224] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0225] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0226] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0227] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0228] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0229] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0230] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.

[0231] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, their practical applications, or technical improvements in the marketplace, or to enable other persons skilled in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims

1. A storage cluster management method, characterized in that: The storage cluster includes multiple storage nodes and at least one management node, the management node is used to manage the storage nodes in the storage cluster, and the method is applied to the management node, including: Obtain information about a hash region, where the hash region is a region divided on a hash ring, and the information about the hash region includes a hash value of a starting point and a hash value of an ending point of the hash region; Get the mapping relationship between hash areas and storage nodes; Establishing a mapping between the hash area and the storage node according to the mapping relationship; The establishing of a mapping between a hash region and a storage node according to the mapping relationship includes: sending information of the mapped hash region to the storage node, so that the storage node stores the information as metadata and creates a copy of the hash region, wherein the copy of the hash region is used to store data corresponding to the hash region; After establishing the mapping between the hash area and the storage node according to the mapping relationship, the method further includes: Obtain range information of multiple second hash regions split from the first hash region; A split instruction is issued to the first storage node so that the first storage node splits the copy of the first hash area into multiple copies of the second hash area according to the split instruction and modifies the metadata of the first storage node. The split instruction contains the range information of the second hash area, and the first storage node is the storage node corresponding to the first hash area.

2. The method according to claim 1, characterized in that After obtaining the mapping relationship between the hash area and the storage node, the method further includes: The information of the hash area and the mapping relationship are sent to a client outside the storage cluster so that the client can read and write data.

3. The method according to claim 1, wherein The obtaining of the mapping relationship between the hash area and the storage node includes: Generate a mapping relationship between hash areas and storage nodes based on preset mapping conditions; The mapping condition includes: each hash region maps at least three different storage nodes.

4. The method according to claim 3, characterized in that After establishing a mapping between the hash area and the storage node according to the mapping relationship, the method further includes: The information of all storage nodes mapped to the same hash area is sent to each storage node of the same hash area, so that the copies of the same hash area form a copy cluster based on the master-slave mechanism.

5. The method according to claim 1, wherein After establishing a mapping between the hash area and the storage node according to the mapping relationship, the method further includes: Acquire a hash region mapped to a target storage node as a target hash region; wherein the target storage node is a storage node whose data volume exceeds a set data volume threshold; Establishing a mapping between the target hash region and a storage node newly added to the storage cluster; Unmap the target storage node from the target hash region.

6. The method according to claim 1, characterized in that After the split instruction is issued to the first storage node, the method further includes: Establishing a mapping between the second hash region and a second storage node, where the second storage node is any one or more of the first storage nodes; Unmap the storage nodes other than the second storage node in the first storage node and the second hash area.

7. The method according to claim 1, characterized in that After establishing the mapping between the hash area and the storage node according to the mapping relationship, the method further includes: receiving a merge instruction, wherein the merge instruction is used to merge a plurality of consecutive hash regions; Establish a mapping between the merged hash area and the storage node; Unmap the hash regions before merging.

8. A data storage method for a storage cluster, characterized in that: The storage cluster includes storage nodes and at least one management node, wherein the management node is used to manage the storage nodes in the storage cluster. The method is applied to the storage node and includes: Obtaining information of the corresponding hash region from the management node, storing the information as metadata and creating a copy of the hash region; receiving data to be stored, and determining whether the data is data in the hash area according to the metadata; In the case of data in the hash area, adding the data to be stored to the corresponding copy; When the first hash area needs to be split, a split instruction issued by the management node is received, and according to the split instruction, the copy of the first hash area is split into multiple copies of the second hash area and the metadata of the first storage node is modified. The split instruction contains the range information of the second hash area, and the first storage node is the storage node corresponding to the first hash area.

9. The method according to claim 8, characterized in that After obtaining information of the corresponding hash region from the management node, storing the information as metadata, and creating a copy of the hash region, the method further includes: The replica is controlled to join the replica cluster corresponding to the hash area, and the replica cluster adopts a master-slave mechanism.

10. A data storage method for a storage cluster, characterized in that: The storage cluster includes multiple storage nodes and at least one management node, the management node is used to manage the storage nodes in the storage cluster, and the management node is further used to execute the method according to any one of claims 1 to 7, the method being applied to a client outside the storage cluster, comprising: Obtaining information and mapping relationships of hash regions from the management node; Determining a hash region corresponding to the data according to a hash value of the identifier of the data; Determine the storage node to which the hash area is mapped according to the mapping relationship; The data is sent to the storage node for storage.

11. A storage cluster management device, characterized in that: The storage cluster includes multiple storage nodes and at least one management node, the management node is used to manage the storage nodes in the storage cluster, the device is applied to the management node, and the device includes: A first acquisition module is configured to acquire information about a hash region, where the hash region is a region divided on a hash ring, and the information about the hash region includes a hash value of a starting point and a hash value of an ending point of the hash region; The second acquisition module is used to obtain the mapping relationship between the hash area and the storage node; An establishing module, configured to establish a mapping between the hash region and the storage node according to the mapping relationship; The establishment module is specifically used to send information of the mapped hash area to the storage node, so that the storage node stores the information as metadata and creates a copy of the hash area, and the copy of the hash area is used to store data corresponding to the hash area; The establishment module is also used to obtain range information of multiple second hash areas split from the first hash area; send a split instruction to the first storage node, so that the first storage node splits the copy of the first hash area into multiple copies of the second hash area according to the split instruction and modifies the metadata of the first storage node, the split instruction contains the range information of the second hash area, and the first storage node is the storage node corresponding to the first hash area.

12. A data storage device for a storage cluster, characterized in that: The storage cluster includes storage nodes and at least one management node, wherein the management node is used to manage the storage nodes in the storage cluster. The device is applied to the storage node and includes: A third acquisition module is used to obtain information of the corresponding hash area from the management node, store it as metadata and create a copy; a receiving module, configured to receive data to be stored and determine whether the data is data in the hash area according to the metadata; a storage module, configured to add the data to be stored to the corresponding copy when the data is the data in the hash area; The receiving module is also used to receive a split instruction issued by the management node when the first hash area needs to be split, split the copy of the first hash area into multiple copies of the second hash area according to the split instruction and modify the metadata of the first storage node, the split instruction contains the range information of the second hash area, and the first storage node is the storage node corresponding to the first hash area.

13. A data storage device for a storage cluster, characterized in that: The storage cluster includes multiple storage nodes and at least one management node, the management node is used to manage the storage nodes in the storage cluster, and the management node is further used to execute the method according to any one of claims 1 to 7. The device is applied to a client outside the storage cluster, and the device includes: A fourth acquisition module, configured to acquire information and mapping relationships of hash regions from the management node; A first determining module, configured to determine a hash region corresponding to the data according to a hash value of the data identifier; A second determining module, configured to determine the storage node to which the hash region is mapped according to the mapping relationship; A sending module is used to send the data to the storage node for storage.

14. An electronic device, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method according to any one of claims 1 to 10.

15. A computer-readable storage medium, characterized in that A computer program is stored thereon, which implements the method according to any one of claims 1 to 10 when executed by a processor.

Citation Information

Patent Citations

  • Data writing and expansion method and device of distributed caching system

    CN108810041A

  • Device access server cluster method, system, device and storage medium

    CN109040212A

  • Data storage method and device

    CN110968453A