Volume mapping management method, device, equipment and storage medium

By introducing the target message queue in the distributed storage cluster, the problems of long volume mapping creation and excessive resource consumption in large-scale clusters are solved, efficient volume mapping management is achieved, the pressure on the master node is reduced, and creation efficiency and user experience are improved.

CN115098027BActive Publication Date: 2025-09-05JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210751004.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2025-09-05
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

In large-scale distributed storage clusters, volume mapping management leads to serious resource consumption of the master node, low efficiency in creating volume mappings, and inability to guarantee the uniqueness of the same volume mapping identifier on different nodes.

Method used

Using the target message queue mechanism, the master node receives the creation request and assembles the creation message, sends it to the slave node through the message queue, receives the creation result of the slave node, displays the slave node information and volume mapping information based on the result, and ensures that the message queue saves the creation message on the expansion node.

Benefits of technology

It reduces the pressure on the master node, improves the efficiency of volume mapping creation, ensures the uniqueness of volume mapping identifiers, and improves user experience and product reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098027B_ABST
    Figure CN115098027B_ABST
Patent Text Reader

Abstract

The present application discloses a volume mapping management method, apparatus, device and storage medium, which relates to the field of data storage technology, including: a master node in a distributed storage cluster assembles a corresponding creation message based on a creation request corresponding to the creation of a volume mapping received; sends the creation message to a target message queue; receives a creation result regarding the creation of a volume mapping returned by each slave node in the distributed storage cluster; the creation result is the result corresponding to whether the volume mapping is successfully created when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation; and determines whether to display the node information of the slave node and the volume mapping corresponding to the volume mapping based on the creation result. The present application can solve the problem of too long a time or excessive resource consumption when creating a volume mapping in a large-scale cluster through the intervention of a target message queue, that is, the interaction between the master node and the slave node in the form of a message queue, thereby reducing the pressure on the master node and improving the creation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a volume mapping management method, apparatus, device and storage medium. Background Art

[0002] Currently, all user data in a block storage cluster is stored on logical volumes. To enable users to write data to logical volumes, volumes must be mapped to clients, requiring management of volume mappings. For a block storage cluster, managing volume mappings primarily involves creating and deleting them. Because a block storage cluster often has multiple nodes, and it's uncertain which node a client uses to write data to a logical volume, creating and deleting volume mappings requires creating a corresponding volume mapping on each node. This applies to both creating and deleting volume mappings.

[0003] When there are fewer nodes in the cluster, the creation operation can be completed by traversing each node one by one to create volume mappings. However, as the storage cluster becomes larger and larger, the traversal creation method encounters extremely challenging efficiency issues. At this time, the method of synchronously executing the creation operation on each node comes into being. However, both the traversal creation and the synchronous execution creation methods still have the following problems: First, the consistency problem of volume mapping ID. When creating a volume mapping, each volume mapping needs to be assigned a unique ID to identify a volume mapping. The creation of volume mapping is that the master node receives the creation request and then starts multiple threads on the master node to complete the creation on other slave nodes respectively, notifying other slave nodes to complete the volume mapping creation operation. However, when there are multiple creation tasks at the same time, the multi-threaded method cannot guarantee that the order in which each slave node receives the creation notification is consistent. For example, if volume mapping 1 and volume mapping 2 are created at the same time, after the master node receives two requests, , starts to send creation notifications to other slave nodes, but slave node 1 receives the creation 1 notification first and then the creation 2 notification, and slave node 2 receives the creation 2 notification first and then the creation 1 notification, which may cause the ID of the same volume mapping to be inconsistent on different nodes; and if there are many slave nodes, the master node's multi-threaded startup method will bring great challenges to the master node's resource consumption; second, for distributed storage clusters, cluster expansion is a common operation. In order to ensure the normal operation of the business, it is necessary to create a volume mapping that is consistent with other nodes on the newly expanded node. However, the distributed storage cluster does not automatically create the existing volume mappings on other nodes on the newly expanded node. Instead, it needs to manually create a volume mapping that is consistent with other nodes on the newly expanded node, resulting in low efficiency and error-prone volume mapping creation.

[0004] In summary, the volume mapping management in related technologies leads to severe resource consumption on master nodes, low efficiency in creating volume mappings, and inability to guarantee the uniqueness of the identifiers for the same volume mapping across different nodes. Therefore, providing a solution to the aforementioned technical issues is a current challenge for those skilled in the art. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a volume mapping management method, apparatus, device, and storage medium that can solve the problem of excessive time consumption or excessive resource consumption when creating volume mappings in large-scale clusters, reduce the pressure on the master node, and improve the efficiency of volume mapping creation. The specific solution is as follows:

[0006] In a first aspect, the present application discloses a volume mapping management method, which is applied to a master node corresponding to a distributed storage cluster, comprising:

[0007] Receive a creation request corresponding to creating a volume mapping, and assemble a corresponding creation message based on the creation request;

[0008] Sending the creation message to a target message queue;

[0009] receiving a creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is a result corresponding to whether the volume mapping is successfully created when the slave node executes the volume mapping creation operation using the creation message in the target message queue;

[0010] Based on the creation result, it is determined whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping.

[0011] Optionally, the receiving a creation request corresponding to creating a volume mapping includes:

[0012] Receive HTTP request corresponding to creating volume mapping;

[0013] Accordingly, assembling a corresponding creation message based on the creation request includes:

[0014] A corresponding creation message is assembled based on the HTTP creation request.

[0015] Optionally, assembling a corresponding creation message based on the creation request includes:

[0016] The creation request is parsed to obtain corresponding parsed data, and the parsed data is assembled according to a preset target format to obtain a corresponding creation message.

[0017] Optionally, the operation of performing volume mapping creation using the creation message in the target message queue includes:

[0018] Real-time monitoring of whether there is a new creation message in the target message queue;

[0019] When it is detected that there is a new create message in the target message queue, obtaining the new create message in the target message queue;

[0020] The volume mapping creation operation is performed according to the content of the new creation message.

[0021] Optionally, after receiving the creation result of the volume mapping returned by each slave node in the distributed storage cluster, the method further includes:

[0022] marking the creation message in the target message queue used by the slave node when creating the volume mapping;

[0023] The marked creation message is saved in a database, so that the expansion node of the distributed storage cluster reads the marked creation message from the database and uses the marked creation message to perform the volume mapping creation operation.

[0024] Optionally, the determining, based on the creation result, whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping includes:

[0025] Parsing the creation result to obtain a corresponding parsed result;

[0026] If the parsing result indicates that the slave node fails to successfully create the volume mapping, the node information of the slave node and the volume mapping information corresponding to the volume mapping are displayed.

[0027] Optionally, displaying the node information of the slave node and the volume mapping information corresponding to the volume mapping includes:

[0028] The node information of the slave node and the volume mapping information corresponding to the volume mapping are assembled to obtain corresponding alarm information, and the alarm information is displayed.

[0029] In a second aspect, the present application discloses a volume mapping management device, which is applied to a master node corresponding to a distributed storage cluster, comprising:

[0030] A request receiving module, configured to receive a creation request corresponding to creating a volume mapping;

[0031] A message assembly module, configured to assemble a corresponding creation message based on the creation request;

[0032] A message sending module, configured to send the creation message to a target message queue;

[0033] A result receiving module is configured to receive a creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is a result corresponding to whether the volume mapping is successfully created when the slave node executes the volume mapping creation operation using the creation message in the target message queue;

[0034] An information display module is used to determine whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result.

[0035] In a third aspect, the present application discloses an electronic device, comprising:

[0036] Memory, used to store computer programs;

[0037] The processor is configured to execute the computer program to implement the steps of the aforementioned volume mapping management method.

[0038] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned volume mapping management method are implemented.

[0039] It can be seen that the present application provides a volume mapping management method, comprising: receiving a creation request corresponding to a volume mapping, and assembling a corresponding creation message based on the creation request; sending the creation message to a target message queue; receiving a creation result returned by each slave node in the distributed storage cluster regarding the creation of the volume mapping; the creation result is a result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation to determine whether the volume mapping is successfully created; and determining whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result. It can be seen that the present application intervenes through the target message queue, that is, the master node receives the creation request corresponding to the volume mapping, sends the corresponding creation message to the target message queue, and then receives the creation result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation, and then determines whether to display the slave node information and the volume mapping information based on the creation result. That is, the master node and the slave node interact in the form of a message queue, which can solve the problem of too long time or excessive resource consumption when creating volume mapping in a large-scale cluster, reduce the pressure on the master node, and improve the efficiency of volume mapping creation. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0041] Figure 1 This is a flow chart of a volume mapping management method disclosed in this application;

