Exception handling method and device, electronic equipment, storage medium and program product

By detecting and processing the container response status of computing nodes whose load is higher than the threshold in the K8s cluster, the problem of abnormal response caused by containers preempting each other's resources is solved and the stable operation of the computing node's business is ensured.

CN118656263APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410300497.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In a K8s cluster, multiple containers on the same computing node seize each other's physical resources, resulting in abnormal response, which is difficult to effectively solve with existing technology.

Method used

By obtaining the load status information of each computing node in the control node of the server cluster, determine the target node whose load is higher than the preset threshold, and detect the response status of its container. If the target application is in an abnormal response state, implement exception handling , such as evicting, banning or increasing the number of containers to ensure normal business operation.

Benefits of technology

It effectively avoids response abnormalities caused by different containers in computing nodes competing for resources, ensuring the normal operation of services in nodes with higher loads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656263A
    Figure CN118656263A
Patent Text Reader

Abstract

The invention provides an exception handling method and device, electronic equipment, a storage medium and a program product. The exception handling method comprises the following steps: acquiring load state information of each computing node in a server cluster; a target node is determined in the at least two computing nodes based on the load state information, the load of the target node is higher than a preset threshold value, the target node comprises at least one container, and one application is deployed in one container; detecting a response state of a container in the target node to obtain detection information; under the condition that the detection information represents that the target application is in the abnormal response state, performing abnormal processing on a container corresponding to the target application; wherein the processing mode of the exception processing comprises at least one of the following modes: a first processing mode: expelling an exception container corresponding to the target application. The technical scheme provided by the invention is beneficial to ensuring that various services deployed in the computing node can run normally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an exception handling method, device, electronic device, storage medium and program product. Background Art

[0002] In related technologies, a core task of K8s is to schedule containers to nodes in the k8s cluster for computing according to the "scheduling algorithm". The current default "scheduling algorithm" is mainly used to calculate whether this node meets the scheduling requirements based on the CPU and memory resources that can be allocated by the current physical machine.

[0003] In the container's YAML deployment orchestration file, there are resource controls for CPU and memory, mainly requests and limits, where requests are used to determine whether the target scheduling node meets the scheduling requirements. For example, if the node has 10 CPU cores (10C for short) and 50GB of memory left, the node can be scheduled normally if the request values ​​of CPU and memory are set to 5 cores and 10GB respectively in the container's YAML file.

[0004] Limits is the maximum value for the request value. For example, if the CPU value of the container's request is set to 5c and limits is set to 15c, then the container can use a maximum of 15c of CPU resources. Similarly, the container's memory value can also be set in this way.

[0005] However, when there are multiple containers on the same node server, even if the physical resources of the node server are determined to meet the physical resource requirements of each container based on the above requests and limits, when multiple containers require a large amount of physical resources at the same time, it is easy to cause different containers on the same node server to compete for physical resources, which may lead to abnormal container response. Summary of the invention

[0006] The present application provides an exception handling method, device, electronic device, storage medium and program product, which are helpful to ensure that various services deployed in the computing node can operate normally.

[0007] In a first aspect, an embodiment of the present application provides an exception handling method, which is applied to a control node in a server cluster, wherein the server cluster includes the control node and at least two computing nodes, and the method includes:

[0008] Obtain the load status information of each computing node in the server cluster;

[0009] Determine a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container;

[0010] Detecting a response status of a container in the target node to obtain detection information;

[0011] When the detection information indicates that the target application is in an abnormal response state, performing abnormal processing on a container corresponding to the target application;

[0012] The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application;

[0013] Second processing method: prohibiting the flow of the abnormal container corresponding to the target application;

[0014] A third processing method: increasing the number of containers corresponding to the target application.

[0015] In a second aspect, an embodiment of the present application provides an exception handling device, which is applied to a control node in a server cluster, wherein the server cluster includes the control node and at least two computing nodes, and the exception handling device includes:

[0016] An acquisition module is used to obtain the load status information of each computing node in the server cluster;

