Multi-control cluster SAN switching back-switching method and device
By realizing the establishment and switching of multiple data read and write links in the multi-control cluster system, the problem that the FC-SAN switching method of the dual-machine cluster cannot guarantee the normal operation of the service when both controllers fail, and the service continuity is achieved and system stability, and universal for IP-SAN and FC-SAN.
Patent Information
- Application Number
- CN202411560354.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The existing dual-cluster FC-SAN switching method cannot guarantee the normal operation of services when both controllers fail, and the solution is not universal and cannot be applied to IP-SAN.
A multi-control cluster SAN switchback method is proposed. By selecting a configuration controller in the multi-control cluster system to create storage pools and logical volumes, and creating virtual volumes and internal SAN mappings on the logical volume, multiple data reading and writing are realized. Link establishment. When the configuration controller fails, other controllers take over the service and perform SAN turn-back after the failure is restored to ensure that all controllers take over the service normally.
In a multi-control cluster system, when at least one controller fails or shuts down, SAN switches ensure normal service progress, and after failure recovery, all controllers can take over services normally through SAN turnaround, achieving business continuity and system stability . This method is compatible with IP-SAN and FC-SAN and is universal.
Smart Images

Figure CN119512818A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of SAN switching, and in particular relates to a multi-control cluster SAN switching back method and device. Background Art
[0002] SAN (Storage Area Network) is a high-speed network dedicated to storage operations, usually independent of computer local area networks. SAN connects hosts and storage devices together, and can provide professional communication channels for any host and any storage device on it. SAN separates storage devices from servers, realizing storage resource sharing at the server level. SAN introduces channel technology and network technology into the storage environment, providing a new type of network storage solution that can simultaneously meet the requirements of throughput, availability, reliability, scalability and manageability. SAN itself is a storage network that undertakes the task of data storage. By establishing a mapping between LUN groups, network groups, and host groups, the hosts in the host group can transmit data with the LUNs in the LUN group through the IP or FC (FibreChannel) in the network group. In a SAN network, all data transmission is carried out in a high-speed, high-bandwidth network.
[0003] The existing patent CN106888111A discloses a switching method for a dual-machine cluster FC-SAN, in which the user's business data is sent to each controller of the storage device through the SAN service. The storage device of the dual-machine cluster achieves high availability of the storage device by switching and managing the business between the two controllers to ensure that the user business is not interrupted when the controller is switched or the path is switched; after the controller is restored, the original business can be taken over. However, in a dual-control cluster environment, both controllers may fail, then the upper-level SAN will stop immediately, and it is impossible to ensure the normal operation of the business; at the same time, by modifying the driver of the fiber optic card, controlling the program in the driver, and then switching flexibly, the continuity of the server-side IO in the case of node failure switching is guaranteed. However, this solution is specifically for modifying a specific fiber optic card. In addition to FC-SAN, SAN also has IP-SAN, so it is not universal. Summary of the invention
[0004] The purpose of the present invention is to solve the problem raised in the background technology and to propose a multi-control cluster SAN switchback method.
[0005] To achieve the above object, the technical solution adopted by the present invention is: A multi-controller cluster SAN switchback method proposed in the present invention is applied to data reading and writing between a multi-controller cluster system and a host, and the data reading and writing between the multi-controller cluster system and the host includes a SAN normal state, a SAN switch state, and a SAN switchback state. The multi-controller cluster system includes n controllers, wherein: When all controllers are normal, that is, the SAN is in normal state, a storage pool is created on one controller among n controllers, and a logical volume is created on the storage pool. The preset controller is defined as the configuration controller. A first virtual volume is created on the logical volume, and then a first internal SAN mapping is created on the first virtual volume. The remaining n-1 non-configuration controllers all log in to the first internal SAN mapping, automatically generate corresponding first internal mapping volumes, and then second virtual volumes are respectively created for the first internal mapping volumes of the remaining n-1 non-configuration controllers, so as to establish a mapping relationship between each second virtual volume and the first virtual volume. An external SAN mapping is established between each virtual volume and the host, so that n data read and write links exist between the host and the multi-controller cluster system; When the configuration controller fails or shuts down during data reading and writing, that is, the SAN is switched, the pointers to the second virtual volumes of the remaining n-1 non-configuration controllers are empty, and the first internal SAN mapping is logged out, and a preset controller is selected from the remaining n-1 non-configuration controllers, and the storage pool and logical volume on the configuration controller are imported to the controller, and the controller is defined as the active controller; The second virtual volume on the active controller points to the imported logical volume, and a new second internal SAN mapping is created on the second virtual volume. The remaining n-2 non-configuration controllers all log in to the second internal SAN mapping, automatically generate corresponding second internal mapping volumes, and the second virtual volumes on the remaining n-2 non-configuration controllers point to corresponding second internal mapping volumes, respectively, so as to establish a mapping relationship between the second virtual volumes on the remaining n-2 non-configuration controllers and the second virtual volume on the active controller. At this time, there are n-1 data reading and writing links between the host and the multi-controller cluster system. When the configuration controller returns to normal during the data reading and writing process, that is, the SAN is switched back, the pointers of the second virtual volumes of the remaining n-1 non-configuration controllers are set to null, the storage pool and logical volume on the active controller are imported to the restored configuration controller, the second internal SAN mapping on the second virtual volume of the active controller is deleted, and then the remaining n-2 non-configuration controllers all log out of the second internal SAN mapping; A third virtual volume is created on the logical volume of the configuration controller after recovery, and then the same internal SAN mapping as that on the first virtual volume is created on the third virtual volume and named as the third internal SAN mapping. The remaining n-1 non-configuration controllers all log in to the third internal SAN mapping, and the corresponding third internal mapping volume is automatically generated. The second virtual volumes on the remaining n-1 non-configuration controllers point to the corresponding third internal mapping volumes respectively, so as to establish a mapping relationship between the second virtual and third virtual volumes on the remaining n-1 non-configuration controllers, and then an external SAN mapping is established between the third virtual volume and the host, so that n data reading and writing links are provided between the host and the multi-controller cluster system.
[0006] Preferably, in the SAN switching state, the preset controller is the controller that occupies the least resources.
[0007] Preferably, when at least two controllers fail or shut down during data reading and writing, when the failed or shut down controller is a non-configuration controller, the failed or shut down controller does not need to log in to the corresponding internal SAN mapping, and when the failed or shut down controller is a configuration controller, the SAN switching state operation is performed.
[0008] Preferably, the multi-controller cluster system further comprises a detection module, and the detection module detects whether each controller is faulty or shut down during the data reading and writing process.
[0009] Preferably, in the SAN switchback state, when importing the storage pool and logical volume on the active controller to the restored configuration controller, the storage pool and logical volume on the active controller are exported first, and then the exported storage pool and logical volume are imported to the restored configuration controller.
[0010] The present invention also proposes a multi-controller cluster SAN switchback device, comprising a processor and a memory storing a plurality of computer instructions, wherein the computer instructions implement the steps of the multi-controller cluster SAN switchback method when executed by the processor.
[0011] Compared with the prior art, the present invention has the following beneficial effects: 1. In the multi-controller cluster SAN switching and switching back method and device, when at least one controller fails or shuts down in the multi-controller cluster system, the remaining controllers can take over the services of the failed or shut down controller through SAN switching, so that the services between the multi-controller cluster system and the host can be carried out normally; when the failed controller recovers, all controllers in the multi-controller cluster system can take over the services normally through SAN switching back; 2. The internal SAN mapping and external SAN mapping in the multi-control cluster SAN switching and switching back method and device are not limited to whether IP-SAN or FC-SAN is used, and are both compatible and can achieve SAN switching or switching back status. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a module block diagram of the multi-control cluster SAN switch back method and device of the present invention; Figure 2 A flow chart of the SAN switching state of the present invention; Figure 3 This is a flow chart of the SAN switchback state of the present invention. DETAILED DESCRIPTION
[0013] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0014] like Figure 1-Figure 3 As shown, a multi-controller cluster SAN switching and switching back method is provided, which is applied to data reading and writing between the multi-controller cluster system and the host, and the data reading and writing between the multi-controller cluster system and the host includes the SAN normal state, SAN switching state and SAN switching back state. The multi-controller cluster system includes n controllers, wherein the multi-controller cluster system also includes physical hard disks (the number and type are not limited and can be set according to actual needs), providing storage space for the multi-controller cluster system, and various physical hard disks can be recognized by each controller.
[0015] This application is implemented by controlling the application tool of SAN. It is not limited to a specific storage management software architecture. It can be a kernel-state or user-state storage software architecture. This application is implemented based on the SPDK (Storage Performance Development Kit) software architecture. SPDK is a software library that improves storage performance. It aims to provide lower latency and higher throughput for storage applications. By eliminating the overhead of the operating system kernel, SPDK can achieve more efficient data access. SPDK provides a rich API interface to facilitate developers to integrate it into existing storage solutions.
[0016] The multi-control cluster system also includes a detection module, which detects whether each controller is faulty or shut down during the data reading and writing process; It should be noted that the detection module can check the operation status of each controller, and determine whether the configuration controller or non-configuration controller is shut down or faulty based on whether the internal network is connected and whether the controller health status returns a fault (whether the controller has an abnormal error), so as to determine whether to perform a SAN switching process.
[0017] The following describes the processes of the SAN normal state, SAN switching state, and SAN switchback state respectively through different embodiments: Example 1 In this embodiment, when all controllers are normal, that is, the SAN is in normal state (at this time, there is no faulty or shut down controller in the multi-controller cluster system), a storage pool is created on one controller among n controllers (the selection of the controller is not restricted and can be randomly selected), and a logical volume is created on the storage pool, and the preset controller is defined as a configuration controller (it should be noted that by creating a storage pool and a logical volume on the selected controller, the physical hard disk is divided into a storage space of the actual required size at the software layer, and the storage pool and the logical volume only exist on one configuration controller); A first virtual volume is created on the logical volume (the first virtual volume is used for the suspension and retry of the host-side IO in the subsequent SAN switching state and SAN switchback state, and the switching of the underlying link is completed during the retry process), and then a first internal SAN mapping is created on the first virtual volume (the internal SAN mapping is created through the internal network between the controllers. The internal network here can be based on the TCP / IP network, and the IP-SAN internal mapping is created at this time, or it can be based on the FC network, and the FC-SAN internal mapping is created at this time), and the remaining n-1 non-configuration controllers all log in to the first internal SAN mapping, and after logging in, the corresponding first internal mapping volume is automatically generated (that is, the remaining n-1 non-configuration controllers all automatically generate their own first internal mapping volumes), and then second virtual volumes are created for the first internal mapping volumes of the remaining n-1 non-configuration controllers respectively (the second virtual volume is used for the suspension and retry of the host-side IO in the subsequent SAN switching state and SAN switchback state, and the switching of the underlying link is completed during the retry process), so as to establish a mapping relationship between each second virtual volume and the first virtual volume; An external SAN mapping is established between each virtual volume and the host (that is, an external SAN mapping is established between the first virtual volume and n-1 second virtual volumes and the host, and the network between each virtual volume and the host can be based on a TCP / IP network, in which case an IP-SAN external mapping is created, or it can be based on an FC network, in which case an FC-SAN external mapping is created). Then, there are n data read and write links between the host and the multi-controller cluster system (the multipath block device with n links can be discovered and synthesized on the host side to perform data read and write operations).
[0018] It should be noted that there is no limit to the number of storage pools created on a configuration controller, and there is no limit to the number of logical volumes created on a storage pool. It can be set according to actual needs. The first virtual volume corresponds to the logical volume one-to-one (that is, one first virtual volume corresponds to one logical volume), and the first internal mapping volume of a non-configuration controller corresponds to the first virtual volume one-to-one, and the second virtual volume corresponds to the first internal mapping volume one-to-one.
[0019] The host is also provided with a host-side mapping volume. The external SAN mapping between each virtual volume and the host is to establish a mapping relationship with the host-side mapping volume.
[0020] Example 2 On the basis of Example 1, this embodiment further proposes that: when a configuration controller fails or shuts down during data reading and writing, that is, the SAN switching state (the failed or shut down configuration controller is disconnected in the multi-controller cluster system, and the first virtual volume and external SAN mapping corresponding to the configuration controller are lost. Since the communication link between the host side and all controllers will uniformly send IO to the first virtual volume of the configuration controller, the IO of all host sides cannot be normally sent to the logical volume of the multi-controller cluster system), the second virtual volumes of the remaining n-1 non-configuration controllers are pointed to empty (the IO of the host side is suspended), and the first internal SAN mapping is logged out. Select a preset controller from 1 non-configuration controller, and import the storage pool and logical volume on the configuration controller to this controller, and define this controller as the active controller; in the SAN switching state, the preset controller is the controller with the least resource usage (the multi-controller cluster system has a resource balancing allocation strategy, which will uniformly manage the resource allocation of each storage pool under multiple controllers, and try to evenly allocate the storage pool to each controller as much as possible to make the system run more stably. Therefore, according to the resource allocation strategy of the multi-controller cluster system, the storage pool and logical volume of the configuration controller are imported to a controller with the least resource usage, which is the active controller corresponding to the storage pool and logical volume); The second virtual volume on the active controller points to the imported logical volume (the second virtual volume on the active controller corresponds to the logical volume one-to-one. At this time, since the external SAN mapping of the second virtual volume on the active controller still exists and functions normally, the logical volume is mapped to the host again through the second virtual volume on the active controller, and the link from the host to the active controller is restored, that is, the host can see that there is a link that can send IO normally), and a new second internal SAN mapping is created on the second virtual volume. The remaining n-2 non-configuration controllers (that is, the n-2 non-configuration controllers except the active controller) all log in to the second internal SAN mapping. After logging in, the corresponding second internal mapping volume is automatically generated (that is, the remaining n-2 non-configuration controllers all automatically generate their own second internal mapping volumes, and the first The second internal mapping volume corresponds to the second virtual volume), and the second virtual volumes on the remaining n-2 non-configuration controllers point to the corresponding second internal mapping volumes (that is, the second virtual volumes on the remaining n-2 non-configuration controllers point to the second internal mapping volumes on the corresponding controllers), so that a mapping relationship is established between the second virtual volumes on the remaining n-2 non-configuration controllers and the second virtual volume on the active controller. At this time, there are n-1 data reading and writing links between the host and the multi-controller cluster system (because the external SAN mapping on the second virtual volume on the remaining n-2 non-configuration controllers still exists and functions normally, the host side can see that the newly added n-2 links can send IO normally), the SAN switching process is completed, and the data reading and writing between the multi-controller cluster system and the host can be carried out normally.
[0021] Example 3 On the basis of Example 1 and Example 2, this embodiment further proposes: when the configuration controller returns to normal during the data reading and writing process, that is, the SAN switchback state, the pointers of the second virtual volumes of the remaining n-1 non-configuration controllers are set to empty (IO on the host side is suspended), the storage pool and logical volume on the active controller are imported to the configuration controller after the normal recovery, the second internal SAN mapping on the second virtual volume of the active controller is deleted, and then the remaining n-2 non-configuration controllers all log out of the second internal SAN mapping; wherein, in the SAN switchback state, in the process of importing the storage pool and logical volume on the active controller to the configuration controller after the normal recovery, the storage pool and logical volume on the active controller are exported first, and then the exported storage pool and logical volume are imported to the configuration controller after the normal recovery.
[0022] A third virtual volume is created on the logical volume of the restored configuration controller (because the configuration controller fails or is shut down, the first virtual volume will be lost or abnormal, so it is necessary to recreate the virtual volume, that is, the third virtual volume, and the third virtual volume corresponds to the logical volume one by one), and then the same internal SAN mapping as that on the first virtual volume is created on the third virtual volume and named as the third internal SAN mapping. The remaining n-1 non-configuration controllers all log in to the third internal SAN mapping. After logging in, the corresponding third internal mapping volume is automatically generated (that is, the remaining n-1 non-configuration controllers all automatically generate their own third internal mapping volumes, and the third internal mapping volume corresponds to the third virtual volume), and the remaining n-1 non-configuration controllers The second virtual volumes on the remaining n-2 non-configuration controllers point to the corresponding third internal mapping volumes respectively (that is, the second virtual volumes on the remaining n-2 non-configuration controllers point to the third internal mapping volumes on the corresponding controllers respectively), and a mapping relationship is established between the second virtual and third virtual volumes on the remaining n-1 non-configuration controllers. Then, an external SAN mapping is established between the third virtual volume and the host. In this way, there are n data read and write links between the host and the multi-controller cluster system (because the external SAN mapping on the second virtual volume on the remaining n-1 non-configuration controllers still exists and functions normally, after the external SAN mapping is established between the third virtual volume and the host, the host can see that n links can normally issue IO), and the SAN switchback process is completed.
[0023] During the data reading and writing process, at least two controllers fail or shut down. When the failed or shut down controllers are all non-configuration controllers, the failed or shut down controllers do not need to log in to the corresponding internal SAN mapping. When one of the failed or shut down controllers is a configuration controller, the SAN switching state operation is performed, so that all controllers in the multi-controller cluster system can normally take over the data reading and writing tasks.
[0024] Example 4 On the basis of Example 1, Example 2 and Example 3, this embodiment further discloses a multi-control cluster SAN switching and switching back device, including a processor and a memory storing a plurality of computer instructions, and when the computer instructions are executed by the processor, the steps of any one of the methods of Examples 1 to 3 are implemented. For the specific limitations of the multi-control cluster SAN switching and switching back device, please refer to the limitations of the multi-control cluster SAN switching and switching back method above, which will not be repeated here.
[0025] It should be understood that although Figure 2-Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 3At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0026] In the multi-controller cluster system, when at least one controller fails or shuts down, SAN switching is performed so that the remaining controllers can take over the services of the failed or shut down controller, thereby allowing the services between the multi-controller cluster system and the host to proceed normally; when the failed controller is restored, SAN switching is performed so that all controllers in the multi-controller cluster system can take over the services normally; the internal SAN mapping and external SAN mapping in the multi-controller cluster SAN switching and switching method and device are not limited to whether IP-SAN or FC-SAN is used, and can be compatible with and realize SAN switching or switching back status.
[0027] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A multi-control cluster SAN switchback method, characterized by: The multi-control cluster SAN switch back method is applied to data reading and writing between the multi-control cluster system and the host, and the data reading and writing between the multi-control cluster system and the host includes SAN normal state, SAN switch state and SAN switch back state, and the multi-control cluster system includes n controllers, wherein: When all controllers are normal, that is, the SAN is in normal state, a storage pool is created on one controller among n controllers, and a logical volume is created on the storage pool. The preset controller is defined as the configuration controller. A first virtual volume is created on the logical volume, and then a first internal SAN mapping is created on the first virtual volume. The remaining n-1 non-configuration controllers all log in to the first internal SAN mapping, automatically generate corresponding first internal mapping volumes, and then second virtual volumes are respectively created for the first internal mapping volumes of the remaining n-1 non-configuration controllers, so as to establish a mapping relationship between each second virtual volume and the first virtual volume. An external SAN mapping is established between each virtual volume and the host, so that n data read and write links exist between the host and the multi-controller cluster system; When the configuration controller fails or shuts down during data reading and writing, that is, the SAN is switched, the pointers to the second virtual volumes of the remaining n-1 non-configuration controllers are empty, and the first internal SAN mapping is logged out, and a preset controller is selected from the remaining n-1 non-configuration controllers, and the storage pool and logical volume on the configuration controller are imported to the controller, and the controller is defined as the active controller; The second virtual volume on the active controller points to the imported logical volume, and a new second internal SAN mapping is created on the second virtual volume. The remaining n-2 non-configuration controllers all log in to the second internal SAN mapping, automatically generate corresponding second internal mapping volumes, and the second virtual volumes on the remaining n-2 non-configuration controllers point to corresponding second internal mapping volumes, respectively, so as to establish a mapping relationship between the second virtual volumes on the remaining n-2 non-configuration controllers and the second virtual volume on the active controller. At this time, there are n-1 data reading and writing links between the host and the multi-controller cluster system. When the configuration controller returns to normal during the data reading and writing process, that is, the SAN is switched back, the pointers of the second virtual volumes of the remaining n-1 non-configuration controllers are set to null, the storage pool and logical volume on the active controller are imported to the restored configuration controller, the second internal SAN mapping on the second virtual volume of the active controller is deleted, and then the remaining n-2 non-configuration controllers all log out of the second internal SAN mapping; A third virtual volume is created on the logical volume of the configuration controller after recovery, and then the same internal SAN mapping as that on the first virtual volume is created on the third virtual volume and named as the third internal SAN mapping. The remaining n-1 non-configuration controllers all log in to the third internal SAN mapping, and the corresponding third internal mapping volume is automatically generated. The second virtual volumes on the remaining n-1 non-configuration controllers point to the corresponding third internal mapping volumes respectively, so as to establish a mapping relationship between the second virtual and third virtual volumes on the remaining n-1 non-configuration controllers, and then an external SAN mapping is established between the third virtual volume and the host, so that n data reading and writing links are provided between the host and the multi-controller cluster system.
2. The multi-control cluster SAN switchback method according to claim 1, characterized in that: In the SAN switching state, the preset controller is the controller that occupies the least resources.
3. The multi-control cluster SAN switchback method according to claim 1, characterized in that: When at least two controllers fail or shut down during data reading and writing, if the failed or shut down controller is a non-configuration controller, the failed or shut down controller does not need to log in to the corresponding internal SAN mapping. If the failed or shut down controller is a configuration controller, the SAN switching state operation is performed.
4. The multi-control cluster SAN switchback method according to claim 1, characterized in that: The multi-controller cluster system further comprises a detection module, which detects whether each controller is faulty or shut down during the data reading and writing process.
5. The multi-control cluster SAN switchback method according to claim 1, characterized in that: In the SAN failback state, when importing the storage pools and logical volumes on the active controller to the restored configuration controller, first export the storage pools and logical volumes on the active controller, and then import the exported storage pools and logical volumes to the restored configuration controller.
6. A multi-control cluster SAN switchback device, comprising a processor and a memory storing a plurality of computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for solving dual computer cluster FC-SAN switching
CN106888111A
Method and system for testing fault switching performance of NAS cluster
CN108959045A
Switching method and system for configuration information of storage cluster, equipment and storage medium
CN110134541A
Quick fault switching method for storage array controller
CN118069045A