[0042] Figure 2 This is a flow chart of a specific volume mapping management method disclosed in this application;

[0043] Figure 3 This is a flow chart of a specific volume mapping management method disclosed in this application;

[0044] Figure 4 This is a flow chart of a specific volume mapping management method disclosed in this application;

[0045] Figure 5 This is a schematic diagram of the structure of a volume mapping management device disclosed in this application;

[0046] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0048] Currently, existing volume mapping management technologies can easily lead to severe resource consumption on master nodes, low efficiency in creating volume mappings, and inability to guarantee the uniqueness of the identifiers for the same volume mapping on different nodes. Therefore, this application provides a volume mapping management method that can address the issues of excessive time consumption or resource consumption when creating volume mappings in large-scale clusters, reduce pressure on master nodes, and improve the efficiency of volume mapping creation.

[0049] The embodiment of the present invention discloses a volume mapping management method, which is applied to the master node corresponding to the distributed storage cluster. Figure 1 As shown, the method includes:

[0050] Step S11: receiving a creation request corresponding to volume mapping, and assembling a corresponding creation message based on the creation request.

[0051] In this embodiment, when creating a volume mapping, a creation request corresponding to the volume mapping is received, and a corresponding creation message is assembled based on the creation request. Specifically, the client sends an HTTP request to create a volume mapping to the master node corresponding to the distributed storage cluster. That is, the master node corresponding to the distributed storage cluster receives the HTTP request to create the volume mapping and assembles a corresponding creation message based on the HTTP request.

[0052] In this embodiment, the assembling of the corresponding creation message based on the creation request may include: parsing the creation request to obtain corresponding parsed data, and assembling the parsed data according to a preset target format to obtain the corresponding creation message. It is understandable that the master node processes the received creation request corresponding to the creation volume mapping, and then assembles the parsed data according to the preset target format to obtain the corresponding creation message, that is, assembling the creation request in a specific format into a message that can be processed by the slave nodes in the distributed storage cluster to obtain the corresponding creation message.

[0053] Step S12: Send the creation message to the target message queue.

[0054] In this embodiment, after assembling a corresponding create message based on the create request, the create message is sent to the target message queue. It is understandable that after receiving the above create request, the master node does not directly issue a create command to the slave nodes in the distributed clearing cluster in a traversal or multi-threaded manner. Instead, it acts as a message producer and sends a volume mapping create message to the target message queue. The target message queue then transmits the volume mapping create request and the various parameters required for creating the volume mapping to the slave nodes.

[0055] Step S13: Receive the creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is the result corresponding to whether the volume mapping is successfully created when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation.

[0056] In this embodiment, after sending the create message to the target message queue, the slave nodes in the distributed storage cluster receive a creation result regarding the volume mapping creation, which is returned by each slave node. The creation result is the result corresponding to whether the volume mapping was successfully created, obtained when the slave node executes the volume mapping creation operation using the create message in the target message queue. In other words, each slave node in the distributed storage cluster executes the volume mapping creation operation using the create message in the target message queue, obtains a creation result corresponding to whether the volume mapping was successfully created, and the slave node returns the creation result to the master node of the distributed storage cluster. In other words, the slave nodes in the distributed storage cluster act as message consumers, obtain the create message from the target message queue, complete the creation based on the information carried in the create message, such as the volume mapping name, and return the corresponding creation result to the master node. Specifically, the slave nodes monitor the target message queue in real time for new create messages. When detecting the presence of the new create message in the target message queue, they obtain the new create message from the target message queue and execute the volume mapping creation operation based on the content of the new create message. It can be understood that the slave node monitors the target message queue in real time. When a new creation message is detected in the target message queue, the slave node parses the new creation message, uses the parsed content to complete the request to create the volume mapping, and returns the creation result corresponding to the volume mapping to the master node.

[0057] Step S14: Determine whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result.

[0058] In this embodiment, after receiving the creation results regarding the volume mapping returned by each slave node in the distributed storage cluster, the master node determines whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation results. It is understandable that after receiving the creation results returned by the slave nodes, the master node processes the returned creation results and displays the node information and volume mapping information of the slave nodes for which the volume mapping was not successfully created, so as to prompt the user to manually create the corresponding volume mapping on the slave nodes for which the volume mapping was not successfully created.

[0059] That is to say, the master node in the distributed storage cluster only accepts the creation request for creating volume mapping and stores the creation request in a specific format of message to the target message queue, and processes the creation results returned by each slave node; the slave node in the distributed storage cluster obtains the message from the target message queue, parses the message content, and then completes the volume mapping creation and returns the creation result. When the creation fails, the user is prompted to complete the process of creating the volume mapping on the slave node that failed to successfully create the volume mapping, avoiding the pressure caused by multi-threading and the problem of too long time caused by the traversal method, reducing risks and improving user experience.

[0060] It can be seen that the embodiment of the present application involves the target message queue, that is, the master node receives the creation request corresponding to the creation of the volume mapping, sends the corresponding creation message to the target message queue, and then receives the creation result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation, and then determines whether to display the slave node information and volume mapping information based on the creation result. That is, the master node and the slave node interact in the form of a message queue, which can solve the problem of too long time or excessive resource consumption when creating volume mapping in a large-scale cluster, can reduce the pressure on the master node, and improve the creation efficiency of the volume mapping.

[0061] See also Figure 2 As shown, the embodiment of the present invention discloses a specific volume mapping management method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.

[0062] Step S21: receiving a creation request corresponding to volume mapping, and assembling a corresponding creation message based on the creation request.

[0063] Step S22: Send the creation message to the target message queue.

[0064] Step S23: Receive the creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is the result corresponding to whether the volume mapping is successfully created when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation.

[0065] Step S24: Determine whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result.

[0066] Step S25: marking the creation message in the target message queue used when the slave node creates the volume mapping.

[0067] In this embodiment, after each slave node in the distributed storage cluster completes the creation of a volume mapping, it does not delete the creation message in the target message queue. Instead, it marks the creation message in the target message queue that the slave node used when creating the volume mapping. It is understandable that marking the creation message completes processing.

[0068] Step S26: Save the marked creation message to a database, so that the expansion node of the distributed storage cluster reads the marked creation message from the database and uses the marked creation message to perform the volume mapping creation operation.

[0069] In this embodiment, after marking the creation message in the target message queue used when the slave node creates the volume mapping, the marked creation message is saved to the database so that the expansion node of the distributed storage cluster can read the marked creation message from the database and use the marked creation message to perform the volume mapping creation operation. It can be understood that when a new node is expanded into the distributed storage cluster, the new node can read the creation message that has completed the volume mapping creation from the database in sequence and complete the operation corresponding to the creation message. The new node is the expansion node, that is, the newly added node when the distributed storage cluster is expanded. The expansion node then creates the volume mapping that already exists on other nodes in the distributed storage cluster based on the relevant volume mapping information saved in the database. If the expansion node fails to successfully create the volume mapping, the relevant failure information will be reported to the master node, and the master node will record the failure information in the form of an alarm and inform the relevant management personnel to handle it. This ensures that when creating volume mappings, a certain order is maintained within each node. At the same time, it ensures that corresponding volume mappings are also created on the expanded nodes, thereby solving the problem of business unavailability that may be caused by the absence of volume mappings on the new expanded nodes of the distributed storage cluster. In other words, when a new node is expanded, since the messages in the target message queue still exist and the order is guaranteed, the volume mapping creation operation can be easily completed on the new node, thereby improving product reliability.

[0070] For the specific contents of the above steps S21 to S24, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0071] It can be seen that the embodiment of the present application is implemented through the intervention of the target message queue, that is, the master node receives the creation request corresponding to the creation of the volume mapping, sends the corresponding creation message to the target message queue, and then receives the creation result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation, and then determines whether to display the slave node information and volume mapping information based on the creation result, and after completing the creation of the volume mapping, marks the creation message used when the slave node creates the volume mapping, and saves the marked creation message to the database, thereby ensuring that the corresponding volume mapping is also created on the expanded node. That is, the master node and the slave node of the present application interact in the form of a message queue, which can solve the problem of too long time or excessive resource consumption when creating volume mapping in a large-scale cluster, can reduce the pressure on the master node, and improve the efficiency of volume mapping creation.

[0072] See also Figure 3 As shown, the embodiment of the present invention discloses a specific volume mapping management method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.

[0073] Step S31: receiving a creation request corresponding to volume mapping, and assembling a corresponding creation message based on the creation request.

[0074] Step S32: Send the creation message to the target message queue.

[0075] Step S33: Receive the creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is the result corresponding to whether the volume mapping is successfully created when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation.

[0076] For the specific contents of the above steps S31 to S33, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0077] Step S34: parse the creation result to obtain a corresponding parsed result.

[0078] In this embodiment, after receiving the creation results returned by the slave nodes, the master node in the distributed storage cluster parses the creation results to obtain corresponding parsed results.

[0079] Step S35: If the parsing result indicates that the slave node fails to create the volume mapping, the node information of the slave node and the volume mapping information corresponding to the volume mapping are displayed.

[0080] In this embodiment, the creation result is parsed to obtain a corresponding parsed result. If the parsed result indicates that the slave node failed to successfully create the volume mapping, the node information of the slave node and the volume mapping information corresponding to the volume mapping are displayed. It is understandable that the slave node information for successfully creating the volume mapping and the volume mapping information are displayed in the form of an alarm to prompt the user to process the slave node for which the volume mapping was not successfully created. After the processing is completed, the user is allowed to manually delete the corresponding alarm. However, when the user manually deletes the alarm, it is necessary to check whether the volume mapping actually exists on the corresponding node. Only if the check passes is the user allowed to delete it; otherwise, the alarm cannot be deleted. Alternatively, the alarm is proactively eliminated through automatic system detection. That is, after receiving the creation message returned by the slave node indicating that the volume mapping was not successfully created, the master node initiates a timed polling mechanism. When it detects that the corresponding volume mapping has been created on the slave node, the master node proactively eliminates the alarm. In this embodiment, providing failure information to the user through an alarm can improve the user experience.

[0081] It can be seen that the embodiment of the present application involves the target message queue, that is, the master node receives the creation request corresponding to the creation of the volume mapping, sends the corresponding creation message to the target message queue, and then receives the creation result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation, and then determines whether to display the slave node information and volume mapping information based on the creation result. That is, the master node and the slave node interact in the form of a message queue, which can solve the problem of too long time or excessive resource consumption when creating volume mapping in a large-scale cluster, can reduce the pressure on the master node, improve the creation efficiency of volume mapping and enhance the user experience.

[0082] See also Figure 4 As shown, the embodiment of the present invention discloses a specific volume mapping management method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.

[0083] Step S41: receiving a creation request corresponding to volume mapping, and assembling a corresponding creation message based on the creation request.

[0084] Step S42: Send the creation message to the target message queue.

[0085] Step S43: Receive the creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is the result corresponding to whether the volume mapping is successfully created when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation.

[0086] Step S44: parse the creation result to obtain a corresponding parsed result.

[0087] Step S45: If the parsed result indicates that the slave node fails to create the volume mapping, the node information of the slave node and the volume mapping information corresponding to the volume mapping are assembled to obtain corresponding alarm information, and the alarm information is displayed.

[0088] In this embodiment, after parsing the creation result to obtain a corresponding parsed result, if the parsed result indicates that the volume mapping was not successfully created on the slave node, the node information of the slave node and the volume mapping information corresponding to the volume mapping are assembled to obtain a corresponding alarm message, and the alarm message is displayed. In other words, the node information of the slave nodes for which the volume mapping was not successfully created and the volume mapping information are assembled into pieces of alarm information, and the alarm information is displayed to prompt the user to manually create the volume mapping on each slave node for which the volume mapping was not successfully created.

[0089] It can be seen that the embodiment of the present application intervenes through the target message queue, that is, the master node receives the creation request corresponding to the creation of the volume mapping, sends the corresponding creation message to the target message queue, and then receives the creation result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation, and then determines whether to display the slave node information and volume mapping information based on the creation result. That is, the master node and the slave node interact in the form of a message queue, which can solve the problem of too long time or excessive resource consumption when creating volume mapping in a large-scale cluster, avoids the problem of excessive pressure on the master node caused by multi-threading, and also avoids the time-consuming problem caused by creating volume mapping by traversing the nodes one by one. Without increasing the time consumption, it can reduce the pressure on the master node and improve the efficiency of volume mapping creation. Moreover, the complete creation result processing logic can avoid the situation where business is unavailable due to the absence of the required volume mapping on some nodes.

[0090] For example, first, after receiving the creation request for creating a volume mapping, the master node of the distributed storage cluster parses the creation request and assembles the parsed volume mapping name and other information into a message in a specified format to obtain a corresponding creation message, and sends the creation message to the target message queue. The slave node monitors the target message queue. When the slave node monitors that there is a new creation message in the target message queue, it obtains the content of the creation message, and performs a creation operation on the local node according to the obtained volume mapping name and other information. After the volume mapping is created, the creation result is returned to the master node. After receiving the creation result returned by each node, the master node parses the creation result. The node information and volume mapping information of failed creation will be displayed to the user in the form of an alarm, and the user will be prompted to process the failed node. After the processing is completed, the user is allowed to manually delete the corresponding alarm. However, when the user manually deletes the alarm, it is necessary to go to the corresponding node to detect whether the volume mapping actually exists. Only if the detection is passed, that is, the volume mapping actually exists on the node, the user is allowed to delete it, otherwise it cannot be deleted. At the same time, the alarm can also be actively eliminated through automatic detection by the system. After receiving the message from the slave node that the volume mapping was not successfully created, the master node starts the timed polling mechanism. When it detects that the creation of the corresponding volume mapping has been completed on the slave node, it actively eliminates the alarm. At the same time, it also solves the problem of creating volume mapping on the new node to ensure that the new node can also handle the business after the cluster is expanded due to business needs, thereby improving product reliability.

[0091] Correspondingly, the embodiment of the present application also discloses a volume mapping management device, which is applied to the master node corresponding to the distributed storage cluster, see Figure 5 As shown, the device includes:

[0092] A request receiving module 11 is configured to receive a creation request corresponding to creating a volume mapping;

[0093] A message assembling module 12, configured to assemble a corresponding creation message based on the creation request;

[0094] A message sending module 13 is used to send the creation message to a target message queue;

[0095] A result receiving module 14 is configured to receive a creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is a result corresponding to whether the volume mapping is successfully created when the slave node executes the volume mapping creation operation using the creation message in the target message queue;

[0096] The information display module 15 is configured to determine whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result.

[0097] As can be seen from the above, the embodiment of the present application intervenes through the target message queue, that is, the master node receives the creation request corresponding to the creation of the volume mapping, sends the corresponding creation message to the target message queue, and then receives the creation result obtained when the slave node uses the creation message in the target message queue to perform the volume mapping creation operation, and then determines whether to display the slave node information and volume mapping information based on the creation result. That is, the master node and the slave node interact in the form of a message queue, which can solve the problem of too long time or excessive resource consumption when creating volume mapping in a large-scale cluster, can reduce the pressure on the master node, and improve the creation efficiency of the volume mapping.

[0098] In some specific embodiments, the request receiving module 11 may specifically include:

[0099] A request receiving unit, configured to receive an HTTP request corresponding to creating a volume mapping;

[0100] In some specific embodiments, the message assembly module 12 may specifically include:

[0101] The first message assembling unit is used to assemble a corresponding creation message based on the HTTP creation request.

[0102] In some specific embodiments, the message assembly module 12 may specifically include:

[0103] The second message assembling unit is used to parse the creation request to obtain corresponding parsed data, and assemble the parsed data according to a preset target format to obtain a corresponding creation message.

[0104] In some specific embodiments, the volume mapping management device may further include:

[0105] a message marking module, configured to mark the creation message in the target message queue used when the slave node creates the volume mapping;

[0106] The message saving module is used to save the marked creation message to the database so that the expansion node of the distributed storage cluster can read the marked creation message from the database and use the marked creation message to perform the volume mapping creation operation.

[0107] In some specific embodiments, the information display module 15 may specifically include:

[0108] A result parsing unit, used to parse the creation result to obtain a corresponding parsed result;

[0109] The first information display unit is configured to display the node information of the slave node and the volume mapping information corresponding to the volume mapping when the parsing result indicates that the slave node fails to create the volume mapping.

[0110] In some specific embodiments, the information display module 15 may specifically include:

[0111] an information assembling unit, configured to assemble the node information of the slave node and the volume mapping information corresponding to the volume mapping to obtain corresponding alarm information;

[0112] An information display unit is used to display the warning information.

[0113] Furthermore, an embodiment of the present application also provides an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.

[0114] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the volume mapping management method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0115] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0116] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0117] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, and can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of implementing the volume mapping management method disclosed in any of the aforementioned embodiments and executed by the electronic device 20, the computer program 222 can further include computer programs capable of implementing other specific tasks.

[0118] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the volume mapping management method steps disclosed in any of the aforementioned embodiments are implemented.

[0119] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0120] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0121] The above is a detailed introduction to the volume mapping management method, device, equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A volume mapping management method, characterized in that: Applicable to the master node corresponding to the distributed storage cluster, including: Receive a creation request corresponding to creating a volume mapping, and assemble a corresponding creation message based on the creation request; Sending the creation message to a target message queue; receiving a creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is a result corresponding to whether the volume mapping is successfully created when the slave node executes the volume mapping creation operation using the creation message in the target message queue; determining whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result; After receiving the creation result of the volume mapping returned by each slave node in the distributed storage cluster, the method further includes: marking the creation message in the target message queue used by the slave node when creating the volume mapping; The marked creation message is saved in a database, so that the expansion node of the distributed storage cluster reads the marked creation message from the database and uses the marked creation message to perform the volume mapping creation operation.

2. The volume mapping management method according to claim 1, wherein: The receiving a creation request corresponding to the volume mapping includes: Receive HTTP request corresponding to creating volume mapping; Accordingly, assembling a corresponding creation message based on the creation request includes: A corresponding creation message is assembled based on the HTTP creation request.

3. The volume mapping management method according to claim 1, wherein: The assembling of a corresponding creation message based on the creation request includes: The creation request is parsed to obtain corresponding parsed data, and the parsed data is assembled according to a preset target format to obtain a corresponding creation message.

4. The volume mapping management method according to claim 1, wherein: The operation of executing volume mapping creation by using the creation message in the target message queue includes: Real-time monitoring of whether there is a new creation message in the target message queue; When it is detected that there is a new create message in the target message queue, obtaining the new create message in the target message queue; The volume mapping creation operation is performed according to the content of the new creation message.

5. The volume mapping management method according to any one of claims 1 to 4, characterized in that: The determining, based on the creation result, whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping includes: Parsing the creation result to obtain a corresponding parsed result; If the parsing result indicates that the slave node fails to successfully create the volume mapping, the node information of the slave node and the volume mapping information corresponding to the volume mapping are displayed.

6. The volume mapping management method according to claim 5, characterized in that: The displaying of the node information of the slave node and the volume mapping information corresponding to the volume mapping includes: The node information of the slave node and the volume mapping information corresponding to the volume mapping are assembled to obtain corresponding alarm information, and the alarm information is displayed.

7. A volume mapping management device, characterized in that: Applicable to the master node corresponding to the distributed storage cluster, including: A request receiving module, configured to receive a creation request corresponding to creating a volume mapping; A message assembly module, configured to assemble a corresponding creation message based on the creation request; A message sending module, configured to send the creation message to a target message queue; A result receiving module is configured to receive a creation result of the volume mapping returned by each slave node in the distributed storage cluster; the creation result is a result corresponding to whether the volume mapping is successfully created when the slave node executes the volume mapping creation operation using the creation message in the target message queue; an information display module, configured to determine whether to display the node information of the slave node and the volume mapping information corresponding to the volume mapping based on the creation result; Also includes: a message marking module, configured to mark the creation message in the target message queue used when the slave node creates the volume mapping; The message saving module is used to save the marked creation message to the database so that the expansion node of the distributed storage cluster can read the marked creation message from the database and use the marked creation message to perform the volume mapping creation operation.

8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the volume mapping management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the volume mapping management method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Target management method of distributed storage cluster and related components

    CN114443318A