Method and apparatus for providing storage service

By enabling real-time monitoring and switching commands to ensure the continuity of cloud server storage services, the problem of service interruption caused by storage failures in cloud computing environments is solved, the availability and data integrity of cloud servers are improved, and the disaster recovery process is simplified.

CN118337605BActive Publication Date: 2025-11-28JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410586861.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2025-11-28
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

In a cloud computing environment, how can we ensure that the cloud host of the storage business system can provide storage services normally to the outside world when storage failures are caused by natural disasters or human accidents, especially for the high reliability requirements of the financial industry and special industries?

Method used

By monitoring the network connection status between the host machine and the default storage cluster in real time, a switching command is generated to switch the current storage cluster to the target storage cluster. The target storage cluster has a backup relationship with the current storage cluster and uses the cloud disk of the target storage cluster to provide storage services for the host machine, thereby realizing the switching of the remote storage cluster and ensuring data backup and recovery.

Benefits of technology

It ensures the continuity of cloud server storage services in the event of storage failure, improves the availability and data persistence of cloud servers, reduces resource waste, simplifies the disaster recovery process, and enhances ease of use and data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118337605B_ABST
    Figure CN118337605B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a storage service providing method and device, the method comprises the following steps: obtaining a monitoring result obtained by monitoring a network connection state between a host computer and a default storage cluster, wherein the default storage cluster is a main storage cluster corresponding to the host computer; generating a switching instruction according to the monitoring result; switching a current storage cluster connected with the host computer to a target storage cluster based on the switching instruction, and providing storage service for the host computer by using a target cloud hard disk of the target storage cluster, wherein a storage type of the target storage cluster is different from a storage type of the current storage cluster, the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of computer storage, and in particular, to a method and apparatus for providing storage service. BACKGROUND

[0002] Currently, with the increasing maturity of cloud computing technology, cloud computing has a greater and greater impact on the production and development of different industries. Due to the consideration of data security, different industries have corresponding disaster recovery needs for cloud hosts supporting cloud computing. For example, the financial industry, special industry and other industries with relatively high service reliability have higher disaster recovery needs for cloud hosts.

[0003] Therefore, when a storage fault occurs in a storage business system due to natural disasters such as earthquakes, floods, or human accidents, how to ensure that the cloud host of the storage business system normally provides storage service to the outside becomes a technical problem to be solved urgently.

[0004] Therefore, it is necessary to improve the related technology to overcome the defects in the related technology. SUMMARY

[0005] Embodiments of the present application provide a method and apparatus for providing storage service to at least solve the technical problem of how to ensure that the cloud host of the business system normally provides storage service to the outside when a storage fault occurs in the business system due to natural disasters such as earthquakes, floods, or human accidents.

[0006] According to an embodiment of the present application, a method for providing storage service is provided, applied to a storage business system, wherein the storage business system is pre-installed with a host and a cloud hard disk providing storage service for the host, and the host has a network connection with a storage cluster of the cloud hard disk; comprising: obtaining a monitoring result obtained by monitoring the network connection state between the host and a default storage cluster, wherein the default storage cluster is a main storage cluster corresponding to the host; generating a switching instruction according to the monitoring result; switching the current storage cluster connected with the host to a target storage cluster based on the switching instruction, and using a target cloud hard disk of the target storage cluster to provide storage service for the host, wherein the storage type of the target storage cluster and the storage type of the current storage cluster are different, the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.

[0007] In an example embodiment, the generating the switching instruction according to the monitoring result comprises: in a case where it is determined that the storage type of the current storage cluster is a master storage type, if it is determined that the current storage cluster belongs to the default storage cluster and it is determined that the monitoring result indicates that the network connection state between the host and the default storage cluster is abnormal, a second switching instruction is generated; and the controlling the current storage cluster to switch to a target storage cluster based on the switching instruction comprises: determining the target storage cluster indicated by the second switching instruction, wherein the storage type of the target storage cluster is a backup storage type; and in a case where it is determined that the target storage cluster belongs to the backup storage cluster corresponding to the host, using the second switching instruction to switch the current storage cluster to the target storage cluster.

[0008] In an example embodiment, the switching the current storage cluster to the target storage cluster using the second switching instruction comprises: in response to the second switching instruction, determining the hard disk type of a current cloud hard disk corresponding to the current storage cluster; switching the current storage cluster to the target storage cluster according to the hard disk type of the current cloud hard disk and modifying the hard disk permission of the target cloud hard disk to allow writing; wherein the switching the current storage cluster to the target storage cluster according to the hard disk type of the current cloud hard disk comprises: in a case where it is determined that the hard disk type of the current cloud hard disk is a system hard disk, deleting a current cloud host connected with the current storage cluster in the host; creating a target cloud host connected with the target storage cluster in the host to mount the target cloud hard disk to the target cloud host, wherein the hard disk type of the target cloud hard disk is a system hard disk; and in a case where it is determined that the hard disk type of the current cloud hard disk is a data hard disk, unmounting the current cloud hard disk in a current cloud host connected with the current storage cluster; and mounting the target cloud hard disk to the current cloud host, wherein the hard disk type of the target cloud hard disk is a data hard disk; and the monitoring result is determined to indicate that the network connection state between the host and the default storage cluster is abnormal by: obtaining the network connection duration between the host and the default storage cluster; and in a case where it is determined that the network connection duration is greater than a preset connection duration, determining that the monitoring result indicates that the network connection state between the host and the default storage cluster is abnormal.

[0009] In an example embodiment, after the current storage cluster is switched to the target storage cluster using the second switching instruction, the method further comprises: in a case where the monitoring result indicates that the network connection state between the host and the default storage cluster is normal, establishing a second backup relationship between the target storage cluster and the current storage cluster, wherein the second backup relationship represents a backup relationship from the target storage cluster to the current storage cluster; obtaining the generated storage data when the target storage cluster is connected to the host; backing up the storage data to the default storage cluster based on the second backup relationship; generating a third switching instruction, and switching the target storage cluster connected to the host to the default storage cluster based on the third switching instruction.

[0010] In an example embodiment, the generating a switching instruction based on the monitoring result comprises: in a case where it is determined that the storage type of the current storage cluster is a backup storage type, if it is determined that the monitoring result indicates that the network connection state between the host and the default storage cluster is normal, a second switching instruction is generated; and the switching the current storage cluster connected to the host to a target storage cluster based on the switching instruction comprises: switching the current storage cluster to the target storage cluster using the second switching instruction, wherein the storage type of the target storage cluster is a primary storage type, and the target storage cluster belongs to the default storage cluster.

[0011] In an example embodiment, before the monitoring result of the network connection state between the host and the default storage cluster is obtained, the method further comprises: determining a first storage cluster and a second storage cluster from the storage clusters of the cloud disk, wherein the first storage cluster and the second storage cluster are in different regions, the storage type of the first storage cluster is a primary storage type, the first storage cluster is a primary storage cluster corresponding to the host, the storage type of the second storage cluster is a backup storage type, and the second storage cluster is a backup storage cluster corresponding to the host; establishing a data backup channel between the first storage cluster and the second storage cluster; and determining the first storage cluster as the default storage cluster.

[0012] In an example embodiment, the method further comprises: configuring a primary storage cluster and a backup storage cluster for the host machine using a cluster configuration file, wherein the primary storage cluster represents a storage backend of the host machine, and configuration information of the cluster configuration file at least includes: a cluster number of the primary storage cluster, a cluster number of the backup storage cluster, a storage pool name of the primary storage cluster, a storage pool name of the backup storage cluster, login information corresponding to the host machine, and a drive path corresponding to the primary storage cluster; after the host machine is configured with the primary storage cluster and the backup storage cluster, creating a cloud disk corresponding to the primary storage cluster and a cloud disk of the backup storage cluster, wherein the cloud disk corresponding to the primary storage cluster and the cloud disk of the backup storage cluster both support different expansion specifications; and mounting the cloud disk corresponding to the primary storage cluster on the host machine.

[0013] According to another embodiment of the present application, a storage service providing apparatus is provided, comprising: an acquisition module configured to acquire a monitoring result obtained by monitoring a network connection state between a host machine and a default storage cluster, wherein the default storage cluster is a primary storage cluster corresponding to the host machine; a generation module configured to generate a switching instruction according to the monitoring result; and a switching module configured to switch a current storage cluster connected with the host machine to a target storage cluster based on the switching instruction, and provide a storage service for the host machine using a target cloud disk of the target storage cluster, wherein a storage type of the target storage cluster is different from a storage type of the current storage cluster, the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.

[0014] According to yet another embodiment of the present application, a computer readable storage medium is further provided, and the computer readable storage medium stores a computer program, wherein the computer program is configured to execute steps in any of the above method embodiments when running.

[0015] According to yet another embodiment of the present application, an electronic device is further provided, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform steps in any of the above method embodiments.

[0016] According to yet another embodiment of the present application, a computer program product is further provided, comprising a computer program, and the computer program is executed by a processor to implement steps in any of the above method embodiments.

[0017] By the present application, by acquiring monitoring results obtained by monitoring the network connection state between the host computer and the default storage cluster, then generating a switching instruction according to the monitoring results, and switching the current storage cluster connected with the host computer to a target storage cluster based on the switching instruction, using the target cloud disk of the target storage cluster to provide storage services for the host computer, since the health state of the default storage cluster is monitored in real time, the host computer can quickly perceive the failure of the main storage cluster. In the case of main storage cluster failure, the storage backend is switched to the target storage cluster based on the switching instruction, thereby ensuring the continuity of the cloud host built into the host computer to provide storage services. Therefore, the technical problem of how to ensure that the cloud host of the business system normally provides storage services to the outside when the business system fails due to natural disasters such as earthquakes, floods, or human accidents can be solved, thereby realizing the technical effect of the cloud host of the business system normally providing storage services to the outside, and effectively improving the availability of the cloud host. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 is a hardware structure block diagram of a server device of a storage service providing method according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of a storage service providing method according to an embodiment of the present application;

[0020] Figure 3 is a disaster recovery architecture diagram of a cloud platform in the related art;

[0021] Figure 4 is a disaster recovery architecture diagram of a cloud platform according to an embodiment of the present application;

[0022] Figure 5 is a disaster recovery process diagram of a cloud host according to an embodiment of the present application;

[0023] Figure 6 is a structure diagram of a storage service providing apparatus according to an embodiment of the present application;

[0024] Figure 7 is a structure diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0027] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a server device for providing a storage service according to an embodiment of this application. For example... Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0028] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the storage service provision method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0030] This embodiment provides a method for providing storage services. Figure 2 This is a flowchart of a method for providing storage services according to an embodiment of this application, such as... Figure 2As shown, the flow includes the following steps:

[0031] In step S202, a monitoring result of a network connection state between the host and a default storage cluster is obtained, wherein the default storage cluster is a primary storage cluster corresponding to the host.

[0032] In step S204, a switching instruction is generated according to the monitoring result.

[0033] In step S206, a current storage cluster connected with the host is switched to a target storage cluster based on the switching instruction, and the target cloud hard disk of the target storage cluster is used to provide storage service for the host, wherein the storage type of the target storage cluster is different from the storage type of the current storage cluster, the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.

[0034] It can be understood that, based on the first backup relationship, data backup from the current storage cluster to the target storage cluster can be realized when the primary storage cluster fails, so as to ensure the consistency of the production cloud hard disk on the primary storage cluster and the disaster recovery cloud hard disk on the backup storage cluster, and effectively ensure the integrity of the cloud host business data during the storage backend switching.

[0035] Optionally, step S202 can be implemented by a monitoring module, and the monitoring module and a cloud host are pre-installed in the host. The monitoring module is used to implement step S202, and the cloud host can implement steps S204 to S206.

[0036] The network connection state between the host and the default storage cluster can also be understood as the network connection state between the cloud host in the host and the default storage cluster. By deploying the monitoring module in the host, the network connection state between the cloud host and the default storage cluster can be monitored in real time to obtain the health state of the primary storage cluster, and the monitoring speed of the failure of the primary storage cluster can be improved.

[0037] By the above steps, by acquiring the monitoring result of monitoring the network connection state between the host computer and the default storage cluster, then generating a switching instruction according to the monitoring result, and switching the current storage cluster connected with the host computer to a target storage cluster based on the switching instruction, and using the target cloud disk of the target storage cluster to provide storage service for the host computer, since the health state of the default storage cluster is monitored in real time, the host computer can quickly perceive the failure of the main storage cluster. In the case of main storage cluster failure, the storage backend is switched to the target storage cluster based on the switching instruction, thereby ensuring the continuity of the cloud host built into the host computer to provide storage service. Therefore, the technical problem of how to ensure that the cloud host of the business system normally provides storage service to the outside when the business system fails due to natural disasters such as earthquakes, floods, or human accidents can be solved, thereby realizing the technical effect of the cloud host of the business system normally providing storage service to the outside, and effectively improving the availability of the cloud host.

[0038] It should be noted that the target storage cluster belongs to a different region than the current storage cluster, that is, the current storage cluster connected with the host computer is switched to the target storage cluster based on the switching instruction, which can realize the switching of the off-site storage cluster, remove the geographical restrictions, and increase the range of data storage services. And the entire storage business system can switch the storage backend of the cloud host in the case of storage cluster failure, thereby performing data backup and data recovery off-site, improving the persistence of data, and realizing the disaster recovery function of the cloud host.

[0039] In one example embodiment, for the implementation process of generating a switching instruction according to the monitoring result in step S204, it can specifically include: step S11, in the case of determining that the storage type of the current storage cluster is a main storage type, if it is determined that the current storage cluster belongs to the default storage cluster, and it is determined that the monitoring result indicates that the network connection state between the host computer and the default storage cluster is abnormal, a second switching instruction is generated.

[0040] Among them, the storage type of the storage cluster includes a main storage type and a backup storage type.

[0041] For a storage cluster with a main storage type, it can be understood as a main storage cluster, and for a storage cluster with a backup storage type, it can be understood as a backup storage cluster.

[0042] Further, the step S206 further includes: a step S21 of determining the target storage cluster indicated by the second switching instruction, wherein the storage type of the target storage cluster is a backup storage type; and a step S22 of switching the current storage cluster to the target storage cluster using the second switching instruction in a case where it is determined that the target storage cluster belongs to the backup storage cluster corresponding to the host machine.

[0043] In an example embodiment, for the step S22, the following steps can be further included:

[0044] a step S31 of determining the hard disk type of the current cloud hard disk corresponding to the current storage cluster in response to the second switching instruction; and a step S32 of switching the current storage cluster to the target storage cluster and modifying the hard disk permission of the target cloud hard disk to allow writing according to the hard disk type of the current cloud hard disk.

[0045] For the step S32, the following steps can be further included: a step S41 of deleting the current cloud host connected to the current storage cluster in the host machine in a case where it is determined that the hard disk type of the current cloud hard disk is a system hard disk; a step S42 of newly creating a target cloud host connected to the target storage cluster in the host machine to mount the target cloud hard disk on the target cloud host, wherein the hard disk type of the target cloud hard disk is a system hard disk; a step S43 of unmounting the current cloud hard disk in the current cloud host connected to the current storage cluster in a case where it is determined that the hard disk type of the current cloud hard disk is a data hard disk; and a step S44 of mounting the target cloud hard disk on the current cloud host, wherein the hard disk type of the target cloud hard disk is a data hard disk.

[0046] In the embodiment, the monitoring result can be determined to indicate that the network connection state between the host machine and the default storage cluster is abnormal in the following manner: obtaining the network connection duration between the host machine and the default storage cluster; and determining that the monitoring result indicates that the network connection state between the host machine and the default storage cluster is abnormal in a case where it is determined that the network connection duration is greater than a preset connection duration.

[0047] Through the above steps, the specific operation in the switching process can be set according to whether the hard disk type of the current cloud hard disk is a system hard disk or a data hard disk, thereby improving the accuracy and safety of the operation.

[0048] In an example embodiment, the following steps can be further included: step S51, establishing a second backup relationship between the target storage cluster and the current storage cluster in a case where the monitoring result indicates that the network connection state between the host computer and the default storage cluster is normal, wherein the second backup relationship represents a backup relationship from the target storage cluster to the current storage cluster; step S52, obtaining generated storage data when the target storage cluster is connected to the host computer; step S53, backing up the storage data to the default storage cluster based on the second backup relationship; and step S54, generating a third switching instruction and switching the target storage cluster connected to the host computer to the default storage cluster based on the third switching instruction.

[0049] Through the above steps, the re-protection operation can be implemented after the main storage cluster is repaired. Through the re-protection operation, the data replication relationship between the target cloud disk corresponding to the target storage cluster and the cloud disk of the current storage cluster can be re-established, and the data synchronization direction is from the target storage cluster to the current storage cluster for backup, so that the consistency of the data can be ensured.

[0050] In an example embodiment, for the process of generating the switching instruction based on the monitoring result, the following can be included: in a case where it is determined that the storage type of the current storage cluster is a backup storage type, if it is determined that the monitoring result indicates that the network connection state between the host computer and the default storage cluster is normal, a second switching instruction is generated; and the switching of the current storage cluster connected to the host computer to the target storage cluster based on the switching instruction includes: switching the current storage cluster to the target storage cluster using the second switching instruction, wherein the storage type of the target storage cluster is a main storage type, and the target storage cluster belongs to the default storage cluster.

[0051] In a case where it is determined that the storage type of the current storage cluster is a main storage type, if it is determined that the monitoring result indicates that the network connection state between the host computer and the default storage cluster is normal, the first switching instruction is not generated, and the current cloud disk of the current storage cluster is continued to be used to provide storage service for the host computer.

[0052] In a case where it is determined that the storage type of the current storage cluster is a backup storage type, if it is determined that the monitoring result indicates that the network connection state between the host computer and the default storage cluster is abnormal, the second switching instruction is not generated, and the current cloud disk of the current storage cluster is continued to be used to provide storage service for the host computer.

[0053] In an exemplary embodiment, before performing step S204 above, the following can be further implemented: Step S61, determining a first storage cluster and a second storage cluster from the storage clusters of the cloud hard disk, wherein the region to which the first storage cluster belongs is different from the region to which the second storage cluster belongs, the storage type of the first storage cluster is primary storage type, the first storage cluster is the primary storage cluster corresponding to the host machine, the storage type of the second storage cluster is backup storage type, the second storage cluster is the backup storage cluster corresponding to the host machine; Step S62, establishing a data backup channel between the first storage cluster and the second storage cluster; Step S63, determining the first storage cluster as the default storage cluster.

[0054] This embodiment enables automatic switching of remote storage clusters in the event of a storage cluster failure, thereby ensuring the continuity of production operations.

[0055] In one exemplary embodiment, other implementation schemes are further proposed, with specific steps including: Step S71, configuring a primary storage cluster and a backup storage cluster for the host machine using a cluster configuration file, wherein the primary storage cluster represents the storage backend of the host machine, and the configuration information of the cluster configuration file includes at least: the cluster number of the primary storage cluster, the cluster number of the backup storage cluster, the storage pool name of the primary storage cluster, the storage pool name of the backup storage cluster, the login information corresponding to the host machine, and the driver path corresponding to the primary storage cluster; Step S72, after configuring the primary storage cluster and the backup storage cluster on the host machine, creating a cloud disk corresponding to the primary storage cluster and a cloud disk of the backup storage cluster, wherein the cloud disk corresponding to the primary storage cluster and the cloud disk of the backup storage cluster both support different expansion specifications; Step S73, mounting the cloud disk corresponding to the primary storage cluster on the host machine.

[0056] It should be noted that current cloud platforms have already implemented disaster recovery functionality for cloud servers. Taking the OpenStack cloud platform (hereinafter referred to as the cloud platform) as an example, the disaster recovery architecture of the OpenStack cloud platform is as follows: Figure 3 As shown, this involves two cloud platforms, OpenStack A and OpenStack B. A partnership is established between the storage clusters connected to these two OpenStack cloud platforms to enable remote data replication between the storage clusters. Specifically, identical business resources are created on both OpenStack cloud platforms. The production cloud host on OpenStack A is configured to provide production services, while the disaster recovery cloud host on OpenStack B is assumed to be powered off. Data on the production cloud disks (representing the primary storage cluster corresponding to the production cloud host) is automatically synchronized to the disaster recovery cloud disks (representing the backup storage cluster corresponding to the disaster recovery cloud host).

[0057] When the primary storage cluster fails, a failover operation can be performed to replace the production cloud host on OpenStack A with the disaster recovery cloud host on OpenStack B to continue to provide production services. After the primary storage cluster is repaired, a re-protection operation can be performed to re-establish the data replication relationship from OpenStack B to OpenStack A, and synchronize the production data on the disaster recovery cloud hard disk to the production cloud hard disk. After the data synchronization is completed, a master-slave rollback operation is performed to switch the disaster recovery direction, so that the production cloud host continues to provide production services, and the disaster recovery cloud host continues to provide disaster recovery services.

[0058] It should be noted that OpenStack is an open source project that includes different components and can provide cloud platform management for the construction and management of public clouds, private clouds and hybrid clouds. OpenStack can simplify the deployment process of the cloud and bring good scalability to the cloud.

[0059] Among them, Cinder represents the block storage service of OpenStack, Cinder adds persistent storage to virtual machines, provides an infrastructure for managing volumes, and provides volumes for instances by interacting with the OpenStack computing service. At the same time, Cinder also activates the snapshot function of the volume management. In the above process, the Cinder component mainly performs cloud hard disk creation, deletion and other life cycle management. And Neptune mainly performs failover, re-protection, master-slave rollback and other disaster recovery management.

[0060] In one embodiment, in combination with Figure 4 The cloud platform disaster recovery architecture of the present application is described as follows: Figure 4 As shown in the figure, the cloud platform includes a host and a cloud hard disk managed by Cinder, wherein the host includes a monitoring module and a cloud platform. The monitoring module is used to monitor the failure state of the storage cluster corresponding to the cloud hard disk. By configuring the monitoring module on the host, the network connection state of the storage cluster connected to the host and the OpenStack platform can be monitored in real time.

[0061] If the monitoring module detects that the network connection between the host and the primary storage cluster is disconnected for more than a certain time, it can be determined that the primary storage cluster has failed, and a failover operation is triggered (it can be understood that the current storage cluster connected to the host is switched to the target storage cluster based on the switching instruction), at this time the backend providing storage services for the cloud host will be switched from the production cloud hard disk corresponding to the primary storage cluster to the disaster recovery cloud hard disk corresponding to the standby storage cluster. Alternatively, the cloud host disaster recovery function can also be triggered by the production cloud hard disk itself to initiate a failure information to trigger the failover.

[0062] After the host storage cluster failure is repaired, the monitoring module can also detect that the host computer and the host storage cluster network connection is normal, at this time, the re-protection operation is triggered, the disaster recovery cloud disk and the production cloud disk re-establish the remote replication relationship, through which the production data in the disaster recovery cloud disk can be synchronized to the production cloud disk.

[0063] After the data synchronization is completed, the cloud host will perform host backup switching, and the production cloud disk on the host storage will provide storage services for the cloud host again, and the disaster recovery cloud disk on the backup storage will be unloaded from the cloud host, and at the same time, the data replication direction will also be switched to production cloud disk to disaster recovery cloud disk replication.

[0064] It can be seen that, Figure 3 The two sets of OpenStack cloud platforms create the same cloud host resources, but actually only the cloud host on the OpenStack cloud platform provides production services, which causes the resource waste of the OpenStack cloud platform and the cloud host providing disaster recovery services. Compared with the method of Figure 3 Firstly, Figure 4 The embodiments provided by the application are based on a single OpenStack cloud platform and a single cloud host, which greatly reduces the waste of computing resources and human resources. At the same time, the monitoring module is used to monitor the storage cluster state, which greatly speeds up the monitoring speed of the storage cluster and reduces the business recovery time of the cloud host compared with the manual judgment of the storage cluster failure. Moreover, compared with the method of Figure 3 In the disaster recovery process, Figure 4 Only the OpenStack Cinder component is used to manage the life cycle of the cloud disk, which simplifies the disaster recovery process and improves the ease of use.

[0065] Further, in combination with Figure 5 The process of implementing cloud host disaster recovery based on a single OpenStack is described as follows:

[0066] Step S501, a partnership is established between the storage clusters.

[0067] First, a host storage cluster and a backup storage cluster are selected from two off-site and same-type storage clusters, wherein the host storage cluster, for example, corresponds to the production cloud disk shown in Figure 4 , provides production services for the cloud host. The backup storage cluster, for example, corresponds to the disaster recovery cloud disk shown in Figure 4 , provides disaster recovery services for the cloud host. After the partnership between the host storage cluster and the backup storage cluster is established, the data between the host storage cluster and the backup storage cluster can be remotely replicated based on the partnership.

[0068] The data remote replication process can be understood as a process of performing a backup based on the first backup relationship or the second backup relationship.

[0069] In step S502, a Cinder configuration file is configured.

[0070] The host storage cluster can be configured as an OpenStack storage backend through the Cinder configuration file. The Cinder configuration file includes storage cluster IP, login username, login password, storage pool name, drive path, etc. Since the replication function of the storage cluster is to be used, a replication_device configuration item is added to configure the standby storage cluster information, mainly including the standby storage cluster id, storage cluster IP, login username, login password, storage pool name, etc.

[0071] The storage cluster IP corresponds to the cluster number, and the login username and the login password correspond to the login information.

[0072] It should be noted that the Replication function of the storage cluster used represents a data protection technology in the storage field, that is, a session is created between two volumes, and data synchronization is performed. The two volumes can be in the same storage array or in two geographically distributed storage arrays, but only one volume provides production services at the same time. When the host volume providing production services fails, the standby volume can be switched immediately to ensure business continuity.

[0073] In step S503, a cloud disk type is created.

[0074] The Cinder is used to create a cloud disk type for the storage backend configured in step S502. For example, a production cloud disk can be created for the storage backend. The extension specification corresponding to the cloud disk type can also be set, for example, the extension specification includes replication_type and replication_enabled. replication_type represents the remote replication type of the host and standby storage cluster, which can be selected as synchronous or asynchronous. replication_enabled represents whether to enable the replication function for the cloud disk, and True needs to be selected if the replication function is enabled.

[0075] In this way, when the monitoring module detects a failure of the host storage cluster, the replication remote replication function can be used to automatically switch the storage backend from the host storage cluster to the standby storage cluster, and the consistency of the production cloud disk on the host storage cluster and the disaster recovery cloud disk on the standby storage cluster is also achieved. Not only the continuity of the cloud host production business is improved, but also the integrity of the cloud host business data during the storage backend switching is improved, thereby realizing the high availability of the cloud host.

[0076] Step S504, creating a cloud hard disk.

[0077] The cloud hard disk created in step 503 by Cinder is created in the same specification on the primary storage cluster and the backup storage cluster. Among them, the cloud hard disk on the primary storage cluster is the production cloud hard disk, which has read and write permissions, and the cloud hard disk on the backup storage cluster is the disaster recovery cloud hard disk, which only has read permission, and a replication relationship is established between the two cloud hard disks. The data on the production cloud hard disk is synchronously copied to the disaster recovery cloud hard disk.

[0078] Step S505, cloud host mounts cloud hard disk.

[0079] The production cloud hard disk is mounted to the cloud host, wherein the production cloud hard disk can be mounted to the cloud host as a system disk or a data disk of the cloud host. At this time, the cloud host mounted with the production cloud hard disk can carry out business production, and the production business is protected by disaster recovery, which has disaster recovery function.

[0080] Step S506, monitoring whether the primary storage cluster fails. If yes, step S507 is executed, and if no, step S506 is repeatedly executed.

[0081] This step can be realized by a monitoring module. By setting a monitoring module on the host, the health status of the primary storage cluster is monitored in real time to determine whether to perform cloud host failure switching action.

[0082] The monitoring module connects the primary storage cluster in a socket communication mode, and defines a connection timeout time. If the host can connect to the primary storage cluster within the timeout time, it indicates that the primary storage cluster or the network link is normal, and it is determined that the primary storage cluster has no failure. Otherwise, it indicates that the primary storage cluster has failed, and the production cloud hard disk cannot provide storage service for the cloud host business. Then this situation will trigger the failure switching process shown in steps 507-511, by automatically switching the storage backend from the primary storage cluster to the backup storage cluster, to ensure the continuity of the business, and realize the high availability of the cloud host.

[0083] Step S507, failure switching.

[0084] After the primary storage cluster fails, the storage backend connected by the cloud host will be switched from the primary storage cluster to the backup storage cluster, and the disaster recovery cloud hard disk on the backup storage cluster will provide storage service for the cloud host.

[0085] When switching the production cloud hard disk to the disaster recovery cloud hard disk, it is necessary to distinguish whether the production cloud hard disk is used as a system disk or a data disk of the cloud host. For the system disk, the cloud host will be deleted first, and then the cloud host will be rebuilt through the disaster recovery cloud hard disk corresponding to the system disk. At this time, the disaster recovery cloud hard disk will be mounted on the cloud host as a system disk, and the fault switching of the system disk is completed. For the data disk, the production cloud hard disk will be directly unloaded from the cloud host, and the disaster recovery cloud hard disk will be mounted on the cloud host, and the fault switching of the data disk is completed.

[0086] After the fault switching, the disaster recovery cloud hard disk will open the write permission to provide the storage service for the cloud host. Since the primary storage cluster has failed, the replication relationship between the production cloud hard disk and the disaster recovery cloud hard disk is disconnected, and the data of the disaster recovery cloud hard disk will not be replicated to the production cloud hard disk.

[0087] Step S508, monitoring whether the primary storage cluster is normal. If yes, step S509 is executed, and if no, step S508 is repeatedly executed.

[0088] The monitoring module monitors whether the primary storage cluster is restored to normal in real time. If the primary storage cluster is restored to normal, the re-protection operation is performed to re-establish the replication relationship between the disaster recovery cloud hard disk and the production cloud hard disk for data synchronization. Otherwise, the disaster recovery cloud hard disk continues to provide the storage service for the cloud host, and the monitoring module continues to monitor the health status of the primary storage cluster.

[0089] Step S509, re-protection operation.

[0090] After the primary storage cluster is repaired, the re-protection operation re-establishes the replication relationship between the disaster recovery cloud hard disk and the production cloud hard disk. The data synchronization direction is that the disaster recovery cloud hard disk replicates to the production cloud hard disk, and the disaster recovery cloud hard disk has read and write permissions, and the production cloud hard disk only has read permission.

[0091] The replication relationship from the disaster recovery cloud hard disk to the production cloud hard disk can be understood as the second backup relationship described above.

[0092] Step S510, data synchronization.

[0093] After the replication relationship in step S509 is established, the disaster recovery cloud hard disk synchronizes data to the production cloud hard disk, so as to ensure that the data in the disaster recovery cloud hard disk and the production cloud hard disk is consistent before the primary-backup switching.

[0094] Step S511, master-backup switching. After the data synchronization in step S510 is completed, the master-backup switching operation is performed. The storage backend connected to the cloud host is switched from the backup storage cluster to the master storage cluster, and the production cloud hard disk on the master storage cluster provides storage services for the cloud host again. The switching process of the system disk and the data disk is the same as that in step S507, and the switching direction is opposite. After the master-backup switching is completed, the data synchronization direction of the production cloud hard disk and the disaster recovery cloud hard disk is also switched, and the production cloud hard disk replicates data to the disaster recovery cloud hard disk, and the production cloud hard disk has read and write permissions, and the disaster recovery cloud hard disk only has read permissions. At this time, the production business of the cloud host is protected by disaster recovery again.

[0095] It can be seen that through the above method, only one OpenStack cloud platform and one cloud host are needed, and without additional production costs such as adding Neptune components, resource waste and production costs can be effectively reduced. On the one hand, automatic switching of cloud host failure and master-backup switching are realized, human resource waste caused by human intervention is reduced, and product usability is greatly improved. On the other hand, the cloud hard disk is operated during the cloud host failure switching or master-backup switching process, and the internal business data is not invaded. Even if the operation fails, it will not affect the user data of the cloud hard disk, and the safety of the user data is guaranteed. Furthermore, this switching process is transparent to the user, and the user can directly use it without considering the principle of cloud host failure switching and master-backup switching. Through the embodiment, the cloud host can automatically switch the failure to ensure the continuity of the production business, and after the master storage cluster failure is repaired, the cloud host can automatically perform master-backup switching to make the production business protected by disaster recovery again.

[0096] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, or network device) execute the methods described in the embodiments of the present application.

[0097] In the embodiment, a storage service providing device is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.

[0098] Figure 6 is a structural schematic diagram of a providing apparatus of a storage service according to an embodiment of the present application, as shown in the figure, the apparatus comprises: Figure 6

[0099] an obtaining module 62, configured to obtain a monitoring result obtained by monitoring a network connection state between a host machine and a default storage cluster, wherein the default storage cluster is a main storage cluster corresponding to the host machine;

[0100] a generating module 64, configured to generate a switching instruction according to the monitoring result;

[0101] a switching module 66, configured to switch a current storage cluster connected with the host machine to a target storage cluster based on the switching instruction, and provide storage service for the host machine by using a target cloud hard disk of the target storage cluster, wherein a storage type of the target storage cluster is different from a storage type of the current storage cluster, the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.

[0102] By the above apparatus, by obtaining a monitoring result obtained by monitoring a network connection state between a host machine and a default storage cluster, then generating a switching instruction according to the monitoring result, and switching a current storage cluster connected with the host machine to a target storage cluster based on the switching instruction, and providing storage service for the host machine by using a target cloud hard disk of the target storage cluster, since the health state of the default storage cluster is monitored in real time, the host machine can timely and quickly perceive that the main storage cluster has failed, and in the case that the main storage cluster has failed, the storage backend is switched to the target storage cluster based on the switching instruction, thereby ensuring the continuity of the cloud host machine built in the host machine to provide storage service. Therefore, the technical problem of how to ensure the cloud host machine of the business system to normally provide storage service to the outside when the business system has storage failure due to natural disasters such as earthquakes, floods, etc. or human accidents in the related art can be solved, and the technical effect of the cloud host machine of the business system to normally provide storage service to the outside is achieved, and the availability of the cloud host machine is effectively improved.

[0103] ​In an example embodiment, the generation module 64 is further configured to: in a case where it is determined that the storage type of the current storage cluster is a primary storage type, generate a second switching instruction if it is determined that the current storage cluster belongs to the default storage cluster and that the monitoring result indicates that the network connection state between the host and the default storage cluster is abnormal; and control the current storage cluster to switch to a target storage cluster based on the switching instruction, including: determining the target storage cluster indicated by the second switching instruction, wherein the storage type of the target storage cluster is a backup storage type; and switching the current storage cluster to the target storage cluster using the second switching instruction in a case where it is determined that the target storage cluster belongs to the backup storage cluster corresponding to the host.

[0104] In an example embodiment, the generation module 64 is further configured to: in response to the second switching instruction, determine the hard disk type of the current cloud hard disk corresponding to the current storage cluster; and switch the current storage cluster to the target storage cluster according to the hard disk type of the current cloud hard disk and modify the hard disk permission of the target cloud hard disk to allow writing; wherein the switching of the current storage cluster to the target storage cluster according to the hard disk type of the current cloud hard disk includes: in a case where it is determined that the hard disk type of the current cloud hard disk is a system hard disk, deleting a current cloud host connected to the current storage cluster in the host; creating a target cloud host connected to the target storage cluster in the host to mount the target cloud hard disk to the target cloud host, wherein the hard disk type of the target cloud hard disk is a system hard disk; and in a case where it is determined that the hard disk type of the current cloud hard disk is a data hard disk, unmounting the current cloud hard disk in a current cloud host connected to the current storage cluster; and mounting the target cloud hard disk to the current cloud host, wherein the hard disk type of the target cloud hard disk is a data hard disk; and wherein the monitoring result is determined to indicate that the network connection state between the host and the default storage cluster is abnormal by: obtaining the network connection duration between the host and the default storage cluster; and determining that the monitoring result indicates that the network connection state between the host and the default storage cluster is abnormal in a case where it is determined that the network connection duration is greater than a preset connection duration.

[0105] In an example embodiment, the generation module 64 is further configured to, after switching the current storage cluster to the target storage cluster using the second switching instruction, establish a second backup relationship between the target storage cluster and the current storage cluster if the monitoring result indicates that the network connection state between the host and the default storage cluster is normal, wherein the second backup relationship represents a backup relationship from the target storage cluster to the current storage cluster; acquire the generated storage data when the target storage cluster is connected to the host; backup the storage data to the default storage cluster based on the second backup relationship; generate a third switching instruction, and switch the target storage cluster connected to the host to the default storage cluster based on the third switching instruction.

[0106] In an example embodiment, the generation module 64 is further configured to, if it is determined that the storage type of the current storage cluster is a backup storage type, generate a second switching instruction if it is determined that the monitoring result indicates that the network connection state between the host and the default storage cluster is normal; and switch the current storage cluster connected to the host to a target storage cluster based on the switching instruction, including switching the current storage cluster to the target storage cluster using the second switching instruction, wherein the storage type of the target storage cluster is a primary storage type, and the target storage cluster belongs to the default storage cluster.

[0107] In an example embodiment, the acquisition module 62 is further configured to determine a first storage cluster and a second storage cluster from the storage clusters of the cloud disk, wherein the first storage cluster and the second storage cluster are in different regions, the storage type of the first storage cluster is a primary storage type, the first storage cluster is a primary storage cluster corresponding to the host, the storage type of the second storage cluster is a backup storage type, and the second storage cluster is a backup storage cluster corresponding to the host; establish a data backup channel between the first storage cluster and the second storage cluster; and determine the first storage cluster as the default storage cluster.

[0108] In an example embodiment, the apparatus for providing the storage service further comprises a configuration module configured to: configure a primary storage cluster and a backup storage cluster for the host machine using a cluster configuration file, wherein the primary storage cluster represents a storage backend of the host machine, and the configuration information of the cluster configuration file comprises at least: a cluster number of the primary storage cluster, a cluster number of the backup storage cluster, a storage pool name of the primary storage cluster, a storage pool name of the backup storage cluster, login information corresponding to the host machine, and a drive path corresponding to the primary storage cluster; after the primary storage cluster and the backup storage cluster are configured for the host machine, create a cloud disk corresponding to the primary storage cluster and a cloud disk of the backup storage cluster, wherein the cloud disk corresponding to the primary storage cluster and the cloud disk of the backup storage cluster both support different expansion specifications; and mount the cloud disk corresponding to the primary storage cluster on the host machine.

[0109] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all of the above modules are located in the same processor; or the above modules are located in different processors in any combination.

[0110] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0111] In an example embodiment, the computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0112] Optionally, in the present embodiment, the computer program can be configured to execute the following steps by the computer program:

[0113] S1, obtaining a monitoring result obtained by monitoring a network connection state between the host machine and a default storage cluster, wherein the default storage cluster is a primary storage cluster corresponding to the host machine;

[0114] S2, generating a switching instruction according to the monitoring result;

[0115] S3, switching a current storage cluster connected with the host machine to a target storage cluster based on the switching instruction, and providing storage service for the host machine using a target cloud hard disk of the target storage cluster, wherein a storage type of the target storage cluster is different from a storage type of the current storage cluster, and the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.

[0116] Embodiments of the present application also provide an electronic device, as shown in the accompanying drawings, which comprises a memory 702 and a processor 704, the memory 702 storing a computer program, and the processor 704 is configured to execute steps in any of the above method embodiments through the computer program. Figure 7 The electronic device shown in the accompanying drawings comprises a memory 702 and a processor 704, the memory 702 storing a computer program, and the processor 704 is configured to execute steps in any of the above method embodiments through the computer program.

[0117] Optionally, in the present embodiment, the processor 704 can be configured to execute the following steps through the computer program:

[0118] S1, obtaining a monitoring result obtained by monitoring a network connection state between the host machine and a default storage cluster, wherein the default storage cluster is a master storage cluster corresponding to the host machine;

[0119] S2, generating a switching instruction according to the monitoring result;

[0120] S3, switching a current storage cluster connected with the host machine to a target storage cluster based on the switching instruction, and providing storage service for the host machine using a target cloud hard disk of the target storage cluster, wherein a storage type of the target storage cluster is different from a storage type of the current storage cluster, and the target storage cluster and the current storage cluster have established a first backup relationship, and the first backup relationship represents a backup relationship from the current storage cluster to the target storage cluster.

[0121] The specific examples in the present embodiment can refer to the examples described in the above embodiments and exemplary embodiments, which will not be repeated here.

[0122] Optionally, those skilled in the art can understand that, Figure 7 The structure shown in the accompanying drawings is only schematic, Figure 7 and does not limit the structure of the above electronic device. For example, the electronic device can further comprise more or less components (such as network interfaces, etc.) than those shown in the accompanying drawings, or have a different configuration from that shown in the accompanying drawings. Figure 7 Figure 7

[0123] ​​The memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the signal sending method and the routing node in the embodiments of the present application. The processor 704 executes various functions and data processing by running the software programs and modules stored in the memory 702, that is, implements the above-mentioned signal sending method. The memory 702 can include a high-speed random access memory, and can further include a non-volatile memory such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 702 can further include a memory remotely arranged with respect to the processor 704, which can be connected to the terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. Specifically, the memory 702 can be used to store system configuration files and the like, but is not limited to this. As an example, as shown in Figure 7 The memory 702 can include but is not limited to the acquisition module 62, the generation module 64, and the switching module 66 in the above-mentioned storage service providing apparatus. In addition, other module units in the above-mentioned storage service providing apparatus can also be included, but are not limited to this, and will not be described in detail in this example.

[0124] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the above-mentioned network can include wired networks and wireless networks. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.

[0125] In addition, the above-mentioned electronic device further includes a display 708 and a connection bus 710 for connecting various module components in the above-mentioned electronic device.

[0126] In other embodiments, the above-mentioned electronic device can be a node in a distributed system, and the distributed system can be a blockchain system, which can be a distributed system formed by the multiple nodes communicating through a network. The nodes can form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the peer-to-peer network.

[0127] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program realizes the steps in any of the method embodiments when executed by a processor.

[0128] The embodiment of the present application further provides another computer program product, which comprises a nonvolatile computer readable storage medium, and the nonvolatile computer readable storage medium stores a computer program, and the computer program realizes the steps in any of the method embodiments when executed by a processor.

[0129] The embodiment of the present application further provides a computer program, which comprises computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer readable storage medium, and executes the computer instructions, so that the computer device executes the steps in any of the method embodiments.

[0130] The specific examples in the embodiment can refer to the examples described in the above embodiments and exemplary embodiments, and the embodiment will not be repeated here.

[0131] Obviously, those skilled in the art should understand that each module or step of the present application described above can be realized by a general computing device, which can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, which can be realized by program codes executable by a computing device, so that they can be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described can be executed in an order different from here, or they can be manufactured into each integrated circuit module respectively, or multiple modules or steps among them can be manufactured into a single integrated circuit module to realize. Thus, the present application is not limited to any specific combination of hardware and software.

[0132] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for providing storage services, characterized in that, It is applied to a storage business system, wherein the storage business system is pre-configured with a host machine and a cloud disk that provides storage services for the host machine, and the host machine and the storage cluster of the cloud disk have a network connection; include: The monitoring results obtained by monitoring the network connection status between the host machine and the default storage cluster are obtained, wherein the default storage cluster is the main storage cluster corresponding to the host machine; A switching instruction is generated based on the monitoring results; Based on the switching instruction, the current storage cluster connected to the host machine is switched to the target storage cluster, and the target cloud disk of the target storage cluster is used to provide storage services to the host machine. The storage type of the target storage cluster is different from that of the current storage cluster. The target storage cluster and the current storage cluster have established a first backup relationship, which indicates a backup relationship from the current storage cluster to the target storage cluster. Before obtaining the monitoring results obtained from monitoring the network connection status between the host machine and the default storage cluster, the method further includes: A first storage cluster and a second storage cluster are determined from the storage clusters of the cloud disk. The regions to which the first storage cluster belongs are different from those to which the second storage cluster belongs. The storage type of the first storage cluster is primary storage type, and the first storage cluster is the primary storage cluster corresponding to the host machine. The storage type of the second storage cluster is backup storage type, and the second storage cluster is the backup storage cluster corresponding to the host machine. Establish a data backup channel between the first storage cluster and the second storage cluster; The first storage cluster is determined as the default storage cluster.

2. The method according to claim 1, characterized in that, The step of generating a switching instruction based on the monitoring results includes: If it is determined that the storage type of the current storage cluster is the primary storage type, and if it is determined that the current storage cluster belongs to the default storage cluster, and if it is determined that the monitoring result indicates that the network connection status between the host machine and the default storage cluster is abnormal, then a second switching instruction is generated. The step of controlling the current storage cluster to switch to the target storage cluster based on the switching command includes: The target storage cluster indicated by the second switching instruction is determined, wherein the storage type of the target storage cluster is a backup storage type; If it is determined that the target storage cluster belongs to the backup storage cluster corresponding to the host machine, the second switching instruction is used to switch the current storage cluster to the target storage cluster.

3. The method according to claim 2, characterized in that, Using the second switching instruction to switch the current storage cluster to the target storage cluster includes: In response to the second switching instruction, determine the disk type of the current cloud disk corresponding to the current storage cluster; Based on the disk type of the current cloud disk, switch the current storage cluster to the target storage cluster, and modify the disk permissions of the target cloud disk to allow writing; The step of switching the current storage cluster to the target storage cluster based on the disk type of the current cloud disk includes: If the current cloud disk is determined to be a system disk, delete the current cloud host connected to the current storage cluster from the host machine. A target cloud host is created on the host machine and connected to the target storage cluster, so that the target cloud hard disk is mounted on the target cloud host, wherein the hard disk type of the target cloud hard disk is a system hard disk; If the current cloud disk is determined to be a data disk, the current cloud disk is unloaded from the current cloud host connected to the current storage cluster. The target cloud disk is mounted to the current cloud host, wherein the target cloud disk is a data disk. The monitoring results are used to indicate that the network connection status between the host machine and the default storage cluster is abnormal, as determined by the following method: Obtain the network connection duration between the host machine and the default storage cluster; If the network connection duration is determined to be longer than the preset connection duration, the monitoring result is used to indicate that the network connection status between the host machine and the default storage cluster is abnormal.

4. The method according to claim 2, characterized in that, After switching the current storage cluster to the target storage cluster using the second switching instruction, the method further includes: If the monitoring results indicate that the network connection between the host machine and the default storage cluster is normal, a second backup relationship is established between the target storage cluster and the current storage cluster, wherein the second backup relationship represents a backup relationship from the target storage cluster to the current storage cluster; Obtain the storage data generated when the target storage cluster connects to the host machine; Based on the second backup relationship, the stored data is backed up to the default storage cluster; A third switching instruction is generated, and based on the third switching instruction, the target storage cluster connected to the host machine is switched to the default storage cluster.

5. The method according to claim 1, characterized in that, The step of generating a switching instruction based on the monitoring results includes: If the current storage cluster is determined to be a standby storage type, and if the monitoring result indicates that the network connection status between the host machine and the default storage cluster is normal, then a second switching instruction is generated. The step of switching the current storage cluster connected to the host machine to the target storage cluster based on the switching command includes: The second switching instruction is used to switch the current storage cluster to the target storage cluster, wherein the storage type of the target storage cluster is primary storage type and the target storage cluster belongs to the default storage cluster.

6. The method according to claim 1, characterized in that, The method further includes: The cluster configuration file is used to configure the primary storage cluster and the backup storage cluster for the host machine. The primary storage cluster represents the storage backend of the host machine, and the configuration information in the cluster configuration file includes at least the following: The cluster number of the primary storage cluster, the cluster number of the backup storage cluster, the storage pool name of the primary storage cluster, the storage pool name of the backup storage cluster, the login information corresponding to the host machine, and the driver path corresponding to the primary storage cluster. After configuring the primary storage cluster and the backup storage cluster on the host machine, cloud disks corresponding to the primary storage cluster and cloud disks for the backup storage cluster are created. The cloud disks corresponding to the primary storage cluster and cloud disks for the backup storage cluster both support different expansion specifications. A cloud hard drive corresponding to the main storage cluster is mounted on the host machine.

7. An apparatus for providing storage services, characterized in that, include: The acquisition module is used to acquire the monitoring results obtained by monitoring the network connection status between the host machine and the default storage cluster, wherein the default storage cluster is the main storage cluster corresponding to the host machine; The generation module is used to generate switching instructions based on the monitoring results; A switching module is used to switch the current storage cluster connected to the host machine to the target storage cluster based on the switching instruction, and use the target cloud disk of the target storage cluster to provide storage services to the host machine. The storage type of the target storage cluster is different from that of the current storage cluster. The target storage cluster and the current storage cluster have established a first backup relationship, which indicates a backup relationship from the current storage cluster to the target storage cluster. The acquisition module is further configured to: determine a first storage cluster and a second storage cluster from the storage clusters of the cloud disk, wherein the region to which the first storage cluster belongs is different from the region to which the second storage cluster belongs, the storage type of the first storage cluster is primary storage type, the first storage cluster is the primary storage cluster corresponding to the host machine, the storage type of the second storage cluster is backup storage type, the second storage cluster is the backup storage cluster corresponding to the host machine; establish a data backup channel between the first storage cluster and the second storage cluster; and determine the first storage cluster as the default storage cluster.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Database failure transfer method based on cloud hard disk and device thereof

    CN103780417A

  • Shared storage migration system and method, electronic equipment and storage medium

    CN113821168A