Server failure recovery method, device, electronic device and storage medium
By obtaining application copy data of faulty virtual machines on the cloud computing platform, calculating recovery priorities and migrating them in sequence, the problem of complexity of virtual machine migration when a physical server fails in the cloud computing platform is solved, and efficient fault recovery and resource optimization are achieved.
Patent Information
- Application Number
- CN202210919147.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-01
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2042-08-01
AI Technical Summary
In cloud computing platforms, when physical servers fail, the complexity and difficulty caused by how to efficiently migrate virtual machines, especially in scenarios where hybrid cloud-native and non-cloud-native applications coexist, is difficult to effectively solve with existing technology.
By obtaining the application copy data of the faulty virtual machine, the recovery priority is calculated, and fault migration is performed sequentially based on the priority to ensure efficient recovery. Specific steps include obtaining failed virtual machines, determining the number of cloud-native and non-cloud-native application copies, assigning weights, calculating recovery priorities, and performing fault migration in order of priority.
Efficient recovery of server failures in the cloud platform is achieved, reducing resource waste and improving recovery efficiency, ensuring the normal operation of all application copies.
Smart Images

Figure CN115292003B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of cloud computing technology, and specifically relates to a server failure recovery method, device, electronic device and storage medium in a cloud platform. Background Art
[0002] In the field of cloud computing, cloud-native technology is highly favored due to its advantages such as containerization and microservices, and has become a standardized implementation path for cloud applications. However, there are still a considerable number of applications that have not yet achieved cloud-nativeness and can only run in traditional forms. Therefore, the current typical practical cloud platform is basically a three-layer structure of physical server-virtual machine-container, that is, virtual machines are running on physical server clusters, and virtual machines carry cloud-native applications (running in the form of Kubernetes POD; Kubernetes: used to manage containerized applications on multiple hosts in the cloud platform, POD is the smallest resource management component in Kubernetes and the resource object that minimizes the running of containerized applications) and traditional applications (that is, non-cloud-native applications, running in the form of single containers, static PODs or even non-containers).
[0003] Since each virtual machine contains a hybrid scenario of cloud-native applications and non-cloud-native applications, it brings many complexities and difficulties to the management of the three-layer structure of physical server-virtual machine-container. When a physical server fails, how to achieve efficient migration of the faulty virtual machine becomes an urgent problem to be solved. Summary of the invention
[0004] To solve the above technical problems, the embodiments of the present application provide a server failure recovery method and device in a cloud platform, an electronic device, and a computer-readable storage medium.
[0005] According to one aspect of an embodiment of the present application, a server fault recovery method in a cloud platform is provided, including obtaining a faulty server in the cloud platform and a faulty virtual machine on the corresponding faulty server; determining the recovery priority of each faulty virtual machine based on application replica data on different faulty virtual machines; and performing fault migration of the corresponding faulty virtual machines in sequence based on the recovery priority of each faulty virtual machine.
[0006] In one embodiment, after obtaining the failed server and the failed virtual machine on the corresponding failed server in the cloud platform, the method further includes:
[0007] A control instruction is sent so that the application copy on the failed virtual machine does not operate during the recovery of the failed virtual machine.
[0008] In one embodiment, determining the recovery priority of each faulty virtual machine according to the application replica data on different faulty virtual machines includes:
[0009] Extract the number of cloud-native application replicas and non-cloud-native application replicas on different faulty VMs;
[0010] The recovery priority of the corresponding faulty virtual machine is calculated based on the number of cloud-native application replicas and the number of non-cloud-native application replicas of each faulty virtual machine.
[0011] In one embodiment, the calculating the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application replicas and the number of non-cloud-native application replicas of each faulty virtual machine includes:
[0012] Assign corresponding weights to the cloud-native application replica and the non-cloud-native application replica respectively;
[0013] The recovery priority of each faulty virtual machine is calculated according to the number of the cloud-native application replicas, the number of the non-cloud-native application replicas, and the weights of the cloud-native application replicas and the non-cloud-native application.
[0014] In one embodiment, the calculating the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application replicas and the number of non-cloud-native application replicas of each faulty virtual machine includes:
[0015] p vm1 =C t∈vm1 ·w t +c cn∈vm1 ·w cn
[0016] Among them, p vm1 is the recovery priority of the failed virtual machine vm1, c t∈vm1 is the number of non-cloud native application replicas hosted by vm1, w t is the weight of the non-cloud native application replica, c cn∈vm1 is the number of cloud native application replicas hosted by vm1, w cn The weight of the cloud native application replica.
[0017] In one embodiment, the step of sequentially performing the fault migration of the corresponding faulty virtual machines based on the recovery priority of each faulty virtual machine includes:
[0018] Determining a target address of a backup server in the cloud platform;
[0019] Based on the recovery priority of each faulty virtual machine, fault migration tasks of different faulty virtual machines are sequentially created, so that the corresponding faulty virtual machine is migrated to the standby server based on the target address.
[0020] In one embodiment, the step of sequentially performing the fault migration of the corresponding faulty virtual machines based on the recovery priority of each faulty virtual machine includes:
[0021] Sort the faulty virtual machines based on the recovery priority order of each faulty virtual machine to obtain a recovery list;
[0022] A fault migration task corresponding to the faulty virtual machine is created based on the recovery list, so that each faulty virtual machine completes the fault migration in sequence.
[0023] According to one aspect of an embodiment of the present application, a server fault recovery device in a cloud platform is provided, including: a fault information acquisition module, configured to obtain a faulty server and a faulty virtual machine on the corresponding faulty server in the cloud platform; a recovery priority acquisition module, configured to determine the recovery priority of each faulty virtual machine based on the application copy data on different faulty virtual machines; a fault migration module, configured to perform fault migration of the corresponding faulty virtual machines in sequence based on the recovery priority of each faulty virtual machine.
[0024] According to one aspect of an embodiment of the present application, there is provided an electronic device, comprising one or more processors; and a storage device for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the electronic device implements the server failure recovery method in the cloud platform as described above.
[0025] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the server failure recovery method in the cloud platform as described above.
[0026] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the server failure recovery method in the cloud platform provided in the above various optional embodiments.
[0027] In the technical solution provided in the embodiments of the present application, the application copy data of the faulty virtual machine on the faulty server in the cloud platform is obtained to determine the recovery priority of different faulty virtual machines, so that the faulty virtual machines with high recovery priority are given priority for fault migration, thereby realizing efficient fault recovery of servers in the cloud platform.
[0028] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0030] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0031] Figure 2 is a schematic diagram of another implementation environment involved in the present application;
[0032] Figure 3 yes Figure 2 A process diagram of a server failure recovery method in a cloud platform of the present application in the implementation environment shown;
[0033] Figure 4 is a flow chart of a server failure recovery method in a cloud platform shown in an exemplary embodiment of the present application;
[0034] Figure 5 yes Figure 4 A flowchart of step S430 in the illustrated embodiment in an exemplary embodiment;
[0035] Figure 6 yes Figure 5 A flowchart of step S530 in the illustrated embodiment in another exemplary embodiment;
[0036] Figure 7 It is a structural schematic diagram of a server failure recovery device in a cloud platform shown in an exemplary embodiment of the present application;
[0037] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0040] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0041] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0042] The server failure recovery method and device, electronic device, and storage medium in the cloud platform proposed in the embodiments of the present application are described in detail below.
[0043] First see Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a controller 100 and a server 200, and the controller 100 and the server 200 communicate with each other via a wired or wireless network.
[0044] certainly, Figure 1 The number of server ends 200 is only exemplary. In other embodiments, there may be other numbers of server ends 200. In this embodiment, multiple server ends 200 constitute a server cluster. Virtual machines run on the physical server cluster, and the virtual machines carry both cloud-native applications and non-cloud-native applications.
[0045] The controller 100 is used to perform server fault recovery control in the cloud platform, and can perform fault recovery when a server in the cloud platform constituted by the server end 200 fails.
[0046] Exemplarily, when the controller 100 detects that a server 200 in the cloud platform has failed, it obtains the failed server in the cloud platform and the failed virtual machine on the corresponding failed server; it controls the container on the failed server not to discard / rebuild the application copy, and determines the recovery priority of each failed virtual machine based on the application copy data on different failed virtual machines; based on the recovery priority of each failed virtual machine, it performs fault migration of the corresponding failed virtual machines in turn, so as to ensure that all application copies in the failed server can be restarted to complete fault recovery.
[0047] In a specific embodiment, the cloud platform formed by the server side 200 will include a virtual machine management system (such as OpenStack) and a container management system (such as Kubernetes). The virtual machine management system and the container management system include their own fault recovery processes. The virtual machine management system performs fault migration on the affected virtual machines on the faulty server, and the container management system allows cloud-native applications to directly abandon the affected application copies and then recreate them on other nodes (non-cloud-native applications can generally only wait for the affected copies to recover).
[0048] Specifically, after monitoring the faulty server, the controller 100 obtains a list of faulty virtual machines on the faulty server through the virtual machine management system, and then obtains a list of application copies on the faulty virtual machine through the container management system. Subsequently, the controller 100 transmits the list of application copies on the faulty virtual machine to the container management system, and notifies the container management system not to discard / rebuild these application copies during the recovery process. At the same time, based on the application copy list on the faulty virtual machine, the migration priority of the faulty virtual machine is calculated according to the application copy information of the faulty virtual machine / faulty virtual machine, and then the faulty virtual machines are sorted according to the priority. Fault migration tasks of the virtual machines are created in sequence according to the obtained order of the faulty virtual machines, and after the fault migration of a faulty virtual machine, the faulty virtual machine is restarted until the fault migration of all faulty virtual machines is completed, the restart of all faulty virtual machines is completed, and the restart of all application copies carried by the virtual machine is completed. At this point, the fault recovery is successful.
[0049] The controller 100 may be any electronic device capable of realizing control functions, such as a smart phone, a tablet, a laptop, a computer, or a control unit attached to the server 200, which is not limited herein. The server 200 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, which is not limited herein.
[0050] First see Figure 1 , Figure 11 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a controller 100 and a server 200, and the controller 100 and the server 200 communicate with each other via a wired or wireless network.
[0051] Figure 2 is a schematic diagram of another implementation environment involved in this application, namely Figure 1 The controller 100 includes a fault recovery collaboration module 101 and a virtual machine recovery job sorting module 102. The fault recovery collaboration module 101 and the virtual machine recovery job sorting module 102 work together to perform fault recovery for a faulty server in the cloud platform, wherein the fault recovery collaboration module 101 and the virtual machine recovery job sorting module 102 can be connected by wired or wireless communication.
[0052] Similarly, the cloud platform formed by the server side 200 may include a virtual machine management system and a container management system.
[0053] In a specific embodiment, Figure 2 The fault recovery process of the embodiment shown in FIG. Figure 3 After monitoring the faulty server, the fault recovery collaboration module 101 obtains the list of faulty virtual machines on the faulty server through the virtual machine management system, and then obtains the list of application copies on the faulty virtual machine through the container management system. Subsequently, the fault recovery collaboration module 101 transmits the list of application copies on the faulty virtual machine to the container management system, and notifies the container management system not to discard / rebuild these application copies during the recovery process. At the same time, the fault recovery collaboration module 101 sends the application copy information of the faulty virtual machine / faulty virtual machine to the virtual machine recovery job sorting module 102, so that the virtual machine recovery job sorting module 102 calculates the migration priority of the faulty virtual machine according to the application copy information of the faulty virtual machine / faulty virtual machine, and then sorts the faulty virtual machines according to the priority. The virtual machine recovery job sorting module 102 returns the sorting result to the fault recovery collaboration module 101, so that the fault recovery collaboration module 101 creates the fault migration tasks of the virtual machines in sequence according to the obtained order of the faulty virtual machines, and restarts the faulty virtual machine after the fault migration of a faulty virtual machine, until the fault migration of all faulty virtual machines is completed, and all faulty virtual machines are restarted, and all application copies carried by the virtual machine are restarted. At this point, the fault recovery is successful.
[0054] Figure 4 is a flow chart showing a method for recovering a server failure in a cloud platform according to an exemplary embodiment. The method for recovering a server failure in a cloud platform can be applied to Figure 1 or Figure 2 The implementation environment shown in FIG. 1 is specifically executed by the controller 100 in the implementation environment, or by Figure 2It should be understood that the method can also be used in other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0055] like Figure 4 As shown, in an exemplary embodiment, the method may include steps S410 to S450, which are described in detail as follows:
[0056] Step S410: Obtain a failed server in the cloud platform and a failed virtual machine on the corresponding failed server.
[0057] The cloud platform in this embodiment has a three-layer structure of physical server-virtual machine-container. Multiple physical servers can form a server cluster. Virtual machines run on the server cluster, and the virtual machines carry both cloud-native applications and non-cloud-native applications.
[0058] When a server fails, the virtual machine on the failed server will be affected and unable to operate normally, that is, it will become a failed virtual machine, and the application copies on the failed virtual machine will also be affected and unable to operate normally to provide services.
[0059] A monitoring system may be provided in the controller or the fault recovery collaboration module, and the monitoring system is used to detect whether a server failure occurs in the cloud platform. Of course, a monitoring system may also be provided in the cloud platform. When the monitoring system of the cloud platform detects a server failure, a prompt is sent to the controller or the fault recovery collaboration module to prompt the controller or the fault recovery collaboration module to perform server failure recovery operations in the cloud platform.
[0060] When a server failure is detected in the cloud platform, the faulty server and the faulty virtual machines on the faulty server are determined through the virtual machine management system. When a server failure occurs in the cloud platform, one or more servers may fail. At this time, the faulty server is located. There may be one or more virtual machines on a faulty server, so all virtual machines on the faulty server are located as faulty virtual machines.
[0061] Step S430: determining the recovery priority of each faulty virtual machine according to the application replica data on different faulty virtual machines.
[0062] After the faulty virtual machines are identified, each faulty virtual machine carries cloud-native applications and non-cloud-native applications. At this time, the recovery priority of each faulty virtual machine can be determined based on the application replica data in each faulty virtual machine.
[0063] Specifically, the application replica data includes the number of cloud-native applications and non-cloud-native applications in each virtual machine, and determines the respective weights of cloud-native applications and non-cloud-native applications, so as to calculate the recovery priority of each failed virtual machine.
[0064] The weights of cloud-native applications and non-cloud-native applications can be determined through empirical parameters, and the more copies of non-cloud-native applications carried by the faulty virtual machine, the higher the recovery priority. The more copies of non-cloud-native applications carried by the faulty virtual machine, the higher the recovery priority.
[0065] Of course, due to the lack of coordination mechanism between the fault recovery processes of the current virtual machines and containers in the container management system after the server fails, the two sets of processes are generally triggered separately, that is, the cloud native application directly abandons the affected application copy and then recreates it on other nodes, while the virtual machine management system performs fault migration on the faulty virtual machine. At this time, the container recovery process will be carried out simultaneously with the virtual machine fault migration process, so that a considerable part of the operations will become invalid operations. For example, after the virtual machine is recovered, the application copies carried can be restored to operation, but the container management system will discard these copies and recreate them. In this way, a situation where one is recovered and the other is discarded will occur, which brings many complexities and difficulties to the management of the cloud platform, and will lead to resource waste and inefficiency in the entire recovery process.
[0066] Therefore, in this embodiment, after determining the faulty virtual machine and before performing the faulty virtual machine's faulty migration, an instruction is sent to prevent the container management system from triggering the application replica reconstruction action, that is, to control the container management system in the cloud level not to perform the fault recovery action.
[0067] Step S450: performing failover of corresponding failed virtual machines in sequence based on the recovery priority of each failed virtual machine.
[0068] After obtaining the recovery priority of each faulty virtual machine, all faulty virtual machines are sorted in order of recovery priority, and fault migration tasks of the virtual machines are created in sequence according to the sorting results. When the fault migration task of a faulty virtual machine is completed, the faulty virtual machine is restarted to make the faulty virtual machine operate normally and ensure the normal operation of the application on the faulty virtual machine.
[0069] In this way, the faulty virtual machines are migrated in sequence according to the sorting results until the faulty migration of all faulty virtual machines is completed, all faulty virtual machines are restarted, and all application copies hosted by the virtual machines are restarted. At this point, the fault recovery is successful.
[0070] In this embodiment, the fault migration of the faulty virtual machine can be achieved in a variety of ways, such as determining the address of a backup server or a server that has not failed, and migrating the faulty virtual machine to the backup server or the server that has not failed; or enabling resources such as cloud servers and cloud hard disks in the available zone on the faulty server to ensure the normal operation of the business in the faulty virtual machine.
[0071] The server fault recovery method proposed in this embodiment is based on the characteristics of the specific scenario of a hybrid cloud platform that carries both cloud-native applications and non-cloud-native applications, and proposes targeted recovery priorities, so that faulty virtual machines with high recovery priorities are optimized first, and faulty virtual machines with a large number of application copies and a large number of non-cloud-native applications are optimized first, thereby reducing the impact of virtual machine failures on applications on the virtual machines and improving fault recovery efficiency.
[0072] Figure 5 yes Figure 4 The flowchart of step S430 in the embodiment shown is in an exemplary embodiment. Figure 5 As shown, in an exemplary embodiment, the process of determining the recovery priority of each faulty virtual machine according to the application replica data on different faulty virtual machines may include steps S510 to S530, which are described in detail as follows:
[0073] Step S510: extracting the number of cloud-native application replicas and the number of non-cloud-native application replicas on different faulty virtual machines.
[0074] When a virtual machine carries both cloud-native applications and non-cloud-native applications, there is generally a significant difference in the urgency of recovery for these two types of applications. Cloud-native applications generally achieve high availability, while non-cloud-native applications do not guarantee this (and even have a single point of effectiveness risk). The impact of non-cloud-native applications stopping operation is often more obvious, and the urgency of restoring operation is often higher, so they should be restored first. Therefore, the application replica data in different virtual machines is different, and the recovery priority of the virtual machine should also be different, but the existing server failure recovery method cannot achieve this priority.
[0075] Therefore, in this embodiment, the number of cloud-native application replicas and the number of non-cloud-native application replicas on different faulty virtual machines are extracted to determine the recovery priority of different faulty virtual machines.
[0076] The number of cloud-native application replicas and the number of non-cloud-native application replicas can be extracted through the container management system on the cloud platform.
[0077] Step S530: Calculate the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application replicas and the number of non-cloud-native application replicas of each faulty virtual machine.
[0078] In this embodiment, the more non-cloud native application copies there are, the higher the recovery priority; the more non-cloud native application copies carried by the faulty virtual machine, the higher the recovery priority is used as the criterion. The recovery priority of the corresponding faulty virtual machine is calculated based on the number of cloud native application copies and the number of non-cloud native application copies in each faulty virtual machine.
[0079] In this embodiment, based on the running characteristics of cloud-native applications and non-cloud-native applications in virtual machines, the recovery priority of different virtual machines is determined by counting the number of cloud-native application copies and the number of non-cloud-native application copies of each faulty virtual machine, so that virtual machines with high priorities are restored first, thereby improving the efficiency of fault recovery.
[0080] Figure 6 yes Figure 5 The flowchart of step S530 in the embodiment shown is in an exemplary embodiment. Figure 5 As shown, in an exemplary embodiment, the process of calculating the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application copies and the number of non-cloud-native application copies of each faulty virtual machine may include steps S610 to S630, which are described in detail as follows:
[0081] Step S610: assign corresponding weights to the cloud-native application replicas and the non-cloud-native application replicas respectively.
[0082] In this embodiment, based on the characteristics of cloud-native application copies and non-cloud-native application copies, respective weights are assigned to cloud-native application copies and non-cloud-native application copies. The weight assignment can be obtained based on the principle that the more non-cloud-native application copies there are, the higher the recovery priority; and the more non-cloud-native application copies carried by the faulty virtual machine, the higher the recovery priority. The specific value of the weight can be obtained through empirical parameters.
[0083] Step S630: Calculate the recovery priority of each faulty virtual machine according to the number of cloud-native application replicas, the number of non-cloud-native application replicas, and the weights of cloud-native application replicas and non-cloud-native applications.
[0084] In this embodiment, the recovery priority of the faulty virtual machine can be calculated by the following formula:
[0085] p vm1 =c t∈vm1 ·w t +c cn∈vm1 ·w cn
[0086] Among them, p vm1 is the recovery priority of the failed virtual machine vm1, c t∈vm1 is the number of non-cloud native application replicas hosted by vm1, wt is the weight of the non-cloud native application replica, c cn∈vm1 is the number of cloud native application replicas hosted by vm1, w cn The weight of the cloud native application replica.
[0087] In one embodiment, wherein w t and w cn It is an empirical value, which can be set as: w t =10 and w cn =1.
[0088] In this embodiment, the recovery priority calculation process of the failed virtual machine can be performed at Figure 1 , or in the controller Figure 2 This is done in the VM recovery job sequencing module in .
[0089] In this embodiment, corresponding weights are assigned to cloud-native application replicas and non-cloud-native application replicas, so that the recovery priority of the corresponding virtual machine can be calculated based on the number of cloud-native application replicas and non-cloud-native application replicas. This provides reference data for the recovery order of faulty virtual machines and improves the efficiency of faulty virtual machine recovery.
[0090] Figure 7 FIG. 1 is a schematic diagram showing a structure of a server failure recovery device in a cloud platform according to an exemplary embodiment. Figure 7 As shown, in an exemplary embodiment, the device includes:
[0091] A fault information acquisition module 710 is configured to acquire a faulty server that has failed in the cloud platform and a faulty virtual machine on the corresponding faulty server;
[0092] A recovery priority acquisition module 730 is configured to determine the recovery priority of each faulty virtual machine according to the application replica data on different faulty virtual machines;
[0093] The fault migration module 750 is configured to sequentially perform fault migration of the corresponding faulty virtual machines based on the recovery priority of each faulty virtual machine.
[0094] The server failure recovery device in the cloud platform proposed in this embodiment can efficiently complete the failure migration of the failed virtual machine when a server failure occurs in the cloud platform.
[0095] In one embodiment, the server failure recovery device in the cloud platform further includes:
[0096] The instruction sending module is configured to send a control instruction so that the application copy on the faulty virtual machine does not operate during the recovery of the faulty virtual machine.
[0097] In one embodiment, the recovery priority acquisition module includes:
[0098] an application replica quantity acquisition unit, configured to extract the number of cloud-native application replicas and the number of non-cloud-native application replicas on different faulty virtual machines;
[0099] The recovery priority acquisition unit is configured to calculate the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application copies and the number of non-cloud-native application copies of each faulty virtual machine.
[0100] In one embodiment, the restoration priority acquisition unit includes:
[0101] The weight allocation section is configured to assign corresponding weights to cloud-native application replicas and non-cloud-native application replicas respectively;
[0102] The recovery priority acquisition section is configured to calculate the recovery priority of each faulty virtual machine based on the number of cloud-native application replicas, the number of non-cloud-native application replicas, and the weights of cloud-native application replicas and non-cloud-native applications.
[0103] In one embodiment, the recovery priority acquisition unit acquires the recovery priority of the failed virtual machine in the following manner:
[0104] p vm1 =c t∈vm1 ·w t +c cn∈vm1 ·w cn
[0105] Among them, p vm1 is the recovery priority of the failed virtual machine vm1, c t∈vm1 is the number of non-cloud native application replicas hosted by vm1, w t is the weight of the non-cloud native application replica, c cn∈vm1 is the number of cloud native application replicas hosted by vm1, w cn The weight of the cloud native application replica.
[0106] In one embodiment, the failover module includes:
[0107] a target address acquisition unit configured to determine a target address of a backup server in the cloud platform;
[0108] The first migration unit is configured to sequentially create fault migration tasks for different faulty virtual machines based on the recovery priority of each faulty virtual machine, so that the corresponding faulty virtual machine is migrated to the standby server based on the target address.
[0109] In one embodiment, the failover module includes:
[0110] A recovery list acquisition unit is configured to sort the faulty virtual machines based on the recovery priority order of each faulty virtual machine to obtain a recovery list;
[0111] The second migration unit is configured to create a fault migration task corresponding to the faulty virtual machine based on the recovery list, so that each faulty virtual machine completes the fault migration in sequence.
[0112] It should be noted that the server fault recovery device in the cloud platform provided in the above embodiment and the server fault recovery method in the cloud platform provided in the above embodiment belong to the same concept, and the specific way in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0113] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the server failure recovery method in the cloud platform provided in the above-mentioned embodiments.
[0114] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0115] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0117] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0118] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0119] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0120] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0121] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0122] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the server failure recovery method in the cloud platform as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0123] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the server failure recovery method in the cloud platform provided in each of the above embodiments.
[0124] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A server failure recovery method in a cloud platform, characterized in that: include: Obtaining a failed server and a failed virtual machine on the corresponding failed server in the cloud platform; Sending a control instruction so that the application copy on the failed virtual machine does not operate during the recovery of the failed virtual machine; Extract the number of cloud-native application copies and the number of non-cloud-native application copies on different faulty virtual machines; calculate the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application copies and the number of non-cloud-native application copies of each faulty virtual machine; The fault migration of the corresponding faulty virtual machines is performed in sequence based on the recovery priority of each faulty virtual machine.
2. The method according to claim 1, characterized in that The calculating the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application replicas and the number of non-cloud-native application replicas of each faulty virtual machine includes: Assign corresponding weights to the cloud-native application replica and the non-cloud-native application replica respectively; The recovery priority of each faulty virtual machine is calculated according to the number of the cloud-native application replicas, the number of the non-cloud-native application replicas, and the weights of the cloud-native application replicas and the non-cloud-native application.
3. The method according to claim 1, characterized in that The calculating the recovery priority of the corresponding faulty virtual machine based on the number of cloud-native application replicas and the number of non-cloud-native application replicas of each faulty virtual machine includes: p vm =c t∈vm1 ·w t +c cn∈vm ·w cn Among them, p vm1 is the recovery priority of the failed virtual machine vm1, c t∈vm1 is the number of non-cloud native application replicas hosted by vm1, w t is the weight of the non-cloud native application replica, c cn∈vm is the number of cloud native application replicas hosted by vm1, w cn The weight of the cloud native application replica.
4. The method according to claim 1, characterized in that: The step of sequentially performing the fault migration of the corresponding faulty virtual machines based on the recovery priority of each faulty virtual machine includes: Determining a target address of a backup server in the cloud platform; Based on the recovery priority of each faulty virtual machine, fault migration tasks of different faulty virtual machines are sequentially created, so that the corresponding faulty virtual machine is migrated to the standby server based on the target address.
5. The method according to claim 1, characterized in that The step of sequentially performing the fault migration of the corresponding faulty virtual machines based on the recovery priority of each faulty virtual machine includes: Sort the faulty virtual machines based on the recovery priority order of each faulty virtual machine to obtain a recovery list; A fault migration task corresponding to the faulty virtual machine is created based on the recovery list, so that each faulty virtual machine completes the fault migration in sequence.
6. A server failure recovery terminal in a cloud platform, characterized in that: include: A fault information acquisition module is configured to acquire a faulty server and a faulty virtual machine on the corresponding faulty server in the cloud platform; An instruction sending module, configured to send a control instruction so that the application copy on the failed virtual machine does not operate during the recovery of the failed virtual machine; A recovery priority acquisition module is configured to extract the number of cloud native application copies and the number of non-cloud native application copies on different faulty virtual machines; and calculate the recovery priority of the corresponding faulty virtual machine based on the number of cloud native application copies and the number of non-cloud native application copies of each faulty virtual machine; The fault migration module is configured to sequentially perform fault migration of the corresponding faulty virtual machines based on the recovery priority of each faulty virtual machine.
7. An electronic device, characterized in that: include: one or more processors; A storage device, used to store one or more computer programs, when the one or more computer programs are executed by the one or more processors, enables the electronic device to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 5.