[0017] A determination module, configured to determine a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container;

[0018] A detection module, used to detect the response status of the container in the target node to obtain detection information;

[0019] A processing module, configured to perform exception processing on a container corresponding to the target application when the detection information indicates that the target application is in an abnormal response state;

[0020] The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application;

[0021] Second processing method: prohibiting the flow of the abnormal container corresponding to the target application;

[0022] A third processing method: increasing the number of containers corresponding to the target application.

[0023] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method steps of the first aspect described above are implemented.

[0024] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method steps of the first aspect described above are implemented.

[0025] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0026] In an embodiment of the present application, the response status of the container in the target node with a higher load in the server cluster is detected to determine the response status of the application corresponding to the container. In this way, when different containers in the same computing node occupy physical resources from each other, causing the target application in the computing node to be in an abnormal response state, the abnormal container corresponding to the target application can be determined through the response status of the application corresponding to the determined container, and the exception can be handled by expelling the abnormal container, prohibiting the flow of the abnormal container, and increasing the number of containers corresponding to the target application, thereby ensuring that various services deployed in the computing node can operate normally. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 This is one of the flowcharts of the exception handling method provided in the embodiment of the present application;

[0029] Figure 2 It is a structural diagram of an exception handling system provided in an embodiment of the present application;

[0030] Figure 3 This is the second flowchart of the exception handling method provided in the embodiment of the present application;

[0031] Figure 4 It is one of the structural schematic diagrams of the exception handling device provided in the embodiment of the present application.

[0032] Figure 5 This is the second structural diagram of the exception handling device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] In the related art, in order to solve the problem of different pods competing for physical resources in the same computing node, the following solution is proposed: define a priority for each pod, and when resource preemption occurs, the pod with a low priority will be evicted. However, the normal situation is that several pods with high priorities compete for physical resources in the same computing node, and the problem of physical resource preemption cannot be completely solved by the eviction solution of low priority.

[0035] Based on this, in an embodiment of the present application, by screening out target nodes with higher loads from the computing nodes of the server cluster, since the target nodes have higher loads, resource preemption is more likely to occur in the target nodes. Then, the response status of the container in the target node is detected to determine whether the application corresponding to the container is in an abnormal response state. And when the application is in an abnormal response state, the container of the application is handled abnormally, so that it can be ensured that various services in the computing nodes with higher loads can operate normally, avoiding the problem of abnormal response of the container in the computing node due to different containers in the same computing node competing for physical resources.

[0036] See also Figure 1 , Figure 1 1 is a flow chart of an exception handling method provided in an embodiment of the present application. The exception handling method is applied to a control node in a server cluster. The server cluster includes the control node and at least two computing nodes. The method includes the following steps:

[0037] Step 101: Obtain load status information of each computing node in the server cluster;

[0038] Step 102: determining a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container;

[0039] Step 103: Detect the response status of the container in the target node to obtain detection information;

[0040] Step 104: When the detection information indicates that the target application is in an abnormal response state, perform abnormal processing on the container corresponding to the target application;

[0041] The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application;

[0042] Second processing method: prohibiting the flow of the abnormal container corresponding to the target application;

[0043] A third processing method: increasing the number of containers corresponding to the target application.

[0044] It can be understood that the above-mentioned determination of the target node among the at least two computing nodes based on the load status information specifically refers to: among the at least two computing nodes, all computing nodes whose loads are higher than a preset threshold are screened out, and the screened out nodes are determined as target nodes. The number of target nodes determined in this step can be at least one.

[0045] The above-mentioned preset threshold may be a threshold determined based on experience, or the preset threshold may also be a threshold determined based on the computing power of each computing node in the server cluster. Among them, when the load of the computing node is higher than the preset threshold, the container in the computing node is prone to abnormal response. In some embodiments of the present application, the threshold can also be determined based on the real-time load status of the at least two computing nodes. For example, after determining the real-time load of the at least two computing nodes, the value of the above-mentioned preset threshold can be determined, and the value of the preset threshold must meet the following conditions: Among the at least two computing nodes, the number of computing nodes with a load higher than the preset threshold accounts for K% of the at least two computing nodes, and the value range of K is between 5-15. When the value of K is 10, the top 10% of computing nodes with higher loads can be screened out from the at least two computing nodes based on the above-mentioned load status information.

[0046] It can be understood that the load of the screened target node is higher than the load of other nodes in the at least two computing nodes.

[0047] The above-mentioned server cluster can be various server clusters, for example, it can be a K8s cluster. K8s (Kubernetes) is a container (pod) cluster management system, an open source platform that can realize the functions of automated deployment, automatic expansion and contraction, maintenance, etc. of container clusters. Pod: is the smallest / simplest basic unit created or deployed by Kubernetes. A Pod represents a process running on the cluster, and each process contains IP address information. The above-mentioned control node can be the master node (master) in the K8s cluster, where master: is the k8s cluster control node, and each cluster requires at least one master node to be responsible for the management and control of the cluster. The above-mentioned computing node can be a node in the k8s cluster, and the node is the workload node of the k8s cluster. The master allocates containers to these node working nodes, and then the docker on the node node is responsible for the operation of the container.

[0048] The load status information may be any information that can characterize the load status of the computing node, for example, it may include the CPU load, memory usage, and disk idle IO ratio of the computing node.

[0049] The target nodes determined among the at least two computing nodes based on the load status information may be the first several nodes with the highest load among the at least two computing nodes, or the at least one target node may also be the first preset proportion of nodes with the highest load among the at least two computing nodes.

[0050] The response status may be a response status of the container to the received request. Specifically, the response status of the container may be determined by sending a request to the container. Alternatively, the response status of each container may be obtained by collecting statistics on the response status of each container to the request in the past period of time.

[0051] The detection information may include the response status type of each detected container to the received request, wherein the response status type may include normal response, abnormal response, etc. Specifically, it may be determined whether the container is in an abnormal response state according to the response status code and response duration of the container to the request.

[0052] Since the same application may have corresponding containers deployed on multiple different computing nodes, when determining whether an application is in the above-mentioned abnormal response state, the response state type of the container of the application deployed on each target node to the request can be obtained to determine whether the application is in the abnormal response state. For example, when all containers corresponding to an application are in a normal response state, it can be determined that the application is in a normal response state. Correspondingly, when at least one container of the application is in an abnormal response state, it can be determined that the application is in an abnormal response state.

[0053] The above-mentioned expulsion of the abnormal container corresponding to the target application specifically refers to: closing the abnormal container in the computing node where the abnormal container is located. The above-mentioned flow banning of the abnormal container corresponding to the target application specifically refers to: no longer allocating new processing tasks to the abnormal container. The above-mentioned increase in the number of containers corresponding to the target application specifically refers to: expanding the capacity of the target application, that is, pulling up a new container in the computing node of the server cluster for the target application.

[0054] In this implementation, the response status of the container in the target node with a higher load in the server cluster is detected to determine the response status of the application corresponding to the container. In this way, when the target application in the same computing node is in an abnormal response state due to different containers in the same computing node competing for physical resources with each other, the abnormal container corresponding to the target application can be determined through the response status of the application corresponding to the determined container, and the abnormal container can be expelled, the abnormal container is prohibited from flowing, and the number of containers corresponding to the target application is increased. The number of containers, etc., can be used to handle the abnormality, thereby ensuring that various services deployed in the computing node can operate normally.

[0055] Optionally, the control node stores Uniform Resource Locator (URL) information, the URL information including a URL address corresponding to a container in each computing node, and the detecting the response status of the container in the target node to obtain the detection information includes:

[0056] Obtain the URL address corresponding to the container in the target node;

[0057] A detection request is sent to a URL address corresponding to the container in the target node to obtain the detection information, where the detection information includes response information of the container in the target node to the detection request.

[0058] Specifically, the URL address corresponding to the container in each target node may be obtained; a detection request may be sent to the URL address corresponding to the container in each target node to obtain response information.

