Multi-control cluster SAN switching back method and device
By establishing internal and external SAN mapping relationships in the multi-controller cluster system, the business continuity of the multi-controller cluster system is ensured in the event of controller failure or shutdown in a dual-controller cluster environment. It is compatible with IP-SAN and FC-SAN, and guarantees the normal operation of services.
Patent Information
- Application Number
- CN202411560354.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2044-11-04
AI Technical Summary
Existing technologies cannot effectively handle situations where both controllers fail in a dual-controller cluster environment, causing the SAN to stop operating and failing to guarantee normal business operations. Furthermore, existing solutions lack versatility.
In a multi-controller cluster system, storage pools and logical volumes are created by selecting and configuring controllers, and internal and external SAN mapping relationships are established to realize data read and write links. When a controller fails, the system switches to the active controller with the least resource consumption and re-establishes the mapping relationship. After the system recovers, it switches back to the original configured controller and re-establishes the mapping relationship.
It enables normal operation of services in the event of controller failure or shutdown, and achieves business continuity of multi-controller cluster system through SAN switching and SAN switchback processes, and is compatible with IP-SAN and FC-SAN.
Smart Images

Figure CN119512818B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of SAN switching technology, specifically relating to a method and apparatus for switching back and forth in a multi-controller cluster SAN. Background Technology
[0002] A SAN (Storage Area Network) is a high-speed network dedicated to storage operations, typically independent of a local area network (LAN). A SAN connects hosts and storage devices, providing a dedicated communication channel between any host and any storage device. It isolates storage devices from servers, enabling storage resource sharing at the server level. By introducing channel and network technologies into the storage environment, a SAN offers a new type of network storage solution that simultaneously meets requirements for throughput, availability, reliability, scalability, and manageability. A SAN itself is a storage network, undertaking data storage tasks. By establishing mappings between LUN groups, network groups, and host groups, hosts in a host group can transmit data with LUNs in the LUN group via IP addresses or Fibre Channel (FC) within the network group. In a SAN network, all data transmission occurs within a high-speed, high-bandwidth network.
[0003] Existing patent CN106888111A discloses a switching method for a dual-machine cluster FC-SAN. In this method, user business data is distributed to various controllers of the storage device through SAN services. The storage device in the dual-machine cluster achieves high availability by switching and managing services between the two controllers, ensuring uninterrupted user services during controller or path switching. After the controller recovers, the original services can be taken over. However, in a dual-controller cluster environment, both controllers may fail, causing the upper-layer SAN to stop immediately, and the continued operation of services cannot be guaranteed. Another method involves modifying the fiber optic card driver and controlling the program in the driver to flexibly switch and ensure the continuity of server-side I / O in the event of node failure switching. However, this solution requires modifying a specific fiber optic card, and since there are other SAN types besides FC-SAN, such as IP-SAN, it lacks universality. Summary of the Invention
[0004] The purpose of this invention is to address the problems raised in the background art by proposing a multi-controller cluster SAN switching and back-off method.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] This invention proposes a multi-controller cluster SAN switching and rollback method, applied to data read / write between a multi-controller cluster system and a host. The data read / write between the multi-controller cluster system and the host includes SAN normal state, SAN switching state, and SAN rollback state. The multi-controller cluster system includes n controllers, wherein:
[0007] When all controllers are functioning normally, i.e., the SAN is in a normal state, select one controller from the n controllers to create a storage pool, and create a logical volume on the storage pool. The preset controller is defined as the configuration controller.
[0008] Create a first virtual volume on the logical volume, then create a first internal SAN mapping on the first virtual volume. The remaining n-1 non-configurable controllers log in to the first internal SAN mapping and automatically generate the corresponding first internal mapping volume. Then, create a second virtual volume for the first internal mapping volume of the remaining n-1 non-configurable controllers respectively, so as to establish a mapping relationship between each second virtual volume and the first virtual volume.
[0009] If an external SAN mapping is established between each virtual volume and the host, then there are n data read / write links between the host and the multi-controller cluster system;
[0010] When the configuration controller fails or shuts down during data read / write, i.e., the SAN switch state, the second virtual volume of the remaining n-1 non-configuration controllers will point to null, and the login to the first internal SAN mapping will be exited. A preset controller will be selected from the remaining n-1 non-configuration controllers, and the storage pool and logical volume on the configuration controller will be imported to that controller, and that controller will be defined as the active controller.
[0011] 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-configured controllers log in to the second internal SAN mapping, automatically generate the corresponding second internal mapping volumes, and the second virtual volumes on the remaining n-2 non-configured controllers point to the corresponding second internal mapping volumes, thus establishing a mapping relationship between the second virtual volumes on the remaining n-2 non-configured controllers and the second virtual volumes on the active controller. At this time, there are n-1 data read and write links between the host and the multi-controller cluster system.
[0012] When the configuration controller recovers to normal during data read / write, i.e. SAN switchback state, 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 configuration controller after recovery. The second internal SAN mapping on the second virtual volume of the active controller is deleted. Then, the remaining n-2 non-configuration controllers log out of the second internal SAN mapping.
[0013] After the configuration controller recovers, a third virtual volume is created on its logical volume. Then, an internal SAN mapping identical to that on the first virtual volume is created on the third virtual volume and named the third internal SAN mapping. The remaining n-1 non-configuration controllers log in to this third internal SAN mapping, automatically generating corresponding third internal mapping volumes. The second virtual volumes on the remaining n-1 non-configuration controllers point to the corresponding third internal mapping volumes, thus establishing a mapping relationship between the second 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. Thus, there are n data read / write links between the host and the multi-controller cluster system.
[0014] Preferably, in the SAN switching state, the preset controller is the controller with the least resource consumption.
[0015] Preferably, during data read / write operations, if at least two controllers fail or shut down, and the controller that fails or shuts down is a non-configured controller, then the controller that fails or shuts down does not need to log in to the corresponding internal SAN mapping; if the controller that fails or shuts down is a configured controller, then a SAN state switch operation is performed.
[0016] Preferably, the multi-controller cluster system further includes a detection module, which detects whether each controller is faulty or shut down during the data read / write process.
[0017] Preferably, during the SAN rollback process, when importing the storage pools and logical volumes on the active controller to the restored configuration controller, the storage pools and logical volumes on the active controller are first exported, and then the exported storage pools and logical volumes are imported to the restored configuration controller.
[0018] The present invention also proposes a multi-controller cluster SAN switching back device, including a processor and a memory storing a number of computer instructions, wherein the computer instructions are executed by the processor to implement the steps of the multi-controller cluster SAN switching back method.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0020] 1. In a multi-controller cluster system, when at least one controller fails or is shut down, the remaining controllers can take over the services of the failed or shut-down controller through SAN switching, thereby enabling normal service between the multi-controller cluster system and the host. When the failed controller recovers, SAN switching enables all controllers in the multi-controller cluster system to take over the services normally.
[0021] 2. The internal SAN mapping and external SAN mapping in this multi-controller cluster SAN switching and back-off method and device are not limited to using IP-SAN or FC-SAN, and can be compatible with and realize SAN switching or back-off states. Attached Figure Description
[0022] Figure 1 This is a block diagram of the multi-controller cluster SAN switching and back-off method and device of the present invention;
[0023] Figure 2 This is a flowchart of the SAN switching state of the present invention;
[0024] Figure 3 This is a flowchart of the SAN switchback state of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] like Figures 1-3 As shown, a multi-controller cluster SAN switching and back-off method is provided, which is applied to data reading and writing between the multi-controller cluster system and the host. The data reading and writing between the multi-controller cluster system and the host includes SAN normal state, SAN switching state and SAN back-off state. The multi-controller cluster system includes n controllers, and the multi-controller cluster system also includes physical hard drives (the number and type are not limited and can be set according to actual needs) to provide storage space for the multi-controller cluster system. All kinds of physical hard drives can be recognized by each controller.
[0027] This application is implemented through application tools that control the SAN, and is not limited to a specific storage management software architecture; it can be a kernel-mode or user-mode storage software architecture. This application is implemented based on the SPDK (Storage Performance Development Kit) software architecture. SPDK is a software library designed to improve storage performance, aiming to provide storage applications with lower latency and higher throughput. By eliminating the overhead of the operating system kernel, SPDK enables more efficient data access. SPDK provides rich API interfaces, making it easy for developers to integrate it into existing storage solutions.
[0028] The multi-controller cluster system also includes a detection module, which detects whether each controller is faulty or shut down during the data read and write process;
[0029] It should be noted that the detection module can check the operation of each controller and determine whether the configured or non-configured controller is powered off or faulty based on whether the internal network is connected and whether the controller health status returns a fault (whether the controller has abnormal error messages), thereby determining whether a SAN switchover process needs to be performed.
[0030] The following examples illustrate the processes of SAN normal state, SAN switching state, and SAN switchback state:
[0031] Example 1
[0032] In this embodiment, when all controllers are normal, i.e., the SAN is in normal state (at this time, there are no faulty or shut-down controllers in the multi-controller cluster system), a storage pool is created on one of the n controllers (the selection of this controller is not restricted and can be randomized), and a logical volume is created on the storage pool. The preset controller is defined as the configuration controller. (It should be noted that by creating the storage pool and logical volume on the selected controller, the physical hard disk is allocated storage space of the actual required size at the software layer, and the storage pool and logical volume exist only on one configuration controller).
[0033] Create a first virtual volume on the logical volume (this first virtual volume is used for host-side I / O suspension and retries during subsequent SAN switchover and SAN rollback processes, and the underlying link switch is completed during the retry process). Then, create a first internal SAN mapping on the first virtual volume (the internal SAN mapping is created through the internal network between each controller. This internal network can be based on a TCP / IP network, in which case an IP-SAN internal mapping is created, or it can be based on an FC network, in which case an FC-SAN internal mapping is created). The remaining n-1 non-configured controllers log in to the first internal SAN mapping. After logging in, the corresponding first internal mapping volume is automatically generated (that is, the remaining n-1 non-configured controllers automatically generate their own first internal mapping volumes). Then, create a second virtual volume for the first internal mapping volumes of the remaining n-1 non-configured controllers respectively (this second virtual volume is used for host-side I / O suspension and retries during subsequent SAN switchover and SAN rollback processes, and the underlying link switch is completed during the retry process), thus establishing a mapping relationship between each second virtual volume and the first virtual volume.
[0034] An external SAN mapping is established between each virtual volume and the host (i.e., an external SAN mapping is established between the first virtual volume and n-1 second virtual volumes and the host; 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 (which enables the host to discover and synthesize multi-path block devices with n links to perform data read and write operations).
[0035] It should be noted that there is no limit to the number of storage pools created on the configuration controller, and there is also no limit to the number of logical volumes created on a single storage pool. These can be set according to actual needs. The first virtual volume corresponds one-to-one with the logical volume (i.e., one first virtual volume corresponds to one logical volume), and a first internal mapped volume not on the configuration controller corresponds one-to-one with the first virtual volume. At the same time, the second virtual volume corresponds one-to-one with the first internal mapped volume.
[0036] The host also has host-side mapped volumes. The external SAN mapping between each virtual volume and the host establishes a mapping relationship with the host-side mapped volumes.
[0037] Example 2
[0038] Based on Example 1, this example further proposes: when the configuration controller fails or shuts down during data read / write, i.e., in SAN switching state (the failed or shut-down configuration controller is disconnected from the multi-controller cluster system, and the first virtual volume and external SAN mapping corresponding to the configuration controller are lost; since the communication links between the host and all controllers uniformly send IO to the first virtual volume of the configuration controller, all host-side IO cannot be normally sent to the logical volume of the multi-controller cluster system), the pointers of the remaining n-1 non-configuration controller second virtual volumes are null (host-side IO is suspended), and the host logs out of the first internal SAN mapping, and the remaining n- Select a preset controller from among the non-configured controllers, and import the storage pool and logical volume on the configured controller to that controller, which is then defined as the active controller. In the SAN switching state, the preset controller is the one with the least resource consumption (the multi-controller cluster system has a resource balancing strategy, which uniformly manages the resource allocation of each storage pool under multiple controllers, and tries to distribute the storage pools evenly across the controllers 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 configured controller are imported to the controller with the least resource consumption, which is the active controller corresponding to the storage pool and logical volume).
[0039] The second virtual volume on the active controller points to the imported logical volume (the second virtual volume on the active controller corresponds one-to-one with the logical volume; since the external SAN mapping of the second virtual volume on the active controller still exists and functions normally, the logical volume is remapped to the host through the second virtual volume on the active controller, and the link from the host to the active controller is restored, meaning the host can see that a link can now normally issue IO). A new second internal SAN mapping is created on this second virtual volume. The remaining n-2 non-configured controllers (i.e., n-2 non-configured controllers other than the active controller) all log in to the second internal SAN mapping. After logging in, the corresponding second internal mapping volume is automatically generated (i.e., the remaining n-2 non-configured controllers automatically generate their own second internal mapping volumes, and the second internal mapping volume is automatically generated). The second internal mapped volume corresponds to the second virtual volume, and the second virtual volumes on the remaining n-2 non-configurable controllers point to the corresponding second internal mapped volume (i.e., the second virtual volumes on the remaining n-2 non-configurable controllers point to the second internal mapped volume on the corresponding controller). This establishes a mapping relationship between the second virtual volumes on the remaining n-2 non-configurable controllers and the second virtual volume on the active controller. At this time, there are n-1 data read / write links between the host and the multi-controller cluster system (since the external SAN mapping on the second virtual volumes on the remaining n-2 non-configurable controllers still exists and functions normally, the host can see that there are n-2 newly added links that can normally issue IO). The SAN switching process is completed, thus enabling normal data read / write between the multi-controller cluster system and the host.
[0040] Example 3
[0041] Based on Embodiments 1 and 2, this embodiment further proposes the following: when the configuration controller recovers to normal during data read / write, i.e., in SAN rollback state, the pointers of the second virtual volumes of the remaining n-1 non-configuration controllers are set to null (host-side IO is suspended), the storage pool and logical volume on the active controller are imported into the configuration controller after 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 log out of the second internal SAN mapping; wherein, in the SAN rollback state, during the process of importing the storage pool and logical volume on the active controller into the configuration controller after recovery, the storage pool and logical volume on the active controller are first exported, and then the exported storage pool and logical volume are imported into the configuration controller after recovery.
[0042] After the configuration controller recovers, create a third virtual volume on its logical volume (because the configuration controller failed or shut down, the first virtual volume was lost or corrupted, so a new virtual volume needs to be created, i.e., the third virtual volume, which corresponds one-to-one with the logical volume). Then, create the same internal SAN mapping on the third virtual volume as on the first virtual volume and name it the third internal SAN mapping. All the remaining n-1 non-configuration controllers log in to this third internal SAN mapping. After logging in, a corresponding third internal mapping volume is automatically generated (i.e., each of the remaining n-1 non-configuration controllers automatically generates its own third internal mapping volume, which corresponds to the third virtual volume). The second virtual volume on each controller points to the corresponding third internal mapping volume (i.e., the second virtual volumes on the remaining n-2 non-configurable controllers point to the third internal mapping volumes on their respective controllers), thus establishing a mapping relationship between the second and third virtual volumes on the remaining n-1 non-configurable controllers. Then, an external SAN mapping is established between the third virtual volume and the host. As a result, there are n data read / write links between the host and the multi-controller cluster system (since the external SAN mapping on the second virtual volume on the remaining n-1 non-configurable 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 there are n links that can normally issue IO). The SAN switchback process is completed.
[0043] During data read / write operations, if at least two controllers fail or shut down, and both of the failed or shut-down controllers are non-configured controllers, then the failed or shut-down controller does not need to log in to the corresponding internal SAN mapping. If one of the failed or shut-down controllers is a configured controller, then a SAN state switch operation is performed, thereby enabling all controllers in the multi-controller cluster system to take over the data read / write tasks normally.
[0044] Example 4
[0045] Based on Embodiments 1, 2, and 3, this embodiment also discloses a multi-controller cluster SAN switching back device, including a processor and a memory storing a plurality of computer instructions. When the computer instructions are executed by the processor, they implement the steps of any one of the embodiments of Embodiments 1 to 3. For specific limitations of the multi-controller cluster SAN switching back device, please refer to the limitations of the multi-controller cluster SAN switching back method above, which will not be repeated here.
[0046] It should be understood that, although Figures 2-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 2-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed 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 some of the sub-steps or stages of other steps.
[0047] In this multi-controller cluster SAN switching and back-off method and device, when at least one controller in a multi-controller cluster system fails or shuts down, SAN switching allows the remaining controllers to take over the services of the failed or shut-down controller, thus enabling normal service between the multi-controller cluster system and the host. When the failed controller recovers, SAN back-off allows all controllers in the multi-controller cluster system to take over the services normally. The internal SAN mapping and external SAN mapping in this multi-controller cluster SAN switching and back-off method and device are not limited to using IP-SAN or FC-SAN, and can be compatible with and realize SAN switching or back-off states.
[0048] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for multi-control cluster SAN switchover, characterized in that: The method is applied to data read and write between the multi-control cluster system and the host, and the data read and write between the multi-control cluster system and the host includes a SAN normal state, a SAN switching state and a SAN switching back state, the multi-control cluster system includes n controllers, wherein: When all the controllers are normal, i.e. in the SAN normal state, a storage pool is created on a selected one of the n controllers, and a logical volume is created on the storage pool, and the selected controller is defined as a 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 log in the first internal SAN mapping, and corresponding first internal mapping volumes are automatically generated, and then a second virtual volume is created for each of the first internal mapping volumes of the remaining n-1 non-configuration controllers, and a mapping relationship is established between each second virtual volume and the first virtual volume; An external SAN mapping is established between each virtual volume and the host, and there are n data read and write links between the host and the multi-control cluster system; When the configuration controller fails or is powered off during the data read and write process, i.e. in the SAN switching state, the second virtual volumes of the remaining n-1 non-configuration controllers are empty, and the first internal SAN mapping is logged out, a selected one of the remaining n-1 non-configuration controllers is defined as an active controller, and the storage pool and the logical volume on the configuration controller are imported to 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 log in the second internal SAN mapping, and corresponding second internal mapping volumes are automatically generated, and the second virtual volumes on the remaining n-2 non-configuration controllers respectively point to the corresponding second internal mapping volumes, 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, and there are n-1 data read and write links between the host and the multi-control cluster system; When the configuration controller recovers to normal during the data read and write process, i.e. in the SAN switching back state, the second virtual volumes of the remaining n-1 non-configuration controllers are empty, the storage pool and the logical volume on the active controller are imported to the recovered configuration controller, the second internal SAN mapping on the second virtual volume of the active controller is deleted, and then the second internal SAN mapping is logged out by the remaining n-2 non-configuration controllers. A third virtual volume is created on the logical volume of the configuration controller after recovery, and then the same internal SAN mapping as on the first virtual volume is created on the third virtual volume and named as a third internal SAN mapping, and the remaining n-1 non-configuration controllers log in the third internal SAN mapping, automatically generating corresponding third internal mapping volumes, and the second virtual volumes on the remaining n-1 non-configuration controllers respectively point to the corresponding third internal mapping volumes, realizing the mapping relationship between the second virtual and third virtual volumes on the remaining n-1 non-configuration controllers, and then an external SAN mapping between the third virtual volume and the host is established, so that there are n data read-write links between the host and the multi-control cluster system.
2. The multi-control cluster SAN switchover method of claim 1, wherein: In the SAN switching state, the preset controller is the controller with the least resource occupation.
3. The multi-control cluster SAN switchover method of claim 1, wherein: When at least two controllers fail or shut down during the data read-write process, if the failed or shut-down controller is a non-configuration controller, the failed or shut-down controller does not need to log in the corresponding internal SAN mapping, and if the failed or shut-down controller is a configuration controller, the operation of the SAN switching state is performed.
4. The multi-control cluster SAN switchover method of claim 1, wherein: The multi-control cluster system further comprises a detection module, which detects whether each controller fails or shuts down during the data read-write process.
5. The multi-control cluster SAN switchover method of claim 1, wherein: In the SAN switching state, the storage pool and the 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 recovery.
6. A multi-control cluster SAN switchover apparatus, comprising a processor and a memory having stored therein a plurality of computer instructions, wherein: The computer instructions are executed by the processor to implement the steps of the method of any one of claims 1 to 5.
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