Method, system, equipment and medium for reserving storage cluster LUN

文档序号:614835 发布日期:2021-05-07 浏览:2次 中文

阅读说明:本技术 一种预留存储集群lun的方法、系统、设备及介质 (Method, system, equipment and medium for reserving storage cluster LUN ) 是由 李大生 宋腾 于 2020-12-25 设计创作,主要内容包括:本发明公开了一种预留存储集群LUN的方法、系统、设备和存储介质,方法包括:响应于存储集群将虚拟磁盘映射到主机,获取虚拟磁盘映射的控制器的当前信息以及控制器所在组信息;响应于控制器接收到主机预留命令,根据控制器的当前信息以及控制器所在组信息确定保存控制器预留信息的地址,并根据地址确定存储集群中是否存在控制器的预留信息;响应于存储集群中存在控制器的预留信息,判断预留信息中的第一主机的信息与主机的信息是否一致;以及响应于预留信息中的第一主机的信息与主机的信息不一致,产生预留冲突的错误码并将错误码发送给主机。本发明提高了存储设备对资源的利用率,减少了机箱端口状态转换的时间并降低了发现频率。(The invention discloses a method, a system, equipment and a storage medium for reserving a storage cluster LUN, wherein the method comprises the following steps: mapping the virtual disk to the host in response to the storage cluster, and acquiring current information of a controller mapped by the virtual disk and information of a group where the controller is located; responding to a host reservation command received by the controller, determining an address for storing the reservation information of the controller according to the current information of the controller and the group information of the controller, and determining whether the reservation information of the controller exists in the storage cluster according to the address; responding to the reserved information of the controller in the storage cluster, and judging whether the information of the first host in the reserved information is consistent with the information of the host; and in response to the information of the first host and the information of the host being inconsistent in the reservation information, generating an error code of the reservation conflict and sending the error code to the host. The invention improves the utilization rate of the storage equipment to the resources, reduces the time for the state conversion of the chassis port and reduces the discovery frequency.)

1. A method of reserving a storage cluster LUN, comprising the steps of:

mapping the virtual disk to the host in response to the storage cluster, and acquiring current information of a controller mapped by the virtual disk and information of a group where the controller is located;

responding to a host reservation command received by a controller, determining an address for storing controller reservation information according to current information of the controller and group information of the controller, and determining whether the reservation information of the controller exists in a storage cluster according to the address;

responding to the reserved information of the controller in the storage cluster, and judging whether the information of the first host in the reserved information is consistent with the information of the host; and

and in response to the information of the first host and the information of the host in the reservation information being inconsistent, generating an error code of the reservation conflict and sending the error code to the host.

2. The method of claim 1, further comprising: storing the group information of the controller in cluster data of all nodes of the storage cluster;

the acquiring of the current information of the controller mapped by the virtual disk and the information of the group where the controller is located includes: and acquiring the group information of the controller from the cluster data of any node of the storage cluster.

3. The method of claim 1, further comprising:

in response to the controller's reservation information not being present in the storage cluster, updating the reservation information in accordance with the host's information.

4. The method of claim 1, wherein generating the error code for the reservation collision and sending the error code to the host comprises:

judging whether the priority of the first host in the reserved information is greater than that of the host; and

in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

5. A system for reserving a storage cluster LUN, comprising:

the system comprises an acquisition module, a storage module and a management module, wherein the acquisition module is configured to respond to a storage cluster to map a virtual disk to a host and acquire current information of a controller mapped by the virtual disk and information of a group where the controller is located;

the determining module is configured to respond to a host reservation command received by a controller, determine an address for storing the controller reservation information according to the current information of the controller and the group information of the controller, and determine whether the reservation information of the controller exists in the storage cluster according to the address;

the judging module is configured to respond to the reserved information of the controller in the storage cluster and judge whether the information of the first host in the reserved information is consistent with the information of the host; and

and the feedback module is configured to respond to the inconsistency between the information of the first host and the information of the host in the reservation information, generate an error code of a reservation conflict and send the error code to the host.

6. The system of claim 5, further comprising:

and the storage module is configured to store the group information of the controller in the cluster data of all the nodes of the storage cluster.

7. The system of claim 5, further comprising:

and the updating module is configured to respond to the situation that the reserved information of the controller does not exist in the storage cluster, and update the reserved information according to the information of the host.

8. The system of claim 5, wherein the feedback module is configured to:

judging whether the priority of the first host in the reserved information is greater than that of the host; and

in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

9. A computer device, comprising:

at least one processor; and

a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 4.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.

Technical Field

The present invention relates to the field of storage, and in particular, to a method, a system, a computer device, and a readable medium for reserving a storage cluster LUN.

Background

With the development of large data, the demand for large-sized high-capacity disk array systems is increasing. The number of memory controllers for high-end memory is generally no less than four. Compared with the double-control architecture of medium-low-end storage, the high-end multi-control storage needs to deal with the standard reservation problem of SCSI protocol processing among multiple double controls.

Disclosure of Invention

In view of this, an object of the embodiments of the present invention is to provide a method, a system, a computer device, and a computer readable storage medium for reserving a storage cluster LUN, in which information of a group in which a controller is located is added, and an address for storing reservation information is determined by information of the group in which the controller is located and the information of the controller, so as to reduce time for state transition of a chassis port and reduce frequency of discovery, thereby reducing influence on service performance of a user as much as possible.

Based on the above object, an aspect of the embodiments of the present invention provides a method for reserving a storage cluster LUN, including the following steps: mapping the virtual disk to the host in response to the storage cluster, and acquiring current information of a controller mapped by the virtual disk and information of a group where the controller is located; responding to a host reservation command received by the controller, determining an address for storing the reservation information of the controller according to the current information of the controller and the group information of the controller, and determining whether the reservation information of the controller exists in the storage cluster according to the address; responding to the reserved information of the controller in the storage cluster, and judging whether the information of the first host in the reserved information is consistent with the information of the host; and in response to the information of the first host and the information of the host being inconsistent in the reservation information, generating an error code of the reservation conflict and sending the error code to the host.

In some embodiments, the method further comprises: storing the group information of the controller in cluster data of all nodes of the storage cluster;

the acquiring of the current information of the controller mapped by the virtual disk and the information of the group where the controller is located includes: and acquiring the group information of the controller from the cluster data of any node of the storage cluster.

In some embodiments, the method further comprises: in response to the controller's reservation information not being present in the storage cluster, updating the reservation information in accordance with the host's information.

In some embodiments, said generating and sending a reservation conflicting error code to said host comprises: judging whether the priority of the first host in the reserved information is greater than that of the host; and in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

In another aspect of the embodiments of the present invention, a reserved storage cluster LUN system is further provided, including: the system comprises an acquisition module, a storage module and a management module, wherein the acquisition module is configured to respond to a storage cluster to map a virtual disk to a host and acquire current information of a controller mapped by the virtual disk and information of a group where the controller is located; the determining module is configured to respond to a host reservation command received by a controller, determine an address for storing the controller reservation information according to the current information of the controller and the group information of the controller, and determine whether the reservation information of the controller exists in the storage cluster according to the address; the judging module is configured to respond to the reserved information of the controller in the storage cluster and judge whether the information of the first host in the reserved information is consistent with the information of the host; and the feedback module is configured to respond to the inconsistency between the information of the first host and the information of the host in the reservation information, generate an error code of a reservation conflict and send the error code to the host.

In some embodiments, the system further comprises: and the storage module is configured to store the group information of the controller in the cluster data of all the nodes of the storage cluster.

In some embodiments, the system further comprises: and the updating module is configured to respond to the situation that the reserved information of the controller does not exist in the storage cluster, and update the reserved information according to the information of the host.

In some embodiments, the feedback module is configured to: judging whether the priority of the first host in the reserved information is greater than that of the host; and in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.

In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.

The invention has the following beneficial technical effects: the information of the group where the controller is located is added, and the address for storing the reserved information is determined through the information of the group where the controller is located and the information of the controller, so that the time for converting the state of the port of the case is shortened, the discovery frequency is reduced, and the influence on the service performance of a user is reduced as much as possible.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.

FIG. 1 is a schematic diagram of an embodiment of a method for reserving a storage cluster LUN according to the present invention;

fig. 2 is a schematic diagram of a hardware structure of an embodiment of a computer device for reserving a storage cluster LUN according to the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.

It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.

In view of the foregoing, in a first aspect of the embodiments of the present invention, an embodiment of a method for reserving a storage cluster LUN is provided. Fig. 1 is a schematic diagram illustrating an embodiment of a method for reserving a storage cluster LUN according to the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:

s1, mapping the virtual disk to the host in response to the storage cluster, and acquiring the current information of the controller mapped by the virtual disk and the group information of the controller;

s2, responding to the host reservation command received by the controller, determining and storing the address of the controller reservation information according to the current information of the controller and the group information of the controller, and determining whether the reservation information of the controller exists in the storage cluster according to the address;

s3, responding to the reserved information of the controller in the storage cluster, and judging whether the information of the first host in the reserved information is consistent with the information of the host; and

and S4, responding to the inconsistency between the information of the first host and the information of the host in the reservation information, generating an error code of the reservation conflict and sending the error code to the host.

The embodiment of the invention increases the group information of the controller on the basis of keeping the controller ID (identification) reserved by the LUN (logical Unit Number) standard, and identifies the unique controller through the controller group information and the controller information. The embodiment of the invention can realize the standard reservation of the multi-controller to the LUN so as to ensure the integrity of the data in the multi-controller cluster environment.

In some embodiments, the method further comprises: and saving the group information of the controller in the cluster data of all the nodes of the storage cluster. The acquiring of the current information of the controller mapped by the virtual disk and the information of the group where the controller is located includes: and acquiring the group information of the controller from the cluster data of any node of the storage cluster. And expanding a data structure for storing the cluster information, and adding the group information of the controller in the data structure, wherein the information needs to be stored in the cluster data of all nodes of the cluster.

And mapping the virtual disk to the host in response to the storage cluster, and acquiring the current information of the controller mapped by the virtual disk and the information of the group where the controller is located. When the storage cluster maps the virtual disk to the host, the controller mapped by the virtual disk and the group information of the controller need to be acquired and stored. The current information of the controller includes a controller ID.

And in response to the controller receiving a host reservation command, determining an address for storing the reservation information of the controller according to the current information of the controller and the group information of the controller, and determining whether the reservation information of the controller exists in the storage cluster according to the address. When the controller in the cluster receives a host reserve instruction, an address for storing the reserved information of the controller is found from the cluster information through the node and cluster interaction interface according to the group information of the controller and the ID of the controller, and whether the reserved information exists in the current controller is determined according to the defined data structure analysis.

And responding to the reserved information of the controller in the storage cluster, and judging whether the information of the first host in the reserved information is consistent with the information of the host. And in response to the information of the first host and the information of the host in the reservation information being inconsistent, generating an error code of the reservation conflict and sending the error code to the host. If a reservation record exists in the cluster information and the host/controller is consistent with the record in the cluster information, the reservation process may continue.

In some embodiments, said generating and sending a reservation conflicting error code to said host comprises: judging whether the priority of the first host in the reserved information is greater than that of the host; and in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

In some embodiments, the method further comprises: in response to the controller's reservation information not being present in the storage cluster, updating the reservation information in accordance with the host's information. If no record exists in the cluster information, the cluster data is successfully updated, and the reservation processing can be continued.

It should be particularly noted that, the steps in the embodiments of the method for reserving a storage cluster LUN described above may be mutually intersected, replaced, added, or deleted, and therefore, these methods for reserving a storage cluster LUN by reasonable permutation and combination transformation also belong to the scope of the present invention, and the scope of the present invention should not be limited to the embodiments.

In view of the above object, a second aspect of the embodiments of the present invention provides a system for reserving a storage cluster LUN, including: the system comprises an acquisition module, a storage module and a management module, wherein the acquisition module is configured to respond to a storage cluster to map a virtual disk to a host and acquire current information of a controller mapped by the virtual disk and information of a group where the controller is located; the determining module is configured to respond to a host reservation command received by a controller, determine an address for storing the controller reservation information according to the current information of the controller and the group information of the controller, and determine whether the reservation information of the controller exists in the storage cluster according to the address; the judging module is configured to respond to the reserved information of the controller in the storage cluster and judge whether the information of the first host in the reserved information is consistent with the information of the host; and the feedback module is configured to respond to the inconsistency between the information of the first host and the information of the host in the reservation information, generate an error code of a reservation conflict and send the error code to the host.

In some embodiments, the system further comprises: and the storage module is configured to store the group information of the controller in the cluster data of all the nodes of the storage cluster.

In some embodiments, the system further comprises: and the updating module is configured to respond to the situation that the reserved information of the controller does not exist in the storage cluster, and update the reserved information according to the information of the host.

In some embodiments, the feedback module is configured to: judging whether the priority of the first host in the reserved information is greater than that of the host; and in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, mapping the virtual disk to the host in response to the storage cluster, and acquiring the current information of the controller mapped by the virtual disk and the group information of the controller; s2, responding to the host reservation command received by the controller, determining and storing the address of the controller reservation information according to the current information of the controller and the group information of the controller, and determining whether the reservation information of the controller exists in the storage cluster according to the address; s3, responding to the reserved information of the controller in the storage cluster, and judging whether the information of the first host in the reserved information is consistent with the information of the host; and S4, responding to the information of the first host in the reservation information is inconsistent with the information of the host, generating an error code of the reservation conflict and sending the error code to the host.

In some embodiments, the steps further comprise: and saving the group information of the controller in the cluster data of all the nodes of the storage cluster.

In some embodiments, the steps further comprise: in response to the controller's reservation information not being present in the storage cluster, updating the reservation information in accordance with the host's information.

In some embodiments, said generating and sending a reservation conflicting error code to said host comprises: judging whether the priority of the first host in the reserved information is greater than that of the host; and in response to the priority of the first host in the reservation information not being greater than the host, updating the reservation information based on the information of the host.

Fig. 2 is a schematic hardware structural diagram of an embodiment of the computer device for reserving a storage cluster LUN according to the present invention.

Taking the apparatus shown in fig. 2 as an example, the apparatus includes a processor 301 and a memory 302, and may further include: an input device 303 and an output device 304.

The processor 301, the memory 302, the input device 303 and the output device 304 may be connected by a bus or other means, and fig. 2 illustrates the connection by a bus as an example.

The memory 302 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for reserving a storage cluster LUN in the embodiment of the present application. The processor 301 executes various functional applications and data processing of the server by running the nonvolatile software program, instructions and modules stored in the memory 302, that is, implements the method of reserving a storage cluster LUN of the above-described method embodiment.

The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the method of reserving a storage cluster LUN, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 302 optionally includes memory located remotely from processor 301, which may be connected to a local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The input device 303 may receive information such as a user name and a password that are input. The output means 304 may comprise a display device such as a display screen.

Program instructions/modules corresponding to one or more methods of reserving a storage cluster LUN are stored in the memory 302 and, when executed by the processor 301, perform the method of reserving a storage cluster LUN in any of the above-described method embodiments.

Any embodiment of a computer device implementing the method for reserving a storage cluster LUN described above may achieve the same or similar effects as any of the previous method embodiments corresponding thereto.

The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.

Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware by a computer program, and the program of the method for reserving a storage cluster LUN may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.

The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.

It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.

The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.

It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据传输方法、PCIE系统、设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!