[0059] The detection request may be an access request from the target node to the URL address corresponding to the container.

[0060] The above response information may include response information of each container in the target node to the received detection request, and the response information may indicate whether the corresponding container is in an abnormal state, the abnormal type, etc.

[0061] In this implementation, when detecting the response status of the container, a detection request is sent to the URL address corresponding to the container. In this way, the real-time response status corresponding to the container can be obtained, and based on the real-time response status of the container, it is determined whether the corresponding application is in an abnormal response state, which is conducive to accurately determining the real-time status of the application.

[0062] Optionally, in the server cluster, there is at least one container in which a target application is deployed; and the method further includes:

[0063] In the first case, the second case, or the third case, determining that the target application is in the abnormal response state;

[0064] The first situation is that there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than or equal to a first threshold; the second situation is that there are abnormal containers of the second type in the containers corresponding to the target application; the third situation is that there are abnormal containers of the third type in the containers corresponding to the target application;

[0065] The response information of the first type of abnormal container to the detection request includes: response information in which the response duration is between the first threshold and the second threshold, and the hypertext transfer protocol status code (httpCode) is a target status code, wherein the target status code indicates that the container successfully responds to the received detection request;

[0066] The response information of the second type of abnormal container to the detection request includes: response information in which the hypertext transfer protocol status code is not the target status code;

[0067] The response information of the third type of abnormal container to the detection request includes: response information that the response time is greater than the second threshold and the container state is not ready.

[0068] The target status code may be any status code that can indicate that the container has successfully responded to the request. For example, the value of the target status code may be 200.

[0069] The above-mentioned first threshold may be a threshold determined based on experience. For example, the first threshold may be any value between 5% and 15%. In some embodiments of the present application, the first threshold is 10%. In addition, in the process of detecting the response status of the container, it can be determined whether the container in the node is in a ready state according to nodeStatus. Among them, nodeStatus refers to the node computing node managed by k8s. The common states of containers in the node computing node are Ready and NotReady. The Ready means: the container in the node is running normally and is ready to accept the workload. This is the normal working state of the container in the node. The NotReady: The container in the node cannot accept the workload, which may be due to network problems, insufficient resources or other failures.

[0070] It can be understood that both the first type of abnormal container and the second type of abnormal container are containers in the Ready state.

[0071] The first type of abnormal container may specifically refer to: the container can successfully respond to the received detection request, but the response time exceeds the normal time.

[0072] When the HTTP status code is not the target status code, it indicates that the corresponding container fails to respond to the received detection request. That is, the above second type of abnormal container may specifically refer to: the container fails to respond to the received detection request.

[0073] The response information that the response duration is greater than the second threshold and the container state is not ready may specifically mean that the container state is not ready and cannot respond to the received detection request.

[0074] In this implementation, various abnormal containers are classified based on the response time of the container to the detection request, the http status code and whether the container is ready, and at the same time, the identification conditions of various types of abnormal containers are determined. In this way, a determination process of whether each application is in an abnormal response state based on the detection information can be implemented.

[0075] Optionally, in the first case, the exception handling includes the second handling method or the third handling method;

[0076] In the second case, the exception handling includes the second handling method and the third handling method;

[0077] In the third case, the exception handling includes the first handling method.

[0078] Specifically, when the detection information indicates that the target application is in an abnormal response state, performing abnormal processing on a container corresponding to the target application includes:

[0079] If there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than or equal to a first threshold, prohibit the flow of the abnormal containers corresponding to the target application, or increase the number of containers corresponding to the target application;

[0080] If there is an abnormal container of the second type in the containers corresponding to the target application, prohibit the flow of the abnormal container corresponding to the target application and increase the number of containers corresponding to the target application;

[0081] When there is an abnormal container of the third type in the container corresponding to the target application, the abnormal container corresponding to the target application is evicted.

[0082] In this implementation, different exception handling means are sampled to process the application container according to different exception response states of the application, which is beneficial to improving the exception handling effect of the application.

