Cloud platform disaster recovery method, device, equipment, medium and product
By deploying load balancing service components with management interfaces and synchronizing data across environments, the method addresses the vulnerability of cloud platforms to regional disasters, ensuring uninterrupted load balancing services through seamless switching.
Patent Information
- Application Number
- CN202411018026.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing cloud platform disaster recovery methods fail to ensure high availability of load balancing services due to the inability to switch load balancing services during regional disasters, as multiple control nodes are often deployed in the same area, making them vulnerable to simultaneous failures.
Deploy load balancing service components on each control node with a management interface, establish binding relationships between these interfaces and ports, and synchronize data between primary and backup environments, allowing seamless switching to the backup environment during disasters.
Ensures uninterrupted load balancing service by reusing binding relationships, thereby maintaining high availability and facilitating successful service switching during cloud platform disasters.
Smart Images

Figure CN118550712B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of load balancing technology, and in particular to methods, devices, equipment, media and products for cloud platform disaster recovery. Background Art
[0002] Currently, multiple control nodes are usually deployed in the cloud platform, such as 3 nodes or 5 nodes, and multiple control nodes are usually stored in the same area. If a regional disaster occurs, all control nodes will be unavailable, and the high availability of the service cannot be guaranteed.
[0003] In the existing technology, a primary environment and a backup environment can be set up to perform data disaster recovery on the cloud platform. When the primary environment in a certain area fails, it can be switched to the backup environment in another area. However, this disaster recovery method is not suitable for the load balancing service in the cloud platform, resulting in the inability to switch the load balancing service. Summary of the invention
[0004] In view of the above problems, a method, apparatus, device, medium and product for cloud platform disaster recovery are proposed to overcome the above problems or at least partially solve the above problems, including:
[0005] A cloud platform disaster recovery method, wherein the cloud platform is deployed with a primary environment and a backup environment, and data is synchronized between the primary environment and the backup environment, and the method comprises:
[0006] In the main environment, multiple control nodes of the cloud platform are determined, a load balancing service component is deployed for each control node, and a load balancing management interface is configured for each load balancing service component;
[0007] Establishing a binding relationship between the load balancing management interface in the primary environment and the port in the primary environment;
[0008] In response to a disaster recovery switching event, switch to the standby environment, and establish a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment.
[0009] Optionally, after establishing the binding relationship between the load balancing management interface in the primary environment and the port in the primary environment, the method further includes:
[0010] Configuring the ports in the primary environment includes:
[0011] Add a tag to the port that establishes the binding relationship;
[0012] In the name of the marked port, set the ID of the control node where the bound load balancing management interface is located.
[0013] Optionally, it also includes:
[0014] Synchronize the port configuration information in the primary environment to the backup environment.
[0015] Optionally, establishing a binding relationship between a load balancing management interface in the standby environment and a port in the standby environment based on the binding relationship in the primary environment includes:
[0016] Determine whether there is a target port with a mark added in the standby environment;
[0017] In a case where the target port exists in the standby environment, judging, for the current control node in the standby environment, whether the target port has a first port whose name includes an identifier of the current control node;
[0018] In a case where a first port whose name includes the identifier of the current control node exists on the target port, a binding relationship between the load balancing management interface in the current control node and the first port is established.
[0019] Optionally, it also includes:
[0020] In the case that the target port does not exist in the standby environment, a binding relationship between the load balancing management interface in the current control node and the new port is established for the current control node in the standby environment.
[0021] Optionally, it also includes:
[0022] In the case that the target port does not have a first port whose name includes the identifier of the current control node, determine a target port list, and determine a second port from the target port list; wherein the second port is a port whose name does not include the identifier of any control node in the standby environment;
[0023] A binding relationship between the load balancing management interface in the current control node and the second port is established.
[0024] Optionally, determining the second port from the target port list includes:
[0025] Sorting the ports in the target port list;
[0026] Determine a control node list in the standby environment, sort the control nodes in the control node list, and determine a target sequence number of the current control node;
[0027] According to the target sequence number, a second port is determined from the target port list.
[0028] Optionally, determining the second port from the target port list according to the target sequence number includes:
[0029] Determine the port corresponding to the target serial number from the target port list;
[0030] When the name of the port corresponding to the target serial number does not include an identifier of any control node in the standby environment, it is determined that the port corresponding to the target serial number is the second port.
[0031] Optionally, it also includes:
[0032] In a case where the name of the port corresponding to the target serial number includes an identifier of any control node in the standby environment, the new port is determined to be the second port.
[0033] Optionally, after establishing the binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment, the method further includes: starting a load balancing service in the standby environment.
[0034] Optionally, in the primary environment, after establishing a binding relationship between each load balancing management interface and a port in the cloud platform, the method further includes:
[0035] In the primary environment, determining a virtual machine for implementing a load balancing service;
[0036] Based on the binding relationship, communication is performed between the virtual machine and the load balancing service component.
[0037] Optionally, the communicating between the virtual machine and the load balancing service component based on the binding relationship includes:
[0038] Through the address information of the port in the primary environment bound to each load balancing management interface, the virtual machine is controlled to send a heartbeat message to the load balancing management interface so as to be sent to the corresponding load balancing service component.
[0039] Optionally, there are multiple virtual machines for implementing the load balancing service, and the multiple virtual machines include a primary virtual machine and a backup virtual machine.
[0040] Optionally, before switching to the standby environment in response to the disaster recovery switching event, the method further includes:
[0041] In response to a user selection, determining a standby environment from a plurality of candidate standby environments;
[0042] Alternatively, the standby environment is randomly determined from a plurality of candidate standby environments.
[0043] Optionally, the disaster recovery switching event includes: an external interface of the load balancing service is inaccessible.
[0044] Optionally, the cloud platform is also deployed with a distributed database synchronization system, further comprising:
[0045] Data is synchronized between the primary environment and the backup environment through the distributed database synchronization system.
[0046] A cloud platform disaster recovery device, wherein the cloud platform is deployed with a primary environment and a backup environment, and data is synchronized between the primary environment and the backup environment, and the device comprises:
[0047] A main environment load balancing configuration module, used to determine multiple control nodes of the cloud platform in the main environment, deploy a load balancing service component for each control node, and configure a load balancing management interface for each load balancing service component;
[0048] A main environment binding relationship establishing module, used to establish a binding relationship between the load balancing management interface in the main environment and the port in the main environment;
[0049] The disaster recovery switching module is used to switch to the standby environment in response to a disaster recovery switching event, and to establish a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment.
[0050] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method described above when executed by the processor.
[0051] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0052] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described above.
[0053] The embodiments of the present invention have the following advantages:
[0054] In an embodiment of the present invention, multiple control nodes of the cloud platform are determined in the main environment, a load balancing service component is deployed for each control node, and a load balancing management interface is configured for each load balancing service component; a binding relationship between the load balancing management interface in the main environment and the port in the main environment is established; in response to a disaster recovery switching event, switching to the standby environment is performed, and based on the binding relationship in the main environment, a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment is established, thereby realizing load balancing service switching during cloud platform disaster recovery, and ensuring the switching success rate of the load balancing service by reusing the binding relationship of the service balancing service in the main environment in the standby environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0056] Figure 1 It is a flowchart of the steps of a cloud platform disaster recovery method provided by some embodiments of the present invention;
[0057] Figure 2 is a schematic diagram of a system architecture provided by some embodiments of the present invention;
[0058] Figure 3 is a schematic diagram of another system architecture provided by some embodiments of the present invention;
[0059] Figure 4 is a schematic diagram of another system architecture provided by some embodiments of the present invention;
[0060] Figure 5 It is a structural block diagram of another cloud platform disaster recovery method provided by some embodiments of the present invention;
[0061] Figure 6 It is a structural block diagram of a cloud platform disaster recovery device provided by some embodiments of the present invention;
[0062] Figure 7 is a structural block diagram of an electronic device provided by some embodiments of the present invention;
[0063] Figure 8 is a structural block diagram of a storage medium provided by some embodiments of the present invention;
[0064] Fig. 9 It is a structural block diagram of a program product provided by some embodiments of the present invention. DETAILED DESCRIPTION
[0065] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] In actual applications, load balancing services can be deployed and managed on the cloud platform to achieve flexible load balancing strategies and high availability, such as by deploying Octavia (a load balancing software).
[0067] The load balancing service in the cloud platform can be divided into two aspects: the control layer and the data layer:
[0068] For the control layer, the load balancing service component adopts a multi-copy mode, that is, there are corresponding services on multiple control nodes of the cloud platform. The request sent by the client will be assigned to one of the multiple copies for processing and response. If a node fails, the request will be automatically assigned to a normal node.
[0069] At the data level, load balancing data forwarding is implemented based on two virtual machines that are active and standby to each other. Under normal circumstances, the active virtual machine forwards the business. When the active virtual machine fails, the business automatically switches to the standby virtual machine, and the failed virtual machine is rebuilt and a new virtual machine is created to replace the failed virtual machine.
[0070] like Figure 1 ,The load balancing service components are distributed on multiple control nodes of the cloud platform. ,The load balancing service components on each control node can independently complete the customer’s ,requests, record the relevant operation data in the database, and synchronize ,to the virtual machine through the management network.
[0071] Since multiple independent service instances are set up, the failure of the load balancing service on any control node will not affect the availability of the service. However, because there are usually only three or five control plane nodes, and they are concentrated in a computer room in a region, or even on a rack, if the computer room has problems such as network failure, the current high availability mechanism will no longer be able to provide services.
[0072] In other words, the above solution can only deal with node-level failures. When all nodes fail, the availability of the service cannot be guaranteed, and the control plane data is not backed up, so data loss is likely to occur after a failure.
[0073] In a related technology, a corresponding standby environment can be deployed for the main environment, and a distributed database synchronization system can be deployed in the main environment; the data of the main environment can be synchronized to the standby environment through a full synchronization method and an incremental synchronization method based on the distributed database synchronization system; in response to a failure of the main environment, the incremental synchronization method is disabled, and the standby environment is enabled to take over all business services of the main environment; in response to the main environment returning to normal, the data of the standby environment is restored to the main environment through a full synchronization method.
[0074] In other words, the above solution can achieve disaster recovery in the form of full data synchronization and service switching. For ordinary control plane services, service switching can be achieved by changing the cluster service IP, but for load balancing services, service switching cannot be achieved.
[0075] like Figure 2The load balancing service is implemented based on virtual machines, and the load balancing software runs in the virtual machines to implement business forwarding. The control node manages the virtual machines and sends configurations through a load balancing management interface (o-hm0) device to communicate with the virtual machines. Each virtual machine will record the addresses of the load balancing management interfaces on all control nodes, and periodically send health heartbeat messages (including statistical data, etc.) to all load balancing management interfaces. If the IP address of the load balancing management interface is not reused after the disaster recovery switch, and the address of the load balancing management interface changes, the heartbeat message sent by the virtual machine cannot be received and processed by the load balancing service on the control node.
[0076] The load balancing management interface is a tap device that is bound to the port resources in the cloud platform. The IP address and MAC address are both attributes of the port. One port corresponds to one load balancing management interface, and one load balancing management interface is deployed on each control node. The network card device in the virtual machine is similar to the load balancing management interface and is also bound to the port in the cloud platform. The port bound to the network card in the virtual machine and the port bound to the load balancing management interface belong to the same subnet. Ports in the same subnet can communicate directly.
[0077] In addition, the port bound to the load balancing management interface will have a special mark, which can be used to filter out the existing ports for managing virtual machines, and the port name contains the name of the control node where the load balancing management interface is located. When the active and standby environments are switched, the port data will be synchronized.
[0078] Since the above solution does not process the load balancing management interface (ie, the load balancing management interface), the continuity and availability of the load balancing service after disaster recovery cannot be guaranteed.
[0079] In an embodiment of the present invention, multiple control nodes of the cloud platform are determined in the main environment, a load balancing service component is deployed for each control node, and a load balancing management interface is configured for each load balancing service component; a binding relationship between the load balancing management interface in the main environment and the port in the main environment is established; in response to a disaster recovery switching event, switching to the standby environment is performed, and based on the binding relationship in the main environment, a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment is established, thereby realizing load balancing service switching during cloud platform disaster recovery, and ensuring the switching success rate of the load balancing service by reusing the binding relationship of the service balancing service in the main environment in the standby environment.
[0080] Through the embodiments of the present invention, technical personnel can ensure uninterrupted business while solving faults, and also support manual disaster recovery switching. For environmental transformation and upgrade scenarios, they can switch to a backup environment without being affected by environmental upgrades, and apply service detection methods, primary and backup environment data synchronization mechanisms, primary and backup environment switching strategies, and load balancing management interfaces during service switching.
[0081] Reference Figure 3 , showing a step flow chart of a cloud platform disaster recovery method provided by some embodiments of the present invention, the cloud platform is deployed with a primary environment and a backup environment, and data is synchronized between the primary environment and the backup environment.
[0082] In some embodiments of the present invention, the cloud platform is also deployed with a distributed database synchronization system, through which data is synchronized between the primary environment and the backup environment.
[0083] like Figure 4 For the control plane, it is divided into primary and backup environments. Only one environment provides services to the outside at the same time. Multiple backup environments can be deployed as needed. When the backup environment takes over the service, the primary environment switches to the backup environment.
[0084] The number of nodes in the active and standby environments must be consistent, and the two environments must ensure the same operating system node configuration, complete basic network configuration and hardware configuration. In some examples, the disaster recovery configuration includes configuring the role of each environment (active / standby), IP address, SSH port (default is 22), SSH login username and password (used to access nodes during deployment and remotely execute deployment commands).
[0085] Disaster recovery services are running in each environment, responsible for service detection, data synchronization, and service switching. Service detection: periodic detection of the load balancing service. If a service abnormality is detected, the service is migrated to the backup environment. The service detection method is to access the API interface provided by the load balancing service. When the service is normal, the API interface can be accessed normally and the correct data can be returned. When a failure occurs, the interface cannot be accessed. Data synchronization: The backup environment periodically synchronizes the control plane data from the primary environment to ensure the consistency of the primary and backup environment data. The multi-copy mechanism ensures the security of the data. In addition, the early synchronization of data also facilitates rapid switching during disaster recovery. Active service switching: manually select a backup environment for switching. The implementation method is to first shut down the primary environment service and then deploy related services in the backup environment. Passive service switching: when a service failure is detected, a backup environment is automatically and randomly selected for service switching. The switching process is the same as the active switching process.
[0086] like Figure 5After the disaster recovery configuration is completed, the load balancing service is deployed only in the primary environment. The backup environment does not deploy the load balancing service, only the disaster recovery service is started, and the primary environment also starts the disaster recovery service. During the service period of the primary environment, the disaster recovery service in the backup environment actively monitors the health of the primary environment service and periodically synchronizes the control plane data of the primary environment. When the disaster recovery service in the backup environment detects that the primary environment service is abnormal, it switches to the backup environment. If there are multiple backup environments, a backup environment is randomly selected for switching. The switching process is to stop the primary environment service first, and then the backup environment switches the role to the primary environment. After the load balancing management interface is configured, the load balancing service is started. Other backup environments recognize the new primary environment and continue to monitor services and synchronize data with the new primary environment. In some examples, after the backup environment switches to the primary environment, the original primary environment switches to the backup environment. If the old primary environment fails, it will wait for repair and start the disaster recovery service first. At this time, if it is found that there is currently a primary environment, it will set itself as a backup environment.
[0087] Specifically, the following steps may be included:
[0088] Step 301, in the main environment, determine multiple control nodes of the cloud platform, deploy a load balancing service component for each control node, and configure a load balancing management interface for each load balancing service component.
[0089] In actual applications, multiple control nodes of the cloud platform can be set up in the main environment, and a load balancing service component can be deployed on each control node.
[0090] For the control layer, the load balancing service component adopts a multi-copy mode, that is, there are corresponding services on multiple control nodes of the cloud platform. The request sent by the client will be assigned to one of the multiple copies for processing and response. If a node fails, the request will be automatically assigned to a normal node.
[0091] For each load balancing component, a load balancing management interface may be configured. In some examples, the control node manages and distributes configurations of the virtual machine by communicating with the virtual machine through a load balancing management interface (o-hm0).
[0092] Step 302: Establish a binding relationship between the load balancing management interface in the primary environment and the port in the primary environment.
[0093] For the load balancing management interface, the implementation of its communication depends on the port in the main environment. For example, if the IP address or MAC address of the port is used, the load balancing management interface needs to be bound to the port in the main environment before the load balancing management interface can be used for communication.
[0094] In some examples, the load balancing management interface is a tap device that is bound to the port resources in the cloud platform. The IP address and MAC address are both attributes of the port. One port corresponds to one load balancing management interface, and one load balancing management interface is deployed on each control node. The network card device in the virtual machine is similar to the load balancing management interface and is also bound to the port in the cloud platform. The port bound to the network card in the virtual machine and the port bound to the load balancing management interface belong to the same subnet. Ports in the same subnet can communicate directly.
[0095] In some embodiments of the present invention, after establishing the binding relationship between the load balancing management interface in the primary environment and the port in the primary environment, the method further includes:
[0096] Configuring the ports in the primary environment includes:
[0097] A tag is added to the port for establishing a binding relationship; and an identifier of the control node where the bound load balancing management interface is located is set in the name of the port for adding the tag.
[0098] In some embodiments of the present invention, it also includes:
[0099] Synchronize the port configuration information in the primary environment to the backup environment.
[0100] In actual applications, there are a large number of ports, and for the ports bound to the load balancing management interface, tags can be added, and the identifier of the control node where the bound load balancing management interface is located can be set in the port name, such as the identifier is the name of the control node.
[0101] In some examples, the port bound to the load balancing management interface has a special tag, which can be used to filter out the existing ports for managing virtual machines, and the port name contains the name of the control node where the load balancing management interface is located. When the active and standby environments are switched, the port data will be synchronized.
[0102] In some embodiments of the present invention, in the primary environment, after establishing a binding relationship between each load balancing management interface and a port in the cloud platform, the method further includes:
[0103] In the main environment, a virtual machine for implementing a load balancing service is determined; and based on the binding relationship, communication is performed between the virtual machine and the load balancing service component.
[0104] In some embodiments of the present invention, the communicating between the virtual machine and the load balancing service component based on the binding relationship includes:
[0105] Through the address information of the port in the primary environment bound to each load balancing management interface, the virtual machine is controlled to send a heartbeat message to the load balancing management interface so as to be sent to the corresponding load balancing service component.
[0106] In some embodiments of the present invention, there are multiple virtual machines for implementing the load balancing service, and the multiple virtual machines include a primary virtual machine and a backup virtual machine.
[0107] At the data level, load balancing data forwarding is implemented based on two virtual machines that are active and standby to each other. Under normal circumstances, the active virtual machine forwards the business. When the active virtual machine fails, the business automatically switches to the standby virtual machine, and the failed virtual machine is rebuilt and a new virtual machine is created to replace the failed virtual machine, achieving high availability of the load balancing service.
[0108] In actual applications, load balancing services are implemented based on virtual machines, and load balancing software runs in virtual machines to implement business forwarding. The control node manages and configures the virtual machines through a load balancing management interface (o-hm0) device to communicate with the virtual machines. Each virtual machine will record the address of the load balancing management interface on all control nodes, and periodically send health heartbeat messages (including statistical data, etc.) to all load balancing management interfaces.
[0109] Step 303: In response to the disaster recovery switching event, switch to the standby environment, and establish a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment.
[0110] In some embodiments of the present invention, the disaster recovery switching event includes:
[0111] The external interface of the load balancing service is inaccessible.
[0112] In actual applications, when a disaster recovery switching event is detected, the primary environment can be switched to the backup environment, such as periodically testing the load balancing service. If a service anomaly is detected, the service is migrated to the backup environment. The service detection method is to access the API interface provided by the load balancing service. When the service is normal, the API interface can be accessed normally and the correct data is returned. When a fault occurs, the interface cannot be accessed. By performing disaster recovery switching when it is detected that the external interface of the load balancing service is inaccessible, high availability is guaranteed.
[0113] In some embodiments of the present invention, before switching to the backup environment in response to a disaster recovery switching event, the method further includes: determining a backup environment from a plurality of candidate backup environments in response to a user selection; or randomly determining a backup environment from a plurality of candidate backup environments.
[0114] The disaster recovery switching process includes active service switching and passive service switching, which realizes the flexibility of disaster recovery switching. Active service switching: manually select a backup environment for switching, which is implemented by shutting down the main environment service first and then deploying related services in the backup environment. Passive service switching: when a service failure is detected, a backup environment is automatically and randomly selected for service switching. The switching process is the same as the active switching process.
[0115] In actual applications, if the IP address of the load balancing management interface is not reused after disaster recovery switching and the address of the load balancing management interface changes, the heartbeat message sent by the virtual machine cannot be received and processed by the load balancing service on the control node.
[0116] In the embodiment of the present invention, the binding relationship between the load balancing management interface in the standby environment and the port in the standby environment can be established based on the binding relationship in the main environment, so as to realize the processing of the load balancing management interface, reuse the existing IP, and create a new port for deployment when the existing IP address is insufficient. This not only solves the problem of reuse of the load balancing management IP and the allocation of the existing IP after the disaster recovery switch, but also automatically adapts to the problem of inconsistent number of nodes before and after the disaster recovery switch. At the same time, the processing flow of the load balancing management interface can also be applied in the scenarios of switching back to the main environment and newly deploying load balancing services.
[0117] In some embodiments of the present invention, establishing a binding relationship between a load balancing management interface in the standby environment and a port in the standby environment based on the binding relationship in the primary environment includes:
[0118] Determine whether there is a target port with a mark added in the standby environment; if the target port exists in the standby environment, determine, for the current control node in the standby environment, whether there is a first port whose name includes the identifier of the current control node in the target port; if there is a first port whose name includes the identifier of the current control node in the target port, establish a binding relationship between the load balancing management interface in the current control node and the first port.
[0119] In actual applications, the number of marked target ports in the standby environment can be queried. If the number is not 0, that is, the standby environment has target ports, indicating that the previous ports can be reused, then for each control node, it can be determined whether there are ports bound to itself among the target ports.
[0120] Specifically, since the name of the target port includes the identifier of the bound control node, it can be determined whether the target port has a first port whose name includes the identifier of the current control node, that is, whether the target port has a bound port.
[0121] When the target port has a first port whose name includes the identifier of the current control node, a binding relationship between the load balancing management interface in the current control node and the first port is established, that is, the previous port is directly reused to create and bind the load balancing management interface.
[0122] In some embodiments of the present invention, it also includes:
[0123] In the case that the target port does not exist in the standby environment, a binding relationship between the load balancing management interface in the current control node and the new port is established for the current control node in the standby environment.
[0124] In the case where there is no target port in the standby environment, that is, the number of marked target ports in the standby environment is 0, indicating that the previous port cannot be reused, and the current environment is deployed for the first time, a new port can be established and bound to the load balancing management interface.
[0125] In some embodiments of the present invention, it also includes:
[0126] When the target port does not have a first port whose name includes the identifier of the current control node, determine a target port list and determine a second port from the target port list; and establish a binding relationship between the load balancing management interface in the current control node and the second port.
[0127] The second port is a port whose name does not include an identifier of any control node in the standby environment.
[0128] In some embodiments of the present invention, determining the second port from the target port list includes:
[0129] Sort the ports in the target port list; determine the control node list in the standby environment, sort the control nodes in the control node list, and determine the target sequence number of the current control node; determine the second port from the target port list according to the target sequence number.
[0130] In some examples, in addition to selecting ports after sorting, a random selection method can also be used, that is, determining ports in the target port list that do not contain the identifier of any control node in the backup environment, and then randomly selecting a port from these ports as the second port.
[0131] In some embodiments of the present invention, determining the second port from the target port list according to the target sequence number includes:
[0132] Determine the port corresponding to the target serial number from the target port list; and when the name of the port corresponding to the target serial number does not include the identifier of any control node in the standby environment, determine that the port corresponding to the target serial number is the second port.
[0133] In some embodiments of the present invention, it also includes:
[0134] In a case where the name of the port corresponding to the target serial number includes an identifier of any control node in the standby environment, the new port is determined to be the second port.
[0135] In actual applications, the control IP list (ie, target port list) of the currently marked target port is obtained and sorted to obtain the sorted control IP list sort_ip_list, and the control node list of the current environment control node is obtained and sorted to obtain the sorted control node list sort_host_list.
[0136] Traverse sort_host_list and find the index of the current control node in the node list. If the control IP list sort_ip_list does not have an element sorted with this index, it means that the number of nodes in the current environment is greater than the number of existing ports. You need to create a new port and then create a load balancing management interface for binding.
[0137] If the control IP list sort_ip_list has an element sorted with this sequence number, further determine whether the port name corresponding to the control IP contains other control node names (i.e., the identifier of any control node in the standby environment). If no other control node names are included, reuse them, create a load balancing management interface and bind it to the port. If other control node names are included, create a new port and create a load balancing management interface device for binding.
[0138] In some embodiments of the present invention, after establishing the binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment, the method further includes:
[0139] Start the load balancing service in the standby environment.
[0140] After the binding relationship between the load balancing management interface in the standby environment and the port in the standby environment is established, that is, after the load balancing management interface is processed as described above, the load balancing service can be started in the standby environment.
[0141] In an embodiment of the present invention, multiple control nodes of the cloud platform are determined in the main environment, a load balancing service component is deployed for each control node, and a load balancing management interface is configured for each load balancing service component; a binding relationship between the load balancing management interface in the main environment and the port in the main environment is established; in response to a disaster recovery switching event, switching to the standby environment is performed, and based on the binding relationship in the main environment, a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment is established, thereby realizing load balancing service switching during cloud platform disaster recovery, and ensuring the switching success rate of the load balancing service by reusing the binding relationship of the service balancing service in the main environment in the standby environment.
[0142] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0143] Reference Figure 6 , shows a schematic diagram of the structure of a cloud platform disaster recovery method device provided by some embodiments of the present invention, wherein the cloud platform is deployed with a primary environment and a backup environment, and data synchronization between the primary environment and the backup environment may specifically include the following modules:
[0144] The main environment load balancing configuration module 601 is used to determine multiple control nodes of the cloud platform in the main environment, deploy a load balancing service component for each control node, and configure a load balancing management interface for each load balancing service component;
[0145] A main environment binding relationship establishing module 602, used to establish a binding relationship between the load balancing management interface in the main environment and the port in the main environment;
[0146] The disaster recovery switching module 603 is used to switch to the standby environment in response to a disaster recovery switching event, and to establish a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment.
[0147] Optionally, after establishing the binding relationship between the load balancing management interface in the primary environment and the port in the primary environment, the method is further used to:
[0148] Configuring the ports in the primary environment includes:
[0149] Add a tag to the port that establishes the binding relationship;
[0150] In the name of the marked port, set the ID of the control node where the bound load balancing management interface is located.
[0151] Optionally, also used to:
[0152] Synchronize the port configuration information in the primary environment to the backup environment.
[0153] Optionally, establishing a binding relationship between a load balancing management interface in the standby environment and a port in the standby environment based on the binding relationship in the primary environment includes:
[0154] Determine whether there is a target port with a mark added in the standby environment;
[0155] In a case where the target port exists in the standby environment, judging, for the current control node in the standby environment, whether the target port has a first port whose name includes an identifier of the current control node;
[0156] In a case where a first port whose name includes the identifier of the current control node exists on the target port, a binding relationship between the load balancing management interface in the current control node and the first port is established.
[0157] Optionally, also used to:
[0158] In the case that the target port does not exist in the standby environment, a binding relationship between the load balancing management interface in the current control node and the new port is established for the current control node in the standby environment.
[0159] Optionally, also used to:
[0160] In the case that the target port does not have a first port whose name includes the identifier of the current control node, determine a target port list, and determine a second port from the target port list; wherein the second port is a port whose name does not include the identifier of any control node in the standby environment;
[0161] A binding relationship between the load balancing management interface in the current control node and the second port is established.
[0162] Optionally, determining the second port from the target port list includes:
[0163] Sorting the ports in the target port list;
[0164] Determine a control node list in the standby environment, sort the control nodes in the control node list, and determine a target sequence number of the current control node;
[0165] According to the target sequence number, a second port is determined from the target port list.
[0166] Optionally, determining the second port from the target port list according to the target sequence number includes:
[0167] Determine the port corresponding to the target serial number from the target port list;
[0168] When the name of the port corresponding to the target serial number does not include an identifier of any control node in the standby environment, it is determined that the port corresponding to the target serial number is the second port.
[0169] Optionally, also used to:
[0170] In a case where the name of the port corresponding to the target serial number includes an identifier of any control node in the standby environment, the new port is determined to be the second port.
[0171] Optionally, after establishing the binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment, the method further includes: starting a load balancing service in the standby environment.
[0172] Optionally, in the primary environment, after establishing a binding relationship between each load balancing management interface and a port in the cloud platform, it is also used to:
[0173] In the primary environment, determining a virtual machine for implementing a load balancing service;
[0174] Based on the binding relationship, communication is performed between the virtual machine and the load balancing service component.
[0175] Optionally, the communicating between the virtual machine and the load balancing service component based on the binding relationship includes:
[0176] Through the address information of the port in the primary environment bound to each load balancing management interface, the virtual machine is controlled to send a heartbeat message to the load balancing management interface so as to be sent to the corresponding load balancing service component.
[0177] Optionally, there are multiple virtual machines for implementing the load balancing service, and the multiple virtual machines include a primary virtual machine and a backup virtual machine.
[0178] Optionally, before switching to the standby environment in response to the disaster recovery switching event, the method is further configured to:
[0179] In response to a user selection, determining a standby environment from a plurality of candidate standby environments;
[0180] Alternatively, the standby environment is randomly determined from a plurality of candidate standby environments.
[0181] Optionally, the disaster recovery switching event includes: an external interface of the load balancing service is inaccessible.
[0182] Optionally, the cloud platform is also deployed with a distributed database synchronization system, which is also used for:
[0183] Data is synchronized between the primary environment and the backup environment through the distributed database synchronization system.
[0184] In an embodiment of the present invention, multiple control nodes of the cloud platform are determined in the main environment, a load balancing service component is deployed for each control node, and a load balancing management interface is configured for each load balancing service component; a binding relationship between the load balancing management interface in the main environment and the port in the main environment is established; in response to a disaster recovery switching event, switching to the standby environment is performed, and based on the binding relationship in the main environment, a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment is established, thereby realizing load balancing service switching during cloud platform disaster recovery, and ensuring the switching success rate of the load balancing service by reusing the binding relationship of the service balancing service in the main environment in the standby environment.
[0185] Reference Figure 7 , shows an electronic device provided by some embodiments of the present invention, including a processor 701, a memory 702, and a computer program stored in the memory 702 and capable of running on the processor 701, and the computer program implements the above method when executed by the processor.
[0186] Reference Figure 8 , shows a computer-readable storage medium 800 provided in some embodiments of the present invention, on which a computer program is stored, and the computer program implements the above method when executed by a processor.
[0187] Reference Fig. 9 , shows a computer program product 900 provided by some embodiments of the present invention, including a computer program, and the computer program implements the above method when executed by a processor.
[0188] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0189] The cloud platform disaster recovery method, device, equipment, medium and product provided above are introduced in detail. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A cloud platform disaster recovery method, characterized in that: The cloud platform is deployed with a primary environment and a backup environment, and data is synchronized between the primary environment and the backup environment. The method includes: In the main environment, multiple control nodes of the cloud platform are determined, a load balancing service component is deployed for each control node, and a load balancing management interface is configured for each load balancing service component; Establishing a binding relationship between the load balancing management interface in the primary environment and the port in the primary environment; Configuring the ports in the main environment includes: adding a mark to the port with which the binding relationship is established; setting the identifier of the control node where the bound load balancing management interface is located in the name of the port with the mark added; Synchronize the port configuration information in the primary environment to the standby environment; In response to a disaster recovery switching event, switch to the standby environment, and establish a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment; Wherein, based on the binding relationship in the primary environment, establishing a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment includes: Determine whether there is a target port with a mark added in the standby environment; In a case where the target port exists in the standby environment, judging, for the current control node in the standby environment, whether the target port has a first port whose name includes an identifier of the current control node; In a case where a first port whose name includes the identifier of the current control node exists on the target port, a binding relationship between the load balancing management interface in the current control node and the first port is established.
2. The method according to claim 1, characterized in that Also includes: In the case that the target port does not exist in the standby environment, a binding relationship between the load balancing management interface in the current control node and the new port is established for the current control node in the standby environment.
3. The method according to claim 1, characterized in that Also includes: In the case that the target port does not have a first port whose name includes the identifier of the current control node, determine a target port list, and determine a second port from the target port list; wherein the second port is a port whose name does not include the identifier of any control node in the standby environment; A binding relationship between the load balancing management interface in the current control node and the second port is established.
4. The method according to claim 3, characterized in that: The determining the second port from the target port list comprises: Sorting the ports in the target port list; Determine a control node list in the standby environment, sort the control nodes in the control node list, and determine a target sequence number of the current control node; According to the target sequence number, a second port is determined from the target port list.
5. The method according to claim 4, characterized in that The step of determining the second port from the target port list according to the target sequence number includes: Determine the port corresponding to the target serial number from the target port list; When the name of the port corresponding to the target serial number does not include an identifier of any control node in the standby environment, it is determined that the port corresponding to the target serial number is the second port.
6. The method according to claim 5, characterized in that Also includes: In a case where the name of the port corresponding to the target serial number includes an identifier of any control node in the standby environment, the new port is determined to be the second port.
7. The method according to any one of claims 1 to 6, characterized in that: After establishing the binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment, the method further includes: starting a load balancing service in the standby environment.
8. The method according to any one of claims 1 to 6, characterized in that: In the main environment, after establishing a binding relationship between each load balancing management interface and a port in the cloud platform, the method further includes: In the primary environment, determining a virtual machine for implementing a load balancing service; Based on the binding relationship, communication is performed between the virtual machine and the load balancing service component.
9. The method according to claim 8, characterized in that The communicating between the virtual machine and the load balancing service component based on the binding relationship includes: Through the address information of the port in the primary environment bound to each load balancing management interface, the virtual machine is controlled to send a heartbeat message to the load balancing management interface so as to be sent to the corresponding load balancing service component.
10. The method according to claim 8, characterized in that There are multiple virtual machines for implementing load balancing services, and the multiple virtual machines include a primary virtual machine and a backup virtual machine.
11. The method according to any one of claims 1 to 6, characterized in that: Before switching to the standby environment in response to the disaster recovery switching event, the method further includes: In response to a user selection, determining a standby environment from a plurality of candidate standby environments; Alternatively, the standby environment is randomly determined from a plurality of candidate standby environments.
12. The method according to any one of claims 1 to 6, characterized in that: The disaster recovery switching event includes: the external interface of the load balancing service is inaccessible.
13. The method according to any one of claims 1 to 6, characterized in that: The cloud platform is also deployed with a distributed database synchronization system, which also includes: Data is synchronized between the primary environment and the backup environment through the distributed database synchronization system.
14. A cloud platform disaster recovery device, characterized in that: The cloud platform is deployed with a primary environment and a backup environment, data is synchronized between the primary environment and the backup environment, and the device includes: A main environment load balancing configuration module, used to determine multiple control nodes of the cloud platform in the main environment, deploy a load balancing service component for each control node, and configure a load balancing management interface for each load balancing service component; A main environment binding relationship establishing module, used to establish a binding relationship between the load balancing management interface in the main environment and the port in the main environment; A disaster recovery switching module, configured to switch to the standby environment in response to a disaster recovery switching event, and to establish a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment based on the binding relationship in the primary environment; After establishing the binding relationship between the load balancing management interface in the primary environment and the port in the primary environment, the device is further used to: Configuring the ports in the main environment includes: adding a mark to the port with which the binding relationship is established; setting the identifier of the control node where the bound load balancing management interface is located in the name of the port with the mark added; Synchronize the port configuration information in the primary environment to the standby environment; Wherein, based on the binding relationship in the primary environment, establishing a binding relationship between the load balancing management interface in the standby environment and the port in the standby environment includes: Determine whether there is a target port with a mark added in the standby environment; In a case where the target port exists in the standby environment, judging, for the current control node in the standby environment, whether the target port has a first port whose name includes an identifier of the current control node; In a case where a first port whose name includes the identifier of the current control node exists on the target port, a binding relationship between the load balancing management interface in the current control node and the first port is established.
15. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 13 when executed by the processor.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
17. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 13.
