CN114816225A - Management method and device of storage cluster, electronic equipment and storage medium - Google Patents

Management method and device of storage cluster, electronic equipment and storage medium Download PDF

Info

Publication number
CN114816225A
CN114816225A CN202110121766.5A CN202110121766A CN114816225A CN 114816225 A CN114816225 A CN 114816225A CN 202110121766 A CN202110121766 A CN 202110121766A CN 114816225 A CN114816225 A CN 114816225A
Authority
CN
China
Prior art keywords
hash
storage
region
storage node
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110121766.5A
Other languages
Chinese (zh)
Inventor
陈阳志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202110121766.5A priority Critical patent/CN114816225A/en
Publication of CN114816225A publication Critical patent/CN114816225A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses a management method, a device, a server and a storage medium for a storage cluster, wherein the method comprises the following steps: acquiring information of a hash region, wherein the hash region is a region divided on a hash ring, and the information of the hash region comprises a hash value of a starting point and a hash value of an ending point of the hash region; acquiring a mapping relation between a hash area and a storage node; establishing mapping between the hash area and the storage node according to the mapping relation; the establishing of the mapping between the hash region and the storage node according to the mapping relationship comprises: and issuing the information of the hash region mapped by the storage node 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 for storing the data corresponding to the hash region. The management method of the storage cluster maps the storage nodes through the logical hash area, and the mapping relation is flexible and convenient to maintain and modify.

Description

Management method and device of storage cluster, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a management method for a storage cluster, a management apparatus for a storage cluster, an electronic device, and a storage medium.
Background
In the prior art, in order to map a machine onto a hash ring, the specific method is as follows: the hash value of the machine is calculated first, for example, the hash value of the IP address of the machine may be calculated as the hash value of the machine, and the machine is mapped onto the hash ring by the hash value of the machine, that is, the hash ring is split by the hash value of the machine.
Disclosure of Invention
It is an object of the present disclosure to provide a new solution for management of storage clusters.
According to a first aspect of the embodiments of the present disclosure, a management method for a storage cluster is provided, where the storage cluster includes a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the method is applied to the management node, and includes:
acquiring information of a hash region, wherein the hash region is a region divided on a hash ring, and the information of the hash region comprises a hash value of a starting point and a hash value of an ending point of the hash region;
acquiring a mapping relation between a hash area and a storage node;
establishing mapping between the hash area and the storage node according to the mapping relation;
the establishing of the mapping between the hash region and the storage node according to the mapping relationship comprises: and issuing the information of the hash region mapped by the storage node 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 for storing the data corresponding to the hash region.
Optionally, after obtaining the mapping relationship between the hash region and the storage node, the method further includes:
and sending the information of the hash area and the mapping relation to a client outside the storage cluster so as to enable the client to read and write data.
Optionally, the obtaining a mapping relationship between the hash region and the storage node includes:
generating a mapping relation between the hash area and the storage node according to a preset mapping condition;
wherein the mapping condition includes: each hash region maps at least three different storage nodes.
Optionally, after the mapping between the hash region and the storage node is established according to the mapping relationship, the method further includes:
and sending the information of all the 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 copy cluster based on a master-slave mechanism.
Optionally, after the mapping between the hash region and the storage node is established according to the mapping relationship, the method further includes:
acquiring a hash area mapped on a target storage node as a target hash area; the target storage node is a storage node with the data volume exceeding a set data volume threshold;
establishing mapping between the target hash area and a storage node newly added to the storage cluster;
unmapping the target storage node and the target hash region.
Optionally, after the mapping between the hash region and the storage node is established according to the mapping relationship, the method further includes:
obtaining range information of a plurality of second hash regions split by the first hash region;
and issuing a splitting instruction to a first storage node so that the first storage node splits the copy of the first hash region into multiple copies of the second hash regions according to the splitting instruction and modifies metadata of the first storage node, wherein the splitting instruction contains range information of the second hash regions, and the first storage node is a storage node corresponding to the first hash region.
Optionally, after issuing the splitting instruction to the first storage node, the method further includes:
establishing mapping between the second hash area and a second storage node;
unmapping the second hash region and the first storage node.
Optionally, after the mapping between the hash region and the storage node is established according to the mapping relationship, the method further includes:
receiving a merging instruction, wherein the merging instruction is used for merging a plurality of continuous hash areas;
establishing mapping between the merged hash area and the storage node;
and releasing the mapping relation of the hash areas before combination.
According to a second aspect of the embodiments of the present disclosure, there is provided a data storage method for a storage cluster, where the storage cluster includes storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the method is applied to the storage nodes, and includes:
obtaining information of a 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 the data of the hash area according to the metadata;
and adding the data to be stored into the corresponding copy under the condition of the data in the hash area.
Optionally, after the information of the corresponding hash region is acquired from the management node, the information is stored as metadata, and a copy of the hash region is created, the method further includes:
and controlling the copies to be added into the copy cluster corresponding to the Hash area, wherein the copy cluster adopts a master-slave mechanism.
According to a third aspect of the embodiments of the present disclosure, there is provided a data storage method for a storage cluster, where the storage cluster includes a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the method is applied to a client outside the storage cluster, and includes:
acquiring information and a mapping relation of a hash area from the management node;
determining a hash area corresponding to the data according to the hash value of the identifier of the data;
determining a storage node mapped by the hash area according to the mapping relation;
and sending the data to the storage node for storage.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a management apparatus for a storage cluster, where the storage cluster includes a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the apparatus is applied to the management node, and the apparatus includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring information of a hash region, the hash region is a region divided on a hash ring, and the information of the hash region comprises 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 for acquiring the mapping relation between the hash area and the storage node;
the establishing module is used for establishing mapping between the hash area and the storage node according to the mapping relation;
the establishing module is specifically configured to issue 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, where the copy of the hash region is used to store data corresponding to the hash region.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a data storage apparatus of a storage cluster, where the storage cluster includes storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the apparatus is applied to the storage nodes, and the apparatus includes:
a third obtaining module, configured to obtain information of a corresponding hash region from the management node, store the information as metadata, and create a copy;
the receiving module is used for receiving data to be stored and determining whether the data is the data of the hash area according to the metadata;
and the storage module is used for adding the data to be stored into the corresponding copy under the condition of the data in the hash area.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a data storage apparatus of a storage cluster, where the storage cluster includes a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the apparatus is applied to a client outside the storage cluster, and the apparatus includes:
a fourth obtaining module, configured to obtain information of the hash region and a mapping relationship from the management node;
the first determining module is used for determining a hash area corresponding to the data according to the hash value of the identifier of the data;
the second determining module is used for determining the storage node mapped by the hash area according to the mapping relation;
and the sending module is used for sending the data to the storage node for storage.
According to a seventh aspect of embodiments of the present disclosure, there is provided an electronic device comprising a memory for storing computer instructions and a processor for invoking the computer instructions from the memory to perform the method according to the first, second and third aspects above.
According to an eighth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method according to the first, second and third aspects above.
According to the management method, the management device, the electronic device and the storage medium of the storage cluster in the embodiments of the disclosure, the management node in the storage cluster acquires information of the hash area and a mapping relationship between the hash area and the storage node, and further establishes mapping between the hash area and the storage node according to the mapping relationship.
Other features of the present disclosure and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a block diagram of a hardware configuration of an electronic device that may be used to implement embodiments of the present disclosure;
FIG. 2 is a schematic flow chart diagram of a method of managing storage clusters according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a storage cluster according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a hash ring according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a hash ring according to another embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a hash ring according to a third embodiment of the present disclosure;
FIG. 7 is a schematic flow chart diagram of a data storage method of a storage cluster according to an embodiment of the present disclosure;
FIG. 8 is a schematic flow chart diagram of a data storage method of a storage cluster according to another embodiment of the present disclosure;
FIG. 9 is a functional block diagram of a management device of a storage cluster according to an embodiment of the present disclosure;
FIG. 10 is a functional block diagram of a data storage device of a storage cluster according to an embodiment of the present disclosure;
FIG. 11 is a functional block diagram of a data storage device of a storage cluster according to another embodiment of the present disclosure;
FIG. 12 is a functional block diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< hardware configuration >
Fig. 1 illustrates a hardware configuration of an electronic device 1000 that may be used to implement embodiments of the present disclosure.
In an example, the electronic device 1000 may be a node in a storage cluster, for example, a management node in the storage cluster, or a storage node in the storage cluster. In addition, the node is typically a server. Wherein, the server can be a virtual machine or a physical machine.
In another example, the electronic device 1000 may also be a client outside of a storage cluster.
As shown in fig. 1, the 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. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. Communication device 1400 is capable of wired or wireless communication, for example. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, and the like. A user can input/output voice information through the speaker 1700 and the microphone 1800.
Although a number of devices are shown in fig. 1 for each electronic device 1000, the disclosure may refer to only some of the devices, e.g., the electronic device 1000 refers to only the memory 1200 and the processor 1100.
In an embodiment of the present disclosure, the memory 1200 of the electronic device 1000 is used for storing instructions for controlling the processor 1100 to execute the method provided by the embodiment of the present disclosure.
In the above description, the skilled person will be able to design instructions in accordance with the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail here.
In the embodiment of the present disclosure, the storage cluster may include a plurality of nodes (server nodes), where the plurality of nodes includes a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the other nodes except the management node are the storage nodes.
< method example 1>
The embodiment provides a management method of a storage cluster, which is implemented by a management node in the storage cluster.
In this embodiment, the storage cluster may be a server cluster, the storage cluster includes a plurality of storage nodes and at least one management node, and the management node is configured to manage the storage nodes in the storage cluster. In addition, the structure of the storage cluster provided in this embodiment may include one management node and four storage nodes as shown in fig. 3, and certainly, may also include three management nodes as shown in fig. 4, where the management method of the storage cluster may be implemented by any one of the three management nodes, the management node as the implementation subject may be voted by the three management nodes, and data backup may be performed between the management node as the implementation subject and the other two management nodes, so as to avoid that after the management node as the implementation subject goes down, the management node as the implementation subject may be reselected by the other two management nodes, and the elected management node continues to execute the management method of the storage cluster.
Fig. 2 is a schematic flowchart of a management method for a storage cluster according to an embodiment of the present disclosure, and as shown in fig. 2, the method may include the following steps S2100 to S2300:
in step S2100, information of the hash area is acquired.
The hash region is generally a divided region on the hash ring, and the information of the hash region includes a hash value at a start point and a hash value at an end point of the hash region. The hash value is a value calculated by a hash Algorithm, such as, but not limited to, MD5 message digest Algorithm, Digital Signature Algorithm (DSA), and PBKDF2 Algorithm.
The hash ring may be a consistent hash ring, where the consistent hash ring is a virtual ring formed by organizing the whole hash value space by using a consistent hash algorithm, and the structure of the hash ring provided in this embodiment is shown in fig. 4.
In this embodiment, the hash region may be a region divided by equally dividing the hash ring. Illustratively, as shown in fig. 4, the hash ring is evenly divided into 4 shares, namely, hash region R1, hash region R2, hash region R3, and hash region R4. Wherein, the hash value of the starting point of the hash region R1 may be (1), the hash value of the ending point may be (2), the hash value of the starting point of the hash region R2 may be (2), the hash value of the ending point may be (3), the hash value of the starting point of the hash region R3 may be (3), the hash value of the ending point may be (4), the hash value of the starting point of the hash region R4 may be (4), and the hash value of the ending point may be (1).
After the information of the hash area is obtained, the following steps are entered:
in step S2200, a mapping relationship between the hash region and the storage node is obtained.
The mapping relationship may be stored in a mapping relationship table, where the mapping relationship table includes a plurality of pieces of mapping data, and one piece of mapping data is a mapping relationship between information of one hash area and an identifier of a storage node corresponding to the hash area.
In this embodiment, the obtaining of the mapping relationship between the hash region and the storage node in step S2200 may further include: and generating a mapping relation between the hash area and the storage node according to a preset mapping condition.
The preset mapping condition includes: each hash region maps at least three different storage nodes.
Taking the hash region R1, the hash region R2, the hash region R3, and the hash region R4 divided on the hash ring shown in fig. 4, and the storage node d, the storage node e, the storage node f, and the storage node g shown in fig. 3 as examples, the mapping relationship table includes a plurality of mapping relationships corresponding to a plurality of pieces of mapping data, where a piece of mapping data may be: the information of the hash area R1 and the identification of storage node d, the identification of storage node e, and the identification of storage node f, and one piece of mapping data may be: the information of the hash area R2 and the identification of the storage node e, the identification of the storage node f, and the identification of the storage node g, and one piece of mapping data may be: the information of hash region R3 and the identity of storage node d, the identity of storage node e, and the identity of storage node g, and one piece of mapping data may be: information of hash region R4 and the identity of storage node d, the identity of storage node f and the identity of storage node g.
After the mapping relation between the hash area and the storage node is obtained, the following steps are carried out:
step S2300, establishing mapping between the hash area and the storage node according to the mapping relation.
In this embodiment, the establishing of the mapping between the hash region and the storage node according to the mapping relationship in step S2300 may further include:
the information of its mapped hash regions is issued to the storage node so that the storage node stores the information as metadata and creates a copy of the hash region.
The above hash region copies are used for storing data corresponding to the hash region, and one hash region copy includes a set of data corresponding to the hash region.
Illustratively, it may be that the storage node d is issued the information of its mapped hash region R1, the information of hash region R3, and the information of hash region R4, so that the storage node d stores the information of hash region R1, the information of hash region R3, and the information of hash region R4 as metadata and creates a copy of hash region R1, a copy of hash region R3, and a copy of hash region R4, and it is understood that the metadata of the storage node d stores therein the hash value of the storage node d and the start point and end point of the mapped hash region R1, the hash value of the start point and end point of hash region R3, and the hash value of the start point and end point of hash region R4.
It may be that the storage node e is issued the information of its mapped hash region R1, hash region R2, and hash region R3, so that it stores the information of hash region R1, hash region R2, and hash region R3 as metadata and creates a copy of hash region R1, a copy of hash region R2, and a copy of hash region R3.
For how the storage node e, the storage node f, and the storage node g store information as metadata and create a copy of the hash region, reference may be made to the description of the storage node d above, and this embodiment is not described herein again.
According to the management method of the storage cluster in the embodiment of the disclosure, the management node in the storage cluster acquires the information of the hash area and the mapping relation between the hash area and the storage node, and then establishes the mapping between the hash area and the storage node according to the mapping relation.
In one embodiment, after the above acquiring information of the hash region in step S2100 and acquiring the mapping relationship between the hash region and the storage node in step S2200 are performed, the method for managing a storage cluster further includes:
and sending the information of the hash region and the mapping relation to a client outside the storage cluster so as to enable the client to read and write data.
For example, the information of the hash region R1 and the mapping relationship between the hash region R1 and the storage node d, and the mapping relationship between the hash region R2 and the storage node e, and the mapping relationship between the hash region R f and the storage node g may be issued to the client, the information of the hash region R3 and the mapping relationship between the hash region R3 and the storage node d, and the mapping relationship between the hash region R2 and the storage node e, and the mapping relationship between the storage node f and the storage node g may be issued to the client, and the information of the hash region R4 and the mapping relationship between the hash region R4 and the storage node d, and the mapping relationship between the storage node f and the storage node g may be issued to the client, so as to facilitate the client to read and write data, reference may be made to the following method embodiment 3, which is not described in detail herein.
In one embodiment, after the mapping between the hash area and the storage node is established according to the mapping relationship in step S2300 above, the method for managing a storage cluster may further include:
and sending the information of all the 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 copy cluster based on a master-slave mechanism.
The replica cluster may be a RAFT cluster, and each replica in the RAFT cluster may vote for a master replica and a slave replica.
For example, the information of the storage node d, the storage node e, and the storage node f mapped by the hash region R1 may be sent to the storage node d, the storage node e, and the storage node f, so that the copy of the hash region R1 forms a copy cluster based on a master-slave mechanism, for example, a master copy of the hash region R1 on the storage node d, and a slave copy of the hash region R1 on the storage node e and the storage node f may be stored on the storage node d, the storage node e, and the storage node f, and it is understood that an identifier of the hash region R1, identifiers of other storage nodes except for the storage node itself, and identifiers of the master-slave copies are stored on the storage node d, the storage node e, and the storage node f.
The explanation of the hash region R2, the hash region R3, and the hash region R4 is the same as the explanation of the hash region R1, and the detailed description of the embodiment is omitted here.
According to the method of the embodiment, the information of all the storage nodes mapped by the same hash area can be sent to each storage node in the hash area, so that the copies in the same hash area form a copy cluster based on a master-slave mechanism, that is, each storage node can acquire the information of its own storage node and other storage nodes located in the same hash area.
In one embodiment, after the mapping between the hash area and the storage node is established according to the mapping relationship in step S2300 above, the management method of the storage cluster further includes steps S3100 to S3300 of:
in step S3100, the hash region mapped to the target storage node is acquired as a target hash region.
The target storage node is a storage node with the data volume exceeding a set data volume threshold. The set data amount threshold may be a value set according to an actual application scenario and an actual demand.
Taking the target storage node as the storage node d, that is, the storage node d whose data amount exceeds the set data amount threshold, and the hash regions mapped by the storage node d are the hash region R1, the hash region R3, and the hash region R4, any one or more of the hash region R1, the hash region R3, and the hash region R4 may be used as the target hash region, and for example, the hash region R1 may be used as the target hash region.
Step S3200, establish a mapping between the target hash region and a storage node newly added to the storage cluster.
Continuing with the example of the target hash region as the hash region R1, a mapping between the hash region R1 and the storage node h newly added to the storage cluster may be established according to the step S3200.
In step S3300, the mapping between the target storage node and the target hash area is released.
In this embodiment, the removing the mapping between the target storage node and the target hash area in step S3300 may further include: and issuing an instruction to the target storage node so that the target storage node deletes the region information and deletes the copy.
Continuing to take the target hash region as hash region R1 and the target storage node as storage node d as an example, here, the management node may issue an instruction to storage node d, and after receiving the issue instruction, storage node d may delete the information of hash region R1 in its metadata, and delete its copy of hash region R1.
In this embodiment, for example, the mapping relationship table between the hash region R1 and the storage nodes stored locally and at the client may be updated, and the updated mapping relationship table may be the information of the hash region R1, the storage node e, the storage node f, and the storage node h.
According to the method of the embodiment, when a new storage node is introduced into the storage cluster, the mapping between the new storage node and the target hash region is established instead of directly mapping the hash value of the new storage node onto the hash ring as in the prior art, that is, the new storage node is not directly bound to the hash value on the hash ring, but is mapped by the logical target hash region, and thus sla jitter is not caused.
Meanwhile, the storage node mapped by the target hash region is a storage node with a particularly large data volume, so that after the target hash region is mapped to a new storage node, a copy of the target hash region can be created again by the new storage node, data transfer is realized, and load balancing is further realized.
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 method for managing a storage cluster further includes:
under the condition that any storage node in the hash area is down, judging whether a main copy of the hash area exists on the down storage node; and under the condition that the main copy of the hash area exists on the downtime storage node, reselecting a new main copy from other auxiliary copies in the hash area.
For example, when the storage node d in the hash area R1 is down, it may be determined whether the master copy of the hash area R1 exists on the storage node d, and when the master copy of the hash area R1 exists, the master copy may be reselected from other slave copies in the hash area R1.
Of course, the mapping relationship table between the local and client stored hash region R1 and the storage nodes may also be updated, since the mapping relationship between the storage nodes of the original hash region R1 is: the information of the hash region R1 and the storage node d, the storage node e and the storage node f, and the updated mapping relationship table may be the information of the hash region R1 and the storage node e and the storage node f.
According to the method of the embodiment, in the case that any storage node in the hash area is down, the logical hash area is modified to solve the problem, and no sla jitter is caused.
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 method for managing a storage cluster further includes steps S4100 to S4200:
in step S4100, range information of a plurality of second hash regions split by the first hash region is acquired.
The first hash region is a hash region to be split.
In this embodiment, the range of the second hash region may be obtained by equally dividing the first hash region according to the target split number, where the target split number may be a numerical value set according to an actual application scenario and an actual requirement, and the target split number may be configured through the configuration interface.
For example, as shown in fig. 5, taking the first hash region as hash region R1 and the target split number as 2 as an example, the hash region R1 may be equally divided into a second hash region R11 and a second hash region R12, where the hash value of the starting point of the second hash region R11 is (1), 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).
In step S4200, a splitting instruction is issued to the first storage node, so that the first storage node splits the copy of the first hash region into multiple copies of the second hash regions according to the splitting instruction and modifies metadata of the first storage node.
The splitting instruction contains range information of the second hash area, and the first storage node is a storage node corresponding to the first hash area.
Continuing with the above example, since all storage nodes mapped by the first hash region R1 are storage node d, storage node e, and storage node f, that is, there are copies of the hash region R1 on storage node d, storage node e, and storage node f, here, the management node will issue a splitting instruction to storage node d, storage node e, and storage node f, after receiving the splitting 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 R12 and the second hash region R12, and at the same time, will modify its metadata according to the range information of the second hash region R11 and the range information of the second hash region R12 in the splitting instruction. It should be appreciated that at this point the data has not been transferred to the split second hash region R11 and second hash region R12.
Step S4300, a mapping between the second hash region and the second storage node is established.
The second storage node is a storage node which needs to perform data transfer, and the second storage node can be any one or more of the first storage nodes.
Continuing with the above example, taking the second storage node as the storage node d as an example, here, according to the present step S4300, the mappings of the second hash region R11 and the storage node d are respectively established, and the mappings of the second hash region R12 and the storage node d are established.
In step S4400, the mapping between the second hash region and the first storage node is released.
In this step S4400, the removing the mapping between the second hash area and the first storage node may further include: and issuing an instruction to the first storage node so that the first storage node deletes the region information and deletes the copy.
Continuing with the above example, here, the management node may issue an instruction to the storage node e and the storage node f, and after receiving the instruction, the storage node e and the storage node f may 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 delete the copy of the second hash region R11 and the copy of the second hash region R12 stored in themselves.
According to the method of the embodiment, when the data amount of the copy on the first hash area is particularly large, the first hash area is split, and data transfer is performed, so that the data on each hash area is uniformly distributed.
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 management method of the storage cluster further includes steps S5100 to S5300 as follows:
in step S5100, a merge instruction is received.
The merge instruction is used for merging a plurality of consecutive hash regions to obtain a merged hash region.
Illustratively, as shown in fig. 6, consecutive hash regions R1 and R2 may be merged, for example, to obtain a merged hash region R21.
In step S5200, a mapping between the merged hash region and storage node is established.
Continuing with the above example, since all storage nodes mapped by hash region R1 include storage node d, storage node e, and storage node f, and all storage nodes mapped by hash region R2 include storage node e, storage node f, and storage node g, it is possible to establish, for example, only the mapping of storage node e and hash region R21, the mapping of storage node f and hash region R21, and the mapping of storage node g and hash region R21 according to this step S5200.
In step S5300, the mapping relationship between hash areas before merging is released.
For example, on storage node e and storage node f, the copies of hash region R1 and hash region R2 are merged; on the storage node g, the copy on the storage node g mapped by the hash region R2 is set as one copy of the hash region R1 to complete synchronization; the copies of hash region R1 and hash region R2 are then merged and the copy of hash region R1 on storage node d is deleted.
According to the method of the embodiment, when the data amount on any one hash area is small, two consecutive hash areas can be combined, and the data on each hash area is distributed uniformly.
< method example 2>
The embodiment provides a data storage method for a storage cluster, where the storage cluster includes storage nodes and at least one management node, and the management node is used to manage the storage nodes in the storage cluster.
Fig. 7 is a schematic flowchart of a data storage method of a storage cluster according to an embodiment of the present disclosure, and as shown in fig. 7, the method may include the following steps S7100 to S7300:
step S7100, information of the corresponding hash region is acquired from the management node, stored as metadata, and a copy is created.
In this embodiment, taking a storage node d as an implementation subject, the storage node d stores the acquired 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.
The information of the hash region includes a hash value of a start point and a hash value of an end point of the hash region.
Step S7200, receiving data to be stored, and determining whether the data is data of a hash area according to the metadata.
In this embodiment, the storage engine may store the relationship between the identifier of the data and the hash region corresponding to the identifier in advance. The identification of the data may be a key of the data.
Continuing with the above example, after receiving the data to be stored, the storage node d searches whether the key of the data is bound to the hash region mapped by the storage node d in its metadata.
Step S7300, in the case of data of the hash area, adding data to be stored to the corresponding copy.
Continuing with the above example, if storage node d finds in its 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.
According to the data storage method of the storage cluster in the embodiment of the disclosure, the storage node acquires information of a corresponding hash region from the management node, stores the information as metadata and creates a copy of the hash region, and meanwhile, after receiving the data to be stored, the storage node adds the data to be stored into the corresponding copy under the condition that the data is determined to be the hash region according to the metadata, that is, under the condition that the storage node determines that the received data is the data of the hash region corresponding to the storage node, the storage node adds the data into the copy of the corresponding hash region, which is convenient for data maintenance.
In one embodiment, after obtaining information of a 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:
and controlling the copy to be added into the copy cluster corresponding to the hash area.
The above replica cluster employs a master-slave mechanism, and the replica cluster may be a RAFT cluster. Each replica in the RAFT cluster can vote for a master replica and a slave replica.
In this embodiment, reference may be made to method embodiment 1 for how to control adding of a copy to a copy cluster corresponding to a hash region, which is not described in detail herein.
< method example 3>
The present embodiment provides another data storage method for a storage cluster, where the storage cluster includes a plurality of storage nodes and at least one management node, and the management node is used to manage the storage nodes in the storage cluster, and the method is implemented by a client outside the storage cluster, for example.
Fig. 8 is a schematic flowchart of a data storage method of a storage cluster according to an embodiment of the present disclosure, and as shown in fig. 8, the method may include the following steps S8100 to S8300:
and step S8100, acquiring the information of the hash area and the mapping relation from the management node.
Illustratively, what the client acquires may be a hash value of the start point and a hash value of the end point of the hash region R1, a hash value of the start point and a hash value of the end point of the hash region R2, a hash value of the start point and a hash value of the end point of the hash region R3, and a hash value of the start point and a hash value of the end point of the hash region R4.
Meanwhile, the obtained mapping relationship may be: the information of the hash area R1 and the identification of the storage node d, the identification of the storage node e and the identification of the storage node f, and one piece of mapping data may be: the information of the hash region R2 and the identity of storage node e, the identity of storage node f and the identity of storage node g, and one piece of mapping data may be: the information of the hash area R3 and the identification of the storage node d, the identification of the storage node e and the identification of the storage node g, and one piece of mapping data may be: information of hash region R4 and the identity of storage node d, the identity of storage node f and the identity of storage node g.
Step S8200, according to the hash value of the data identification, the hash area corresponding to the data is determined.
The hash value of the identification of the data may also be calculated from the above hash function.
For example, 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, and can determine that the hash region corresponding to the data is the hash region R1.
And step S8300, determining the storage node mapped by the Hash area according to the mapping relation.
Illustratively, the client determines the storage nodes mapped by the hash region R1 as storage node d, storage node e and storage node f according to the mapping relationship obtained in step S8100 above.
And step S8400, sending the data to a storage node for storage.
Illustratively, the client will send data to storage node d, storage node e and storage node f for storage.
According to the method disclosed by the embodiment of the invention, when the client needs to send data for storage, only the mapping relation between the hash area and the storage node and the information of the hash area need to be acquired from the management node, the hash area corresponding to the data is determined according to the hash value of the identifier of the data, the storage node mapped by the hash area is determined according to the mapping relation, and then the data is sent to the storage node for storage, so that the data maintenance is facilitated.
< apparatus example 1>
In this embodiment, a management apparatus for a storage cluster is further provided, where the storage cluster includes a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, and the apparatus is applied to the management node, as shown in fig. 9, the apparatus 9000 may include a first obtaining module 9100, a second obtaining module 9200, and an establishing module 9300.
The first obtaining module 9100 is configured to obtain information about a hash region, where the hash region is a region divided on a hash ring.
The information of the hash region includes a hash value of a start point and a hash value of an end point of the hash region.
A second obtaining module 9200, configured to obtain a mapping relationship between the hash region and the storage node.
An establishing module 9300, configured to establish a mapping between the hash region and the storage node according to the mapping relationship.
In one embodiment, the establishing module 9300 may include a sending unit and a creating unit (not shown in the figure), the sending unit is configured to send the 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 by the creating unit, and the copy of the hash region is used for storing the data corresponding to the hash region.
In an embodiment, the apparatus 9000 further includes an issuing module (not shown in the figure), and after the second obtaining module 9200 obtains the mapping relationship between the hash region and the storage node, the issuing module is configured to send the information of the hash region and the mapping relationship to a client outside the storage cluster, so that the client reads and writes data.
In an embodiment, the second obtaining module 9200 may be configured to generate the mapping relationship between the hash region and the storage node according to a preset mapping condition when obtaining the mapping relationship between the hash region and the storage node.
The mapping conditions include: each hash region maps at least three different storage nodes.
In an embodiment, after the establishing module 9300 establishes the mapping between the hash region and the storage nodes according to the mapping relationship, the issuing module is further configured to issue information of all storage nodes mapped by the same hash region to each storage node of the hash region, so that the copies of the same hash region form a copy cluster based on a master-slave mechanism.
In one embodiment, the apparatus 9000 further comprises an adding module (not shown), which after the establishing module 9300 establishes the mapping between the hash region and the storage node according to the mapping relationship: the hash area mapping to the target storage node is obtained and used as a target hash area; establishing mapping between the target hash area and a storage node newly added to the storage cluster; unmapping the target storage node and the target hash region.
The target storage node is a storage node with the data volume exceeding a set data volume threshold.
In one embodiment, the apparatus 9000 further comprises a splitting module (not shown), which after the establishing module 9300 establishes a mapping between the hash region and the storage node according to the mapping relationship: the range information of a plurality of second hash areas split by the first hash area is obtained; issuing a splitting instruction to a first storage node to cause the first storage node to split a copy of the first hash region into multiple copies of the second hash region according to the splitting instruction and modify metadata of the first storage node.
The splitting instruction contains the range information of the second hash area, and the first storage node is a storage node corresponding to the first hash area.
In one embodiment, the splitting module may include an establishing unit for establishing a mapping of the second hash region to the second storage node and a de-establishing unit (not shown in the figure). The removal unit is configured to remove the mapping between the second hash region and the first storage node.
In one embodiment, the apparatus 9000 further comprises a merging module (not shown in the figure) for receiving a merging instruction after the establishing module 9300 establishes the mapping between the hash region and the storage node according to the mapping relationship; establishing mapping between the merged hash area and the storage node; and releasing the mapping relation of the hash areas before combination.
The merge instruction is to merge a plurality of consecutive hash regions.
< apparatus example 2>
In this embodiment, a data storage apparatus of a storage cluster is further provided, where the storage cluster includes a storage node and at least one management node, the management node is configured to manage the storage node in the storage cluster, and the apparatus is applied to the storage node, as shown in fig. 10, the apparatus 10000 may include a third obtaining module 10100, a receiving module 10200, and a storage module 10300.
A third obtaining module 10100, configured to obtain information of a corresponding hash area from the management node, store the information as metadata, and create a copy.
A receiving module 10200, configured to receive data to be stored, and determine whether the data is the data of the hash region according to the metadata.
A storage module 10300, configured to add the data to be stored to the corresponding copy in the case of the data in the hash region.
In an embodiment, the apparatus 10000 further includes a joining module (not shown in the figure), after the third obtaining module 10100 obtains the information of the corresponding hash region from the management node, stores the information as metadata, and creates a copy of the hash region, the joining module is configured to control the copy to join a copy cluster corresponding to the hash region, where the copy cluster employs a master-slave mechanism.
< apparatus example 3>
In this embodiment, a data storage device of a storage cluster is further provided, where the storage cluster includes a storage node and at least one management node, the management node is used to manage the storage node in the storage cluster, and the device is applied to a client outside the storage cluster, as shown in fig. 11, the device 11000 may include a fourth obtaining module 11100, a first determining module 11200, a second determining module 11300, and a sending module 11400.
A fourth obtaining module 11100, configured to obtain the information of the hash area and the mapping relationship from the management node.
A first determining module 11200, configured to determine, according to the hash value of the identifier of the data, a hash region corresponding to the data.
A second determining module 11300, configured to determine, according to the mapping relationship, a storage node mapped by the hash area.
A sending module 11400, configured to send the data to the storage node for storage.
< electronic device embodiment >
The embodiment of the present disclosure provides an electronic device 12000, which includes a processor 12100 and a memory 12200, where the memory 12200 stores computer instructions, and when the computer instructions are executed by the processor 12100, the method provided in any of the foregoing embodiments is implemented.
< media examples >
Embodiments of the present invention provide a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the computer instructions implement the method provided in any of the foregoing embodiments.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, 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 Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be interpreted as a transitory 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., optical pulses through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or 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 may 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 for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims (16)