[0083] Optionally, in the first case,

[0084] If the proportion of abnormal containers of the first type is between the first threshold and the second threshold, the abnormal processing includes the second processing method;

[0085] If the proportion of abnormal containers of the first type is greater than the second threshold, the abnormal processing includes the third processing method.

[0086] Specifically, when there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than or equal to a first threshold, prohibiting the flow of the abnormal containers corresponding to the target application, or increasing the number of containers corresponding to the target application, includes:

[0087] If there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is between the first threshold and the second threshold, prohibiting traffic to the abnormal containers corresponding to the target application, wherein the first threshold is less than the second threshold;

[0088] When there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than the second threshold, the number of containers corresponding to the target application is increased.

[0089] The second threshold may be determined based on actual experience. For example, the value range of the second threshold may be between 25% and 35%. In some embodiments of the present application, the first threshold is 10% and the second threshold is 30%.

[0090] In this implementation, when there are abnormal containers of the first type in the container corresponding to the target application, the container of the application is processed based on different exception processing means according to different proportions of abnormal containers, which is conducive to improving the exception processing effect of the application.

[0091] Optionally, determining a target node among the at least two computing nodes based on the load status information includes:

[0092] Scoring each of the computing nodes based on the load status information to obtain a scoring value corresponding to each of the computing nodes, wherein the scoring value is positively correlated with the load in the corresponding computing node;

[0093] According to the score value, a target node is determined among the at least two computing nodes.

[0094] The load status information includes at least one of the following: CPU load, memory usage, and disk IO information. Determining the target node from the at least two computing nodes based on the score value may include: determining the top K% computing nodes with high score values ​​from the at least two computing nodes as the target node, where the value range of K is between 5 and 15.

[0095] The CPU load may include the proportion of remaining CPU in the computing node, the memory usage may include the proportion of remaining memory in the computing node, and the disk IO information may include the number or proportion of IOs of the computing node disk in an idle state.

[0096] When determining the score value, the load status of each computing node can be compared by a single indicator to determine the score value of each computing node. For example, when the at least two computing nodes include three computing nodes A, B, and C, if the proportion of the remaining CPU of computing node A is 30%, the proportion of the remaining CPU of computing node B is 20%, and the proportion of the remaining CPU of computing node C is 50%, then the loads of the three nodes A, B, and C are from high to low: computing node B, computing node A, and computing node C. At this time, the score value for computing node A can be set to 0.7, the score value for computing node B can be set to 0.8, and the score value for computing node B can be set to 0.5. If the above K is 10, the determined target node is node A.

[0097] In addition, when determining the score value, the load status of each computing node can also be compared through a composite indicator to determine the score value of each computing node. Specifically, the initial score value of each node can be determined based on a single indicator, and then the weighted sum of each single indicator corresponding to each node is performed to obtain the score value of the composite indicator of the node, and the score value of the composite indicator is determined as the score value of the node.

[0098] In this implementation, each computing node is scored based on the load status information, and a target node is determined from the at least two computing nodes according to the score value. In this way, it is possible to filter out a target node with a higher load from the computing nodes.

[0099] See also Figure 2 This is a schematic diagram of the structure of an exception handling system provided in some embodiments of the present application, and the exception handling system can be deployed on the above-mentioned target node. Figure 3 Based on Figure 2 The flowchart of the exception handling method of the exception handling system shown in FIG. Figure 2-3 , the exception handling method provided in the embodiment of the present application is further explained:

[0100] First, for Figure 2 The functions of each module are introduced in:

[0101] 1. The "monitoring module" obtains monitoring data from the monitoring system. The monitoring data may include physical server node IP, CPU load, memory usage, disk IO information and other data.

[0102] 2. The user configures the URL address for monitoring the business corresponding to each application in the server cluster through "Configure System" to detect whether there is any abnormality in the application.

[0103] 3. The "processing module" obtains the IP information of the top 10% of the computing nodes with the highest load from the "monitoring module", and calls the k8s api to obtain the relevant information of the pod through the IP information. After obtaining the relevant information of the pod, it starts to obtain the URL of each pod pair from the "configuration system". After assembling into a URL, the "processing module" starts to access this URL to determine whether the service is affected by the preemption of physical resources. If affected, the statistical information is merged once every 1 minute and passed to the "execution module". The relevant information of the pod may include the status of the node, the corresponding application name, the name of the pod, the IP address of the pod, the port of the pod, and the total number of deployed instances of the pod.

[0104] 4. The "execution module" starts sending instructions to the k8s api to perform related actions according to the defined rules, such as pod expulsion, traffic ban, capacity expansion and other operations.

[0105] like Figure 3 As shown in the figure, the "monitoring module" provides two interfaces. The "push interface" means actively receiving data pushed by the "monitoring system", and the "pull interface" means actively pulling the API interface provided by the "monitoring system" to pull monitoring data.

[0106] Among them, the monitoring module interface obtains data requirements as follows:

[0107]

[0108] The above-mentioned "processing module" needs to obtain three types of data for comprehensive judgment and to issue instructions to the "execution module", including:

[0109] Data 1: Obtain the server load status corresponding to the IP from the "Monitoring Module" and filter out the top 10% of the node IP addresses with the highest load;

[0110] Data 2: According to the nodeIP filtered out in "Data 1", call the "k8s api" module to obtain the node computing node corresponding to the nodeIP, and obtain the following data through the "node" computing node:

[0111]

[0112] Among them, "k8s api" is the access interface provided by Kubernetes.

[0113] Data 3: According to the appName field in "Data 2", the appname_uri used to monitor the business status is obtained through the "Business Monitoring" module. Among them, appname_uri is the inspection interface for relevant personnel to complete the service monitoring status in advance. The data format requirements are:

[0114]

[0115] Based on the source data obtained from data 1, 2, and 3, we start to assemble it into a status monitoring system that can monitor the current business. The assembled URL is as follows:

[0116]

[0117]

[0118] The above-mentioned "execution module" will gather relevant data after data processing according to the appName keyword, and can control the behavior of the pod container according to the "strategy", including shutting down pod traffic, pulling up new pods, deleting pods, etc.

[0119] The format of the aggregated data is:

[0120]

[0121] See also Figure 4 , Figure 4 4 is a schematic diagram of the structure of an exception handling device 400 provided in an embodiment of the present application. The exception handling device 400 is applied to a control node in a server cluster. The server cluster includes the control node and at least two computing nodes. The exception handling device 400 includes:

[0122] The acquisition module 401 is used to acquire the load status information of each computing node in the server cluster;

[0123] A determination module 402 is configured to determine a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container;

[0124] A detection module 403 is used to detect the response status of the container in the target node to obtain detection information;

[0125] A processing module 404 is used to perform exception processing on a container corresponding to the target application when the detection information indicates that the target application is in an abnormal response state;

[0126] The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application;

[0127] Second processing method: prohibiting the flow of the abnormal container corresponding to the target application;

[0128] A third processing method: increasing the number of containers corresponding to the target application.

[0129] Optionally, the control node stores uniform resource locator URL information, the URL information includes a URL address corresponding to a container in each computing node, and the detection module 403 includes:

[0130] An acquisition submodule is used to acquire the URL address corresponding to the container in the target node;

[0131] The acquisition submodule is used to send a detection request to the URL address corresponding to the container in the target node to obtain the detection information, wherein the detection information includes response information of the container in the target node to the detection request.

[0132] Optionally, in the server cluster, there is at least one container deployed with a target application; the determination module 402 is further configured to determine that the target application is in the abnormal response state in the first case, the second case, or the third case;

[0133] The first situation is that there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than or equal to a first threshold; the second situation is that there are abnormal containers of the second type in the containers corresponding to the target application; the third situation is that there are abnormal containers of the third type in the containers corresponding to the target application;

[0134] The response information of the first type of abnormal container to the detection request includes: response information in which the response duration is between the first threshold and the second threshold, and the hypertext transfer protocol status code is a target status code, wherein the target status code indicates that the container successfully responds to the received detection request;

[0135] The response information of the second type of abnormal container to the detection request includes: response information in which the hypertext transfer protocol status code is not the target status code;

[0136] The response information of the third type of abnormal container to the detection request includes: response information that the response time is greater than the second threshold and the container state is not ready.

[0137] Optionally, in the first case, the exception handling includes the second handling method or the third handling method;

[0138] In the second case, the exception handling includes the second handling method and the third handling method;

[0139] In the third case, the exception handling includes the first handling method.

[0140] Optionally, in the first case,

[0141] If the proportion of abnormal containers of the first type is between the first threshold and the second threshold, the abnormal processing includes the second processing method;

[0142] If the proportion of abnormal containers of the first type is greater than the second threshold, the abnormal processing includes the third processing method.

[0143] Optionally, the determining module 402 includes:

[0144] A scoring submodule, configured to score each computing node based on the load status information to obtain a scoring value corresponding to each computing node, wherein the scoring value is positively correlated with the load in the corresponding computing node;

[0145] A determination submodule is used to determine a target node among the at least two computing nodes according to the score value.

[0146] The exception handling device 400 provided in the embodiment of the present application can implement each process in the above-mentioned exception handling method embodiment, and will not be described again here to avoid repetition.

[0147] See also Figure 5 , Figure 5 is a structural diagram of an exception handling device 500 provided in another embodiment of the present application, such as Figure 5 As shown, the exception handling device 500 includes: a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor. The various components in the database generating device are coupled together via a bus interface 503. When the computer program is executed by the processor 501, the following steps are implemented:

[0148] Obtain the load status information of each computing node in the server cluster;

[0149] Determine a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container;

[0150] Detecting a response status of a container in the target node to obtain detection information;

[0151] When the detection information indicates that the target application is in an abnormal response state, performing abnormal processing on a container corresponding to the target application;

[0152] The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application;

[0153] Second processing method: prohibiting the flow of the abnormal container corresponding to the target application;

[0154] A third processing method: increasing the number of containers corresponding to the target application.

[0155] Optionally, the control node stores uniform resource locator URL information, the URL information includes a URL address corresponding to a container in each computing node, and the detecting the response status of the container in the target node to obtain the detection information includes:

[0156] Obtain the URL address corresponding to the container in the target node;

[0157] A detection request is sent to a URL address corresponding to the container in the target node to obtain the detection information, where the detection information includes response information of the container in the target node to the detection request.

[0158] Optionally, in the server cluster, there is at least one container in which a target application is deployed; and the method further includes:

[0159] In the first case, the second case, or the third case, determining that the target application is in the abnormal response state;

[0160] The first situation is that there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than or equal to a first threshold; the second situation is that there are abnormal containers of the second type in the containers corresponding to the target application; the third situation is that there are abnormal containers of the third type in the containers corresponding to the target application;

[0161] The response information of the first type of abnormal container to the detection request includes: response information in which the response duration is between the first threshold and the second threshold, and the hypertext transfer protocol status code is a target status code, wherein the target status code indicates that the container successfully responds to the received detection request;

[0162] The response information of the second type of abnormal container to the detection request includes: response information in which the hypertext transfer protocol status code is not the target status code;

[0163] The response information of the third type of abnormal container to the detection request includes: response information that the response time is greater than the second threshold and the container state is not ready.

[0164] Optionally, in the first case, the exception handling includes the second handling method or the third handling method;

[0165] In the second case, the exception handling includes the second handling method and the third handling method;

[0166] In the third case, the exception handling includes the first handling method.

[0167] Optionally, in the first case,

[0168] If the proportion of abnormal containers of the first type is between the first threshold and the second threshold, the abnormal processing includes the second processing method;

[0169] If the proportion of abnormal containers of the first type is greater than the second threshold, the abnormal processing includes the third processing method.

[0170] Optionally, determining a target node among the at least two computing nodes based on the load status information includes:

[0171] Scoring each of the computing nodes based on the load status information to obtain a scoring value corresponding to each of the computing nodes, wherein the scoring value is positively correlated with the load in the corresponding computing node;

[0172] According to the score value, a target node is determined among the at least two computing nodes.

[0173] An embodiment of the present application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0174] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0175] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0176] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for an electronic device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0177] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An exception handling method, applied to a control node in a server cluster, wherein the server cluster includes the control node and at least two computing nodes, characterized in that: The method comprises: Obtain the load status information of each computing node in the server cluster; Determine a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container; Detecting a response status of a container in the target node to obtain detection information; When the detection information indicates that the target application is in an abnormal response state, performing abnormal processing on a container corresponding to the target application; The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application; Second processing method: prohibiting the flow of the abnormal container corresponding to the target application; A third processing method: increasing the number of containers corresponding to the target application.

2. The method according to claim 1, characterized in that The control node stores uniform resource locator URL information, the URL information includes a URL address corresponding to a container in each computing node, and the detection of the response status of the container in the target node to obtain detection information includes: Obtain the URL address corresponding to the container in the target node; A detection request is sent to a URL address corresponding to the container in the target node to obtain the detection information, where the detection information includes response information of the container in the target node to the detection request.

3. The method according to claim 2, characterized in that In the server cluster, there is at least one container with a target application deployed; the method further includes: In the first case, the second case, or the third case, determining that the target application is in the abnormal response state; The first situation is that there are abnormal containers of the first type in the containers corresponding to the target application, and the proportion of abnormal containers of the first type is greater than or equal to a first threshold; the second situation is that there are abnormal containers of the second type in the containers corresponding to the target application; the third situation is that there are abnormal containers of the third type in the containers corresponding to the target application; The response information of the first type of abnormal container to the detection request includes: response information in which the response duration is between the first threshold and the second threshold, and the hypertext transfer protocol status code is a target status code, wherein the target status code indicates that the container successfully responds to the received detection request; The response information of the second type of abnormal container to the detection request includes: response information in which the hypertext transfer protocol status code is not the target status code; The response information of the third type of abnormal container to the detection request includes: response information that the response time is greater than the second threshold and the container state is not ready.

4. The method according to claim 3, characterized in that In the first case, the exception handling includes the second handling method or the third handling method; In the second case, the exception handling includes the second handling method and the third handling method; In the third case, the exception handling includes the first handling method.

5. The method according to claim 4, characterized in that In the first case, If the proportion of abnormal containers of the first type is between the first threshold and the second threshold, the abnormal processing includes the second processing method; If the proportion of abnormal containers of the first type is greater than the second threshold, the abnormal processing includes the third processing method.

6. The method according to claim 1, characterized in that The step of determining a target node among the at least two computing nodes based on the load status information includes: Scoring each of the computing nodes based on the load status information to obtain a scoring value corresponding to each of the computing nodes, wherein the scoring value is positively correlated with the load in the corresponding computing node; According to the score value, a target node is determined among the at least two computing nodes.

7. An exception handling device, applied to a control node in a server cluster, wherein the server cluster includes the control node and at least two computing nodes, characterized in that: The exception handling device comprises: An acquisition module is used to obtain the load status information of each computing node in the server cluster; A determination module, configured to determine a target node among the at least two computing nodes based on the load status information, wherein the load of the target node is higher than a preset threshold, and the target node includes at least one container, and one application is deployed in one container; A detection module, used to detect the response status of the container in the target node to obtain detection information; A processing module, configured to perform exception processing on a container corresponding to the target application when the detection information indicates that the target application is in an abnormal response state; The processing method of the exception handling includes at least one of the following: a first processing method: expelling the exception container corresponding to the target application; Second processing method: prohibiting the flow of the abnormal container corresponding to the target application; A third processing method: increasing the number of containers corresponding to the target application.

8. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method steps according to any one of claims 1 to 6 when executed by the processor.

9. 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 steps according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Method and apparatus for detecting running state of container cluster, and computing device

    WO2026179442A1