A volume mapping management method, system and related device for distributed storage
Volume mapping is managed in group mode, which optimizes node selection and interface calling, solves the problem of long response time for volume mapping in large-scale clusters, and achieves efficient volume mapping management and improved response speed.
Patent Information
- Application Number
- CN202210331086.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-03-31
AI Technical Summary
The existing volume mapping management solution takes a long time to respond in large-scale clusters, resulting in command freezes, affecting customer use, and multiple calls to third-party interfaces lead to low efficiency.
Use grouping mode to manage volume mapping. By receiving volume mapping requests, determine the target grouping, select the corresponding node to execute the mapping command according to the set number of paths, use a loop recursive algorithm to generate grouping information, and generate a json configuration file to optimize node selection and shorten the response. time.
It greatly shortens the volume mapping response time, improves processing efficiency, reduces the number of third-party interface calls, and improves the system's response speed and stability.
Smart Images

Figure CN114647385B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed storage, and in particular to a volume mapping management method, system and related devices for distributed storage. Background Art
[0002] With the popularity of large-scale clusters, there are hundreds or thousands of nodes in the cluster, which puts higher requirements on the performance and response time of the storage management system. The existing volume mapping management solution is suitable for small-scale clusters. The management of targets, iqn and volume mapping are maintained independently, and the interfaces provided to third parties such as OpenStack are also independent. In this way, if a third party wants to mount a volume, it needs to call multiple interfaces of the storage system, resulting in a long response time, which seriously affects the use of customers. On the other hand, the volume mapping management of the storage system itself needs to be executed on each node in the cluster at the same time because it is a full path when executing commands. With the increase in the number of nodes and the increase in concurrency, command jams often occur.
[0003] Therefore, how to achieve efficient volume mapping and management is a technical problem that those skilled in the art need to solve urgently. Summary of the invention
[0004] The purpose of the present application is to provide a distributed storage volume mapping management method and system, a computer-readable storage medium and a storage device, which can reduce the volume mapping response time and improve the volume mapping processing efficiency.
[0005] In order to solve the above technical problems, the present application provides a volume mapping management method for distributed storage, and the specific technical solution is as follows:
[0006] receiving a volume mapping request;
[0007] Determining a target group corresponding to the volume mapping request;
[0008] A corresponding node is selected in the target group according to the set number of paths, and a mapping command corresponding to the volume mapping request is executed.
[0009] Optionally, before determining the target group corresponding to the volume mapping request, the method further includes:
[0010] Determine whether the number of nodes in the storage pool is greater than the preset value;
[0011] If not, set the grouping to one;
[0012] If so, the number of nodes and the number of paths under the storage pool are used as parameters, and a cyclic recursive algorithm is used to generate grouping information.
[0013] Optionally, before selecting a corresponding node in the target group according to the set number of paths, the method further includes:
[0014] Generate a json configuration file with storage pool information, node information and path information in the form of key-value pairs;
[0015] Then, selecting a corresponding node in the target group according to the set number of paths includes:
[0016] In the target group, the json configuration file is called according to the set path number to select the corresponding node.
[0017] Optionally, selecting a corresponding node in the target group according to a set number of paths includes:
[0018] Convert the last three digits of the volume name from hexadecimal to decimal;
[0019] Modulo the number of targets to select the target to be bound;
[0020] The group to be selected is determined by taking the modulus with the number of groups, and the target node is obtained.
[0021] Optionally, after obtaining the target node, the following is also included:
[0022] The volume mapping command is executed using the target target and the target node, and the IP is searched through the node, and path information is returned.
[0023] Optionally, also include:
[0024] When receiving a volume mount request from the cloud computing management platform, a single volume mount interface and corresponding path information are provided.
[0025] The present application provides a distributed storage volume mapping management system, including:
[0026] A request receiving module, used for receiving a volume mapping request;
[0027] A grouping module, used to determine a target group corresponding to the volume mapping request;
[0028] The volume mapping module is used to select a corresponding node in the target group according to a set number of paths, and execute a mapping command corresponding to the volume mapping request.
[0029] Optionally, also include:
[0030] The cluster configuration module is used to determine whether the number of nodes under the storage pool is greater than a preset value; if not, the group is set as one group; if so, the number of nodes and the number of paths under the storage pool are used as parameters, and a cyclic recursive algorithm is used to generate grouping information.
[0031] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned method when executed by a processor.
[0032] The present application also provides a storage device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.
[0033] The present application provides a volume mapping management method for distributed storage, comprising: receiving a volume mapping request; determining a target group corresponding to the volume mapping request; selecting a corresponding node in the target group according to a set number of paths, and executing a mapping command corresponding to the volume mapping request.
[0034] This application uses a grouping mode to manage volume mapping. When a volume mapping request is received and volume mapping management is required, only nodes are selected in the selected group according to the set number of paths and the mapping command is executed. This can greatly shorten the response time and improve the efficiency of volume mapping management.
[0035] The present application also provides a distributed storage volume mapping management system, a computer-readable storage medium and a storage device, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A flow chart of a volume mapping management method for distributed storage provided by an embodiment of the present application;
[0038] Figure 2 A flow chart of a volume mapping management method for distributed storage provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] Please refer to Figure 1 , Figure 1 A flow chart of a volume mapping management method for distributed storage provided in an embodiment of the present application, the method comprising:
[0041] S101: receiving a volume mapping request;
[0042] S102: Determine a target group corresponding to the volume mapping request;
[0043] S103: Select a corresponding node in the target group according to the set number of paths, and execute a mapping command corresponding to the volume mapping request.
[0044] The following is an explanation of the distributed storage structure provided by this application. This application requires grouping and configuration management of the nodes in the cluster in advance. Specifically, the grouping can be performed according to the following steps:
[0045] Determine whether the number of nodes under the storage pool is greater than the preset value; if not, set the grouping to one group; if the number of nodes is greater than the preset value, use the number of nodes and the number of paths under the storage pool as parameters, and use a cyclic recursive algorithm to generate grouping information. The preset value is not limited here and can be set by those skilled in the art. It is easy to understand that no matter what the preset value is, it plays a role in determining the minimum number of nodes.
[0046] In addition, the storage pool information, node information and path information can also be generated into a json configuration file in the form of key-value pairs. When executing step S103, the json configuration file can be directly called in the target group according to the set number of paths to select the corresponding node. In other words, the json configuration file is used in the path selection algorithm.
[0047] After the storage management system is deployed through the WEB interface, a group of targets used by the cluster can be automatically created, for example, named target0-target7. By creating storage pools by grouping, the storage pool information, including the node information and path information of the pool, is automatically generated into a json configuration file in the form of key and value pairs, for example, a group.json configuration file can be generated. The execution efficiency of volume mapping can be improved by using both virtualized and non-virtualized application scenarios.
[0048] In distributed storage deployment, there are two scenarios: converged deployment and non-converged deployment. By setting up the network and calling the MON script, you can configure both the public IP and the cluster IP in the cluster configuration file. In the converged scenario, the two networks are the same. In order to adapt to the converged scenario, configure front_network in the management software configuration file ism.conf. When the service IP is parsed based on the subsequent return path information, the scenario is judged based on this field. After the cluster is deployed, the system collects the node network information in the cluster, generates node_ip.txt including the node name and IP information, and automatically generates a set of targets for the cluster to use, for example, it can be named target0-target7. Simply put, in the converged deployment mode, obtain front_neework in ism.conf; in the non-converged mode, obtain the public IP in icfs.conf. This application is compatible with both modes.
[0049] After the cluster is deployed, you need to create a storage pool. For large-scale clusters, you need to create it in the form of group division and generate a group.son configuration file, which includes the storage pool name, node name, and number of paths. The number of paths is not limited here, for example, it can be set to 5. If the number of nodes under the storage pool is less than 5, the value of path_num is the number of nodes.
[0050] When performing group analysis, take the number of paths as 5 as an example. When the number of nodes under the storage pool is less than or equal to 5, the generated group is one group. When the number of nodes is greater than 5, in order to ensure the load balance of the nodes, a loop recursive algorithm is used to generate group information. The parameters are the number of nodes and the number of paths under the storage pool. The number of paths is fixed to 5. The formal parameters are a and b. Take b as a, and the remainder of a and b as b. Call it repeatedly until the remainder of a and b is 0, then return a. Number of groups = number of nodes / loop recursive result. For example: there are 8 nodes under the storage pool and the number of paths is 5, so they need to be divided into 8 groups. A feasible group information is:
[0051] [[0,1,2,3,4],[1,2,3,4,5],[2,3,4,5,6],[3,4,5,6,7],[4,5,6,7,0],[5,6,7,0,1],[6,7,0,1,2],[7,0,1,2,3]]
[0052] Stored in the form of a two-dimensional array. When creating a volume, the last three digits of the volume name are intercepted. If it is not a number, a random number is automatically generated as the volume name. Then convert the last three hexadecimal digits of the volume name into decimal, and take the modulus of the converted decimal and the number of targets to select the target to be bound; take the modulus of the number of groups to obtain the index value of the required group information. For example, image110, the last three digits are converted to decimal and are 272, and 272%8=0, then target0 can be selected, and the group information with an index value of 0 is selected as the first group of information. Each group in the group information is the index value of the node, and finally the node with an index value of 0-4 is selected as the node to create the volume mapping. After selecting the node information and target information, ansible executes the volume mapping command, and then parses the service ip according to the selected node in combination with node_ip.txt. Among them, the converged and non-converged scenarios are distinguished by judging whether the front_network field exists in the ism.conf file. The service IP in the converged scenario is front_network, and the service IP in the non-converged scenario is public ip. The public ip can be obtained from the icfs.conf configuration file. Finally, the non-virtualized scenario displays volume mapping information, including the pool, volume, number of paths, and detailed path information. In the virtualized scenario, the volume is mounted through OpenStack, an interface is called, and path information is returned, which greatly shortens the interaction time and improves efficiency.
[0053] In addition, when receiving a volume mount request from the cloud computing management platform, a single volume mount interface and corresponding path information are provided. For other third parties, such as OpenStack, only a single volume mount interface can be provided. By merging interfaces, the number of interactions when docking with OpenStack is reduced, greatly improving response efficiency.
[0054] The embodiment of the present application adopts a grouping mode to manage volume mapping. When a volume mapping request is received and volume mapping management is required, only nodes are selected in the selected group according to the set number of paths, and the mapping command is executed. This can greatly shorten the response time and improve the efficiency of volume mapping management.
[0055] The following is an introduction to the distributed storage volume mapping management system provided in an embodiment of the present application. The volume mapping management system described below and the distributed storage volume mapping management method described above can refer to each other.
[0056] See also Figure 2 , Figure 2 This is a flow chart of a distributed storage volume mapping management method provided in an embodiment of the present application. The present application provides a distributed storage volume mapping management system, including:
[0057] A request receiving module, used for receiving a volume mapping request;
[0058] A grouping module, used to determine a target group corresponding to the volume mapping request;
[0059] The volume mapping module is used to select a corresponding node in the target group according to a set number of paths, and execute a mapping command corresponding to the volume mapping request.
[0060] Based on the above embodiments, as a preferred embodiment, it also includes:
[0061] The cluster configuration module is used to determine whether the number of nodes under the storage pool is greater than a preset value; if not, the group is set as one group; if so, the number of nodes and the number of paths under the storage pool are used as parameters, and a cyclic recursive algorithm is used to generate grouping information.
[0062] Based on the above embodiments, as a preferred embodiment, it also includes:
[0063] The configuration file generation module is used to generate a JSON configuration file in the form of key-value pairs with storage pool information, node information, and path information;
[0064] Correspondingly, the volume mapping module is a module for calling the json configuration file to select a corresponding node in the target group according to the set number of paths.
[0065] Based on the above embodiment, as a preferred embodiment, the volume mapping module includes:
[0066] The node determination unit is used to convert the last three digits of the volume name from hexadecimal to decimal; take the modulus with the target number to select the target to be bound; take the modulus with the group number to determine the group to be selected, and obtain the target node.
[0067] Based on the above embodiments, as a preferred embodiment, it also includes:
[0068] The command response module is used to execute the volume mapping command using the target target and the target node, and to search the IP through the node and return the path information.
[0069] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0070] The present application also provides a storage device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the storage device may also include various network interfaces, power supplies and other components.
[0071] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the system provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0072] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0073] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A volume mapping management method for distributed storage, characterized in that: include: receiving a volume mapping request; Determining a target group corresponding to the volume mapping request; Selecting a corresponding node in the target group according to the set number of paths, and executing a mapping command corresponding to the volume mapping request; Before determining the target group corresponding to the volume mapping request, the method further includes: Determine whether the number of nodes in the storage pool is greater than the preset value; If not, set the grouping to one; If yes, using the number of nodes and the number of paths under the storage pool as parameters, a cyclic recursive algorithm is used to generate grouping information; Wherein, before selecting the corresponding node in the target group according to the set number of paths, the method further includes: Generate a json configuration file with storage pool information, node information and path information in the form of key-value pairs; Then, selecting a corresponding node in the target group according to the set number of paths includes: In the target group, the json configuration file is called according to the set path number to select the corresponding node.
2. The volume mapping management method according to claim 1, characterized in that: Selecting corresponding nodes in the target group according to the set number of paths includes: Convert the last three digits of the volume name from hexadecimal to decimal; Modulo the number of targets to select the target to be bound; The group to be selected is determined by taking the modulus with the number of groups, and the target node is obtained.
3. The volume mapping management method according to claim 2, characterized in that: After getting the target node, it also includes: The volume mapping command is executed using the target target and the target node, and the IP is searched through the node, and path information is returned.
4. The volume mapping management method according to claim 1, characterized in that: Also includes: When receiving a volume mount request from the cloud computing management platform, a single volume mount interface and corresponding path information are provided.
5. A volume mapping management system for distributed storage, characterized in that: include: A request receiving module, used for receiving a volume mapping request; The cluster configuration module is used to determine whether the number of nodes under the storage pool is greater than the preset value; If not, the group is set as one group; if so, the number of nodes and the number of paths under the storage pool are used as parameters, and a cyclic recursive algorithm is used to generate group information; A grouping module, used to determine a target group corresponding to the volume mapping request; A volume mapping module, configured to select a corresponding node in the target group according to a set number of paths, and execute a mapping command corresponding to the volume mapping request; Among them, it also includes: The configuration file generation module is used to generate a JSON configuration file in the form of key-value pairs with storage pool information, node information, and path information; Correspondingly, the volume mapping module is a module for calling the json configuration file to select a corresponding node in the target group according to the set number of paths.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the volume mapping management method for distributed storage as described in any one of claims 1 to 4 are implemented.
7. A storage device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the volume mapping management method for distributed storage as claimed in any one of claims 1 to 4 are implemented.