1. A management method for a storage cluster, wherein the storage cluster comprises a plurality of storage nodes and at least one management node, the management node is used for managing the storage nodes in the storage cluster, and the method is applied to the management node and comprises the following steps:
acquiring information of a hash region, wherein the hash region is a region divided on a hash ring, and the information of the hash region comprises a hash value of a starting point and a hash value of an ending point of the hash region;
acquiring a mapping relation between a hash area and a storage node;
establishing mapping between the hash area and the storage node according to the mapping relation;
the establishing of the mapping between the hash region and the storage node according to the mapping relationship comprises: and issuing the information of the hash region mapped by the storage node 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 for storing the data corresponding to the hash region.
2. The method of claim 1, further comprising, after the obtaining the mapping relationship between the hash region and the storage node:
and sending the information of the hash area and the mapping relation to a client outside the storage cluster so as to enable the client to read and write data.
3. The method of claim 1, wherein the obtaining the mapping relationship between the hash region and the storage node comprises:
generating a mapping relation between the hash area and the storage node according to a preset mapping condition;
wherein the mapping condition includes: each hash region maps at least three different storage nodes.
4. The method according to claim 3, further comprising, after the establishing the mapping between the hash region and the storage node according to the mapping relationship:
and sending the information of all the 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 copy cluster based on a master-slave mechanism.
5. The method according to claim 1, further comprising, after the establishing the mapping between the hash region and the storage node according to the mapping relationship:
acquiring a hash area mapped on a target storage node as a target hash area; the target storage node is a storage node with the data volume exceeding a set data volume threshold;
establishing mapping between the target hash area and a storage node newly added to the storage cluster;
unmapping the target storage node and the target hash region.
6. The method according to claim 1, further comprising, after the establishing the mapping between the hash region and the storage node according to the mapping relationship:
obtaining range information of a plurality of second hash regions split by the first hash region;
and issuing a splitting instruction to a first storage node so that the first storage node splits the copy of the first hash region into multiple copies of the second hash regions according to the splitting instruction and modifies metadata of the first storage node, wherein the splitting instruction contains range information of the second hash regions, and the first storage node is a storage node corresponding to the first hash region.
7. The method of claim 6, after issuing the splitting instruction to the first storage node, further comprising:
establishing mapping between the second hash area and a second storage node;
unmapping the second hash region and the first storage node.
8. The method according to claim 1, wherein after establishing the mapping between the hash region and the storage node according to the mapping relationship, the method further comprises:
receiving a merging instruction, wherein the merging instruction is used for merging a plurality of continuous hash areas;
establishing mapping between the merged hash area and the storage node;
and releasing the mapping relation of the hash areas before combination.
9. A data storage method of a storage cluster, wherein the storage cluster comprises storage nodes and at least one management node, the management node is used for managing the storage nodes in the storage cluster, and the method is applied to the storage nodes and comprises the following steps:
obtaining information of a 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 the data of the hash area according to the metadata;
and adding the data to be stored into the corresponding copy under the condition of the data in the hash area.
10. The method of claim 9, wherein after obtaining information for a corresponding hash region from the management node, storing the information as metadata, and creating a copy of the hash region, the method further comprises:
and controlling the copies to be added into the copy cluster corresponding to the Hash area, wherein the copy cluster adopts a master-slave mechanism.
11. A data storage method of a storage cluster, wherein the storage cluster comprises a plurality of storage nodes and at least one management node, the management node is used for managing the storage nodes in the storage cluster, and the method is applied to a client outside the storage cluster, and comprises the following steps:
acquiring information and a mapping relation of a hash area from the management node;
determining a hash area corresponding to the data according to the hash value of the identifier of the data;
determining a storage node mapped by the hash area according to the mapping relation;
and sending the data to the storage node for storage.
12. An apparatus for managing a storage cluster, wherein the storage cluster comprises a plurality of storage nodes and at least one management node, and the management node is configured to manage the storage nodes in the storage cluster, and the apparatus is applied to the management node, and the apparatus comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring information of a hash region, the hash region is a region divided on a hash ring, and the information of the hash region comprises 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 for acquiring the mapping relation between the hash area and the storage node;
the establishing module is used for establishing mapping between the hash area and the storage node according to the mapping relation;
the establishing module is specifically configured to issue 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, where the copy of the hash region is used to store data corresponding to the hash region.
13. A data storage apparatus of a storage cluster, wherein the storage cluster comprises a storage node and at least one management node, the management node is configured to manage the storage node in the storage cluster, the apparatus is applied to the storage node, and the apparatus comprises:
a third obtaining module, configured to obtain information of a corresponding hash region from the management node, store the information as metadata, and create a copy;
the receiving module is used for receiving data to be stored and determining whether the data is the data of the hash area or not according to the metadata;
and the storage module is used for adding the data to be stored into the corresponding copy under the condition of the data in the hash area.
14. A data storage device of a storage cluster, wherein the storage cluster comprises a plurality of storage nodes and at least one management node, the management node is configured to manage the storage nodes in the storage cluster, the device is applied to a client outside the storage cluster, and the device comprises:
a fourth obtaining module, configured to obtain information of the hash region and a mapping relationship from the management node;
the first determining module is used for determining a hash area corresponding to the data according to the hash value of the identifier of the data;
the second determining module is used for determining the storage node mapped by the hash area according to the mapping relation;
and the sending module is used for sending the data to the storage node for storage.
15. An electronic device comprising a memory for storing computer instructions and a processor for retrieving the computer instructions from the memory to perform the method of any one of claims 1-11.
16. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the method according to any one of claims 1-11.
CN202110121766.5A 2021-01-28 2021-01-28 Management method and device of storage cluster, electronic equipment and storage medium Pending CN114816225A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110121766.5A CN114816225A (en) 2021-01-28 2021-01-28 Management method and device of storage cluster, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110121766.5A CN114816225A (en) 2021-01-28 2021-01-28 Management method and device of storage cluster, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114816225A true CN114816225A (en) 2022-07-29

Family

ID=82525810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110121766.5A Pending CN114816225A (en) 2021-01-28 2021-01-28 Management method and device of storage cluster, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114816225A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210208987A1 (en) * 2018-07-10 2021-07-08 Here Data Technology Systems and methods of distributed data storage using multi-layers consistent hashing
CN115878046A (en) * 2023-01-09 2023-03-31 苏州浪潮智能科技有限公司 Data processing method, system, device, storage medium and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210208987A1 (en) * 2018-07-10 2021-07-08 Here Data Technology Systems and methods of distributed data storage using multi-layers consistent hashing
US11461203B2 (en) * 2018-07-10 2022-10-04 Here Data Technology Systems and methods of handling node failure in a distributed data storage using multi-layer consistent hashing
CN115878046A (en) * 2023-01-09 2023-03-31 苏州浪潮智能科技有限公司 Data processing method, system, device, storage medium and electronic equipment
CN115878046B (en) * 2023-01-09 2023-05-12 苏州浪潮智能科技有限公司 Data processing method, system, device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN111124604B (en) Method, device, equipment and storage medium for distributing pod IP address
KR102376713B1 (en) Composite partition functions
US10650077B2 (en) Providing secure storage of content and controlling content usage by social media applications
US11188560B2 (en) Synchronizing object in local object storage node
JP2020501209A (en) Malware detection and restoration of content items
CN112099836A (en) Configuration file updating method, configuration server, version control server and system
US10248678B2 (en) Enabling placement control for consistent hashing-based object stores
CN108647317B (en) Incremental file generation method and device, storage medium and electronic equipment
CN111708557B (en) Method, device and storage medium for updating configuration file
CN114816225A (en) Management method and device of storage cluster, electronic equipment and storage medium
CN111104069A (en) Multi-region data processing method and device of distributed storage system and electronic equipment
CN104636437A (en) Event notification method and device and monitor processing method
US10855776B2 (en) Method and device for managing sessions
CN111752960B (en) Data processing method and device
CN104462342B (en) database snapshot synchronization processing method and device
CN108989072B (en) Method and device for deploying, managing and calling assembly
JP6272546B2 (en) Data storage device, data processing method, and data processing program
WO2016078326A1 (en) Method, apparatus and system for displaying names of virtual machine
CN104267873A (en) Folder display method and device
CN111858156A (en) Mirror image management method and device and electronic equipment
CN111711710B (en) Method, device, equipment and storage medium for accessing MongoDB copy set cluster
US12001400B2 (en) Method and apparatus for synchronizing file
CN111176830B (en) Information flow distribution method, device and server system
CN115878587A (en) Instance creating method and device, electronic equipment and readable storage medium
CN108573042B (en) Report synchronization method, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination