Resource exception processing method, system and server
By sensing abnormal information based on running data in the Flink cluster, generating node identification strategies and processing abnormal information, it solves the resource allocation delay and stability problems caused by hardware and software abnormalities in the Flink cluster, and achieves fast and accurate exception detection and processing. , improving the stability and maintainability of the cluster.
Patent Information
- Application Number
- CN202410866408.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Hardware and software anomalies in the Flink cluster lead to delayed resource allocation and slow job startup. Existing technology cannot accurately handle abnormal nodes in real time, resulting in low stability and maintainability.
Based on the operating data of the Flink cluster, it comprehensively perceives hardware and software exception information, generates node identification strategies, determines the node processing plan and job processing plan corresponding to the abnormal information, simplifies the exception handling process, and improves stability and maintainability.
It improves the sensitivity of anomaly detection, quickly and accurately discovers faulty nodes, simplifies the exception handling process, and improves the stability and maintainability of the Flink cluster. The node abnormality judgment speed is increased to the second level, the number of task restarts is reduced, and the startup time is shortened. .
Smart Images

Figure CN118394562B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a resource exception processing method, system and server. Background Art
[0002] A large number of machines and equipment are set up in distributed systems such as Flink clusters. These hardware devices may have hardware problems during operation, such as disk failure, machine downtime, memory failure, etc., which may cause the machine equipment to freeze; software problems may also occur when processing large quantities of jobs, such as disk IO fullness, competition between jobs, etc., which may affect the deployment and operation of jobs. When resources are allocated to downed nodes, the resources cannot be quickly prepared, and the job takes at least 5 minutes or more to start; when resources are scheduled to nodes with slower running speeds, the startup time of the task manager is extended, which slows down the startup speed of the entire job; during the job running stage, if there is a problem with the machine, it may cause the job processing speed on the machine to decrease, causing consumption delays in individual partitions and even back pressure.
[0003] When solving the above technical problems, the processing solutions in the existing technology cannot handle abnormal nodes in real time and accurately, resulting in low stability and maintainability of the Flink cluster. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a resource exception handling method, system and server. The method comprehensively perceives the abnormal information of hardware and software based on the operation data of the Flink cluster to generate a corresponding node identification strategy, and directly perceives the occurrence of the exception without clarifying the detailed cause of the exception, thereby improving the sensitivity of exception detection; and then determines the node processing plan and job processing plan corresponding to the exception information through the node identification strategy to generate a resource processing plan, which simplifies the exception handling process from the perspective of resource management and improves the stability and maintainability of the Flink cluster.
[0005] In a first aspect, an embodiment of the present invention provides a resource exception handling method, which is applied to a Flink cluster and includes:
[0006] Obtain the node resources of the Flink cluster and determine the running data of the Flink cluster based on the job nodes and control nodes of the node resources;
[0007] Obtain the abnormal information contained in the Flink cluster in real time based on the running data, and generate the corresponding node identification strategy according to the type of abnormal information;
[0008] The node identification strategy is used to determine the node processing scheme and job processing scheme corresponding to the abnormal information, and the resource processing scheme corresponding to the abnormal information is generated through the node processing scheme and the job processing scheme;
[0009] Control the Flink cluster to clear exception information after executing the resource processing solution.
[0010] In one implementation, the step of obtaining node resources of a Flink cluster and determining the operation data of the Flink cluster according to the job nodes and the control nodes of the node resources includes:
[0011] Determine the node resources according to the device index parameters and task index parameters of the Flink cluster; the device index parameters include: CPU index parameters, memory index parameters, thread parameters, JAVA virtual machine parameters, network index parameters, input / output parameters, memory management index parameters; the task index parameters include: job manager index parameters, task manager index parameters, processing slot index parameters, job index parameters, operator index parameters;
[0012] Obtain the running indicator data and exception information data of the Flink cluster under the job through the job nodes and control nodes corresponding to the node resources under the same job;
[0013] The operation index data and abnormal information data are used to determine the operation data.
[0014] In one implementation, the steps of acquiring the abnormal information contained in the Flink cluster in real time based on the running data and generating a corresponding node identification strategy according to the type of the abnormal information include:
[0015] Determine the abnormal information contained in the Flink cluster according to the operation abnormality data and startup abnormality data corresponding to all Flink running jobs in the operation data; the operation abnormality data includes: input / output abnormality data, heartbeat timeout abnormality data, task manager abnormality data, and task operation abnormality data; the startup abnormality data includes: memory space abnormality data, job manager startup abnormality data, and task manager startup abnormality data;
[0016] Obtain the exception information corresponding to the Flink running job, and use the type parameter corresponding to the exception information to determine the node identification strategy; the type parameter corresponds to the faulty node type and the slow node type.
[0017] In one implementation, the steps of obtaining exception information corresponding to a Flink running job and determining a node identification strategy using a type parameter corresponding to the exception information include:
[0018] Get the exception information corresponding to the Flink running jobs in the same time window and on the same node;
[0019] Determine the faulty node in the Flink cluster based on the running exception data and startup exception data contained in the exception information;
[0020] The node identification strategy is determined using the type parameters corresponding to the faulty nodes.
[0021] In one implementation, the steps of obtaining exception information corresponding to a Flink running job and determining a node identification strategy using a type parameter corresponding to the exception information include:
[0022] Determine the exception information corresponding to the Flink running job based on the data throughput data corresponding to all Flink running tasks in the running data;
[0023] Determine the number of task managers corresponding to the exception information;
[0024] When the number of task managers exceeds the preset threshold, the corresponding slow nodes of the Flink cluster are determined;
[0025] The node identification strategy is determined using the type parameters corresponding to the slow nodes.
[0026] In one implementation, the step of determining the abnormal information corresponding to the Flink running job according to the data throughput data corresponding to all Flink running tasks in the running data includes:
[0027] Obtain the data throughput data corresponding to all Flink running tasks in the running data, and determine the data throughput corresponding to the data throughput data;
[0028] If the data throughput does not exceed the preset first threshold, the message processing time consumption data contained in the operation data is obtained, and the time consumption duration corresponding to the message processing time consumption data is determined;
[0029] If the duration exceeds the preset second threshold, the exception information corresponding to the Flink running job is obtained.
[0030] In one embodiment, the steps of using a node identification strategy to determine a node processing solution and a job processing solution corresponding to the abnormal information, and generating a resource processing solution corresponding to the abnormal information through the node processing solution and the job processing solution include:
[0031] Get the type parameter corresponding to the node identification strategy; the type parameter corresponds to the fault node type and the slow node type;
[0032] Determine the node processing plan and job processing plan based on the abnormal node processing plan, slow node processing plan and task operation monitoring plan determined by the type parameters;
[0033] The node processing scheme and the job processing scheme are used to generate the resource processing scheme corresponding to the exception information. Among them, the node processing scheme performs node processing through yarn; the job processing scheme performs job processing through Flink.
[0034] In one implementation, the step of controlling the Flink cluster to clear the exception information after executing the resource processing solution includes:
[0035] Determine the exception handling method and timing of the Flink cluster based on the resource processing solution;
[0036] Process the nodes and tasks corresponding to the exception information according to the exception handling method, and process the restart timing and clearing timing corresponding to the exception information according to the exception handling timing;
[0037] After executing resource exception handling on the Flink cluster using the exception handling method and exception handling timing, clear the exception information corresponding to the resource handling solution.
[0038] In a second aspect, an embodiment of the present invention provides a resource exception handling system, which is applied to a Flink cluster, and includes:
[0039] The running data acquisition module is used to obtain the node resources of the Flink cluster and determine the running data of the Flink cluster based on the job nodes and control nodes of the node resources;
[0040] The node identification strategy determination module is used to obtain the abnormal information contained in the Flink cluster in real time based on the running data, and generate the corresponding node identification strategy according to the type of abnormal information;
[0041] A resource processing solution generation module is used to determine the node processing solution and the job processing solution corresponding to the abnormal information by using the node identification strategy, and generate the resource processing solution corresponding to the abnormal information by using the node processing solution and the job processing solution;
[0042] The exception information processing module is used to control the Flink cluster to clear the exception information after executing the resource processing solution.
[0043] In a third aspect, an embodiment of the present invention further provides a server, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the resource exception handling method provided in the first aspect.
[0044] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions. When the computer executable instructions are called and executed by a processor, the computer executable instructions prompt the processor to implement the steps of the resource exception handling method provided in the first aspect.
[0045] A resource exception handling method, system and server provided by an embodiment of the present invention are applied to a scenario in which a Flink cluster performs exception handling in a complex environment of a large number of jobs and machines. Specifically, when configuring resources, the node resources of the Flink cluster are first obtained, and the operation data of the Flink cluster is determined according to the job nodes and control nodes of the node resources; then, the exception information contained in the Flink cluster is obtained in real time based on the operation data, and a corresponding node identification strategy is generated according to the type of the exception information. Specifically, Flink tasks can be used to monitor nodes and tasks, so that the judgment speed of node exceptions is increased to seconds. By monitoring the abnormal conditions of multiple jobs, especially the exceptions from the same node, nodes that may have faults can be found more quickly and accurately, thereby improving the sensitivity of exception detection. Subsequently, the node identification strategy is used to determine the node processing scheme and job processing scheme corresponding to the exception information, and the resource processing scheme corresponding to the exception information is generated through the node processing scheme and the job processing scheme; finally, the Flink cluster is controlled to execute the resource processing scheme and clear the exception information. This method comprehensively perceives the abnormal information of hardware and software based on the running data of the Flink cluster to generate the corresponding node identification strategy. It directly perceives the occurrence of abnormalities without clarifying the detailed causes of the abnormalities, thereby improving the sensitivity of abnormality detection; and then determines the corresponding node processing plan and job processing plan for the abnormal information through the node identification strategy to generate a resource processing plan, which simplifies the exception handling process from the perspective of resource management and improves the stability and maintainability of the Flink cluster.
[0046] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A flowchart of a resource exception handling method provided by an embodiment of the present invention;
[0050] Figure 2 A flowchart of step S101 in a resource exception handling method provided in an embodiment of the present invention;
[0051] Figure 3 A flowchart of step S102 in a resource exception handling method provided in an embodiment of the present invention;
[0052] Figure 4 A flowchart of step S302 in a resource exception handling method provided in an embodiment of the present invention;
[0053] Figure 5 A flowchart of step S302 in another resource exception handling method provided in an embodiment of the present invention;
[0054] Figure 6 A flowchart of step S501 in a resource exception handling method provided in an embodiment of the present invention;
[0055] Figure 7 A flowchart of step S103 in a resource exception handling method provided in an embodiment of the present invention;
[0056] Figure 8 A flowchart of step S104 in a resource exception handling method provided in an embodiment of the present invention;
[0057] Fig. 9 A flowchart of another resource exception handling method provided by an embodiment of the present invention;
[0058] Fig.10 A flowchart of a resource exception handling method for handling abnormal nodes provided by an embodiment of the present invention;
[0059] Fig.11 A flowchart of a method for handling resource anomalies according to an embodiment of the present invention for determining a slow node;
[0060] Fig.12 A schematic diagram of the structure of a resource exception handling system provided by an embodiment of the present invention;
[0061] Fig.13 A schematic diagram of the structure of a server provided in an embodiment of the present invention.
[0062] icon:
[0063] 1210-operation data acquisition module; 1220-node identification strategy determination module; 1230-resource processing solution generation module; 1240-abnormal information processing module;
[0064] 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] A large number of machines and devices are set up in distributed systems such as Flink clusters. In the environment of using a large number of jobs, resource-related problems are particularly prominent, mainly divided into hardware problems and software problems. Hardware problems include various situations, such as disk failure, machine downtime, and machine jams caused by memory failures. Hardware failures have a direct negative impact on the normal deployment and operation of jobs. For example, when resources are scheduled to a down node, the resources cannot be ready in time, so that the job takes at least 5 minutes to start. When resources are scheduled to a slow node, the startup time of the Task Manager (TM) is extended, resulting in a slow startup of the entire job.
[0067] Software problems include full disk I / O and competition between jobs. Software problems cause data read and write operations to become slow, thus affecting the overall performance of the job. Competition between jobs may lead to resource contention, which in turn affects the deployment and operation efficiency of the job. During the job deployment phase, a typical problem is that resources are scheduled to down nodes or slow nodes, resulting in longer startup time. During the job running phase, problems with the machine may cause slow job processing, causing consumption delays in individual partitions, and even back pressure.
[0068] The processing solutions in the prior art for solving the above technical problems are still unable to handle abnormal nodes accurately in real time, resulting in low stability and maintainability of the Flink cluster. Based on this, the present invention implements a resource exception handling method, system and server, which comprehensively perceives the abnormal information of hardware and software based on the operation data of the Flink cluster to generate a corresponding node identification strategy, directly perceives the occurrence of abnormalities without clarifying the detailed abnormal causes, thereby improving the sensitivity of abnormality detection; and then determines the node processing solution and job processing solution corresponding to the abnormal information through the node identification strategy to generate a resource processing solution, which simplifies the exception handling process from the perspective of resource management and improves the stability and maintainability of the Flink cluster.
[0069] To facilitate understanding of this embodiment, a resource exception handling method disclosed in an embodiment of the present invention is first described in detail. The method is applied to a Flink cluster, such as Figure 1As shown, including:
[0070] Step S101, obtaining the node resources of the Flink cluster, and determining the operation data of the Flink cluster according to the job nodes and control nodes of the node resources;
[0071] Step S102, acquiring the abnormal information contained in the Flink cluster in real time based on the running data, and generating a corresponding node identification strategy according to the type of the abnormal information;
[0072] Step S103, using the node identification strategy to determine the node processing solution and the job processing solution corresponding to the abnormal information, and generating the resource processing solution corresponding to the abnormal information through the node processing solution and the job processing solution;
[0073] Step S104, controlling the Flink cluster to execute the resource processing solution and then clearing the exception information.
[0074] The Flink cluster contains multiple machines and devices, each of which is equipped with a task manager TaskManager, and some machines and devices are also equipped with a job manager JobManager. The operation data of the Flink cluster is determined by the job nodes and control nodes corresponding to the Flink cluster node resources, so as to realize the collection process of abnormal information and operation indicators during task operation. By analyzing the operation data, abnormal information and operation indicators are obtained, and then the corresponding node identification strategy is determined by combining the operation indicators with the type of abnormal information to handle slow nodes and faulty nodes. It can be seen that the acquisition of abnormal information is directly considered from the application level of the node. The abnormal information can be directly obtained without clarifying the detailed cause of the abnormality, which improves the sensitivity of abnormality detection.
[0075] After the node identification strategy is determined, the corresponding node processing scheme and job processing scheme can be determined according to the exception information. The node processing scheme is used to handle the abnormal node, and the job processing scheme is used to handle the corresponding Flink job, so as to use these two job processing schemes to generate the resource processing scheme corresponding to the exception information. These two processing schemes directly process node resources from the perspective of resource management, making the exception handling process more flexible and efficient. When executing the resource processing scheme, the Flink cluster can use stream processing and batch processing to execute, which is compatible with different types of resource management services, improving the maintainability and scalability of the Flink cluster.
[0076] In one implementation, the step S101 of acquiring the node resources of the Flink cluster and determining the operation data of the Flink cluster according to the job nodes and the control nodes of the node resources is as follows: Figure 2 As shown, including:
[0077] Step S201, determining node resources according to device index parameters and task index parameters of the Flink cluster;
[0078] Step S202, obtaining the operation indicator data and abnormal information data corresponding to the Flink cluster under the job through the job node and the control node corresponding to the node resources under the same job;
[0079] Step S203, determining the operation data using the operation index data and the abnormal information data.
[0080] Specifically, the device indicator parameters correspond to the indicators of the machine system, including: CPU indicator parameters, memory indicator parameters, thread parameters, JAVA virtual machine parameters, network indicator parameters, input / output parameters, and memory management indicator parameters; the task indicator parameters correspond to the indicators of the running components, including: job manager indicator parameters, task manager indicator parameters, processing slot indicator parameters, job indicator parameters, and operator indicator parameters. After the corresponding node resources are generated using the device indicator parameters and task indicator parameters, the corresponding running indicator data and abnormal information data are obtained through the job nodes and control nodes corresponding to the node resources under the same job node, and are determined as running data. Normally, if a machine has a problem, all jobs on the machine may be affected. By monitoring the abnormal conditions of multiple jobs, especially those from the same node, it can be inferred that there may be a problem with the node.
[0081] Specifically, in one implementation, the abnormal information contained in the Flink cluster is acquired in real time based on the running data, and a corresponding node identification strategy is generated according to the type of the abnormal information in step S102, such as Figure 3 As shown, including:
[0082] Step S301, determining the abnormal information contained in the Flink cluster according to the operation abnormality data and startup abnormality data corresponding to all Flink running jobs in the operation data;
[0083] Step S302, obtain the exception information corresponding to the Flink running job, and determine the node identification strategy using the type parameter corresponding to the exception information; wherein the type parameter corresponds to the fault node type and the slow node type.
[0084] In the specific implementation process, abnormal-service can be used to collect the abnormal information of all Flink running jobs. The abnormal information includes running abnormal data and startup abnormal data. The running abnormal data includes: input / output abnormal data, heartbeat timeout abnormal data, task manager abnormal data, task running abnormal data; startup abnormal data includes: memory space abnormal data, job manager startup abnormal data, task manager startup abnormal data. Then, the node identification strategy is determined by the type parameter of the abnormal information corresponding to the Flink running job.
[0085] The type parameter corresponds to the fault node type and the slow node type. When obtaining the node identification strategy of the fault node type, in one implementation, the abnormal information corresponding to the Flink running job is obtained, and the step S302 of determining the node identification strategy is performed using the type parameter corresponding to the abnormal information, such as Figure 4 As shown, including:
[0086] Step S401, obtaining the exception information corresponding to the Flink running job in the same time window and on the same node;
[0087] Step S402: determine the faulty node corresponding to the Flink cluster according to the running abnormality data and the startup abnormality data contained in the abnormality information;
[0088] Step S403: determine a node identification strategy using the type parameter corresponding to the faulty node.
[0089] A Flink job is used to determine whether multiple jobs on a certain node at the same time point have all experienced exceptions. The main judgment logic is whether multiple jobs on the same node report exceptions within the same time window. According to the operation exception data and startup exception data contained in the exception information, if the exception type is detected as IO exception, communication exception, startup timeout, etc., it is determined to be a faulty node, and then the type parameter corresponding to the faulty node is used to determine the node identification strategy. Compared with focusing only on multiple exceptions of a single job, this method can more quickly and accurately detect nodes that may have faults.
[0090] When obtaining the node identification strategy of the slow node type, in one implementation, the abnormal information corresponding to the Flink running job is obtained, and the step S302 of determining the node identification strategy is performed using the type parameter corresponding to the abnormal information, such as Figure 5 As shown, including:
[0091] Step S501, determining the abnormal information corresponding to the Flink running job according to the data throughput data corresponding to all Flink running tasks in the running data;
[0092] Step S502, determining the number of task managers corresponding to the abnormal information;
[0093] Step S503: when the number of task managers exceeds a preset threshold, determine the slow node corresponding to the Flink cluster;
[0094] Step S504: determine a node identification strategy using the type parameters corresponding to the slow node.
[0095] The execution speed of node tasks is determined by the data throughput data corresponding to all Flink running tasks, and then the corresponding slow nodes are determined according to the number of task managers corresponding to the exception information, and the node identification strategy is determined by using the type parameters of the slow nodes.
[0096] In one implementation, according to the data throughput data corresponding to all Flink running tasks in the running data, step S501 of determining the abnormal information corresponding to the Flink running job is as follows: Figure 6 As shown, including:
[0097] Step S601, obtaining data throughput data corresponding to all Flink running tasks in the running data, and determining the data throughput corresponding to the data throughput data;
[0098] Step S602: if the data throughput does not exceed the preset first threshold, the message processing time consumption data contained in the operation data is obtained, and the time consumption duration corresponding to the message processing time consumption data is determined;
[0099] Step S603: If the duration exceeds a preset second threshold, the exception information corresponding to the Flink running job is obtained.
[0100] When the node task execution is too slow, the slow node can be found by counting the abnormally slow task execution time, and the slow node can be avoided at the task scheduling and resource scheduling level. When the task is delayed, observe whether a job has a partial concurrent throughput, whether it is significantly higher than other concurrencies, and specifically determine it by the first threshold. If yes, it means that there is data skew. If not, continue to check whether the processTime of some concurrencies is much higher than other concurrencies. It is worth mentioning that processTime is a parameter of the time consumption indicator for processing a single message.
[0101] Specifically, if processTime is higher than other concurrency, it is necessary to determine whether it is a logic bias or a slow node. If there is a slow consumption task in a task manager, the slow node vote of this node is +1; the consumption time is determined by the second threshold. If more than half of the task managers on a machine think that the node is slow, it can be considered that the reason for the slow consumption is a slow node.
[0102] In one embodiment, the node identification strategy is used to determine the node processing scheme and the job processing scheme corresponding to the abnormal information, and the step S103 of generating the resource processing scheme corresponding to the abnormal information through the node processing scheme and the job processing scheme is as follows: Figure 7 As shown, including:
[0103] Step S701, obtaining a type parameter corresponding to a node identification strategy; wherein the type parameter corresponds to a faulty node type and a slow node type;
[0104] Step S702, determining a node processing solution and a job processing solution according to the abnormal node processing solution, the slow node processing solution and the task operation monitoring solution determined by the type parameter;
[0105] Step S703: Generate a resource processing solution corresponding to the abnormal information using the node processing solution and the job processing solution.
[0106] The resource processing scheme is generated based on the node processing scheme and the job processing scheme. Specifically, the node processing scheme uses yarn to process nodes, and the job processing scheme uses Flink to process jobs. The identified exception information can be used to pass the faulty nodes and slow nodes to yarn and Flink tasks for processing. This processing flow is designed to simplify the overall processing process from the perspective of resource management. In actual scenarios, it can support both stream processing and batch processing execution modes, and is compatible with different resource management services. This integration approach aims to improve the maintainability and scalability of the system, making exception handling more flexible and efficient.
[0107] In one implementation, the step S104 of controlling the Flink cluster to execute the resource processing solution and then clearing the exception information is as follows: Figure 8 As shown, including:
[0108] Step S801, determining the exception handling method and timing of the Flink cluster based on the resource handling solution;
[0109] Step S802, processing the nodes and tasks corresponding to the exception information according to the exception processing method, and processing the restart timing and clearing timing corresponding to the exception information according to the exception processing timing;
[0110] Step S803, after executing resource exception handling on the Flink cluster using the exception handling method and exception handling timing, clear the exception information corresponding to the resource handling solution.
[0111] The exception handling method and timing determine the processing granularity and processing time. The processing granularity is determined by the exception type to determine whether to set the entire node as an abnormal node or a single task as an abnormal task; the processing time is determined by the degree of abnormality to determine whether to delay the task until the task is restarted or to immediately clear the task on the abnormal node. In the resource management layer of the Flink task side, you can add the Abnormal Task Management Service, which supports blacklisting nodes and blacklisting nodes and ending the current node task. On the yarn side, you can add the abnormal status to the health check of yarn itself (indicating that the node is no longer scheduled, but the running container is not cleared) to ensure the timeliness of the task.
[0112] The following describes the resource exception handling method in combination with specific scenarios, such as Fig. 9 As shown in the flowchart of another resource exception handling method, this method can capture exceptions through a blacklist mechanism. Fig. 9 The left part of the list is the discovery part. TaskManager is the task manager and JobManager is the job manager. It collects the abnormal information and operation indicators of the task operation and uses the relevant indicators to find the cause of the abnormal service. The cause is a slow node or a faulty node. This method senses from multiple applications in the application layer, simplifies the difficulty of discovery, and does not need to clarify the detailed cause of the abnormality, which greatly reduces the complexity.
[0113] Fig. 9 The right side of the diagram is blacklist access. Through the identified exception information, the faulty nodes and slow nodes are passed to the yarn and Flink tasks for processing. This processing flow is based on resource management and aims to simplify the overall processing process. It supports both stream processing and batch processing execution modes and is compatible with different resource management services. This integration approach aims to improve the maintainability and scalability of the system, making exception handling more flexible and efficient.
[0114] The abnormal node reporting process is as follows: Fig.10As shown in the figure, usually, if a machine has a problem, all jobs on the machine may be affected. By monitoring the abnormal conditions of multiple jobs, especially those from the same node, it can be inferred that there may be a problem with the node. To achieve this idea, abnormal-service is used to collect the abnormal information of all Flink running jobs. This includes runtime exceptions and startup exceptions; then a Flink job is used to determine whether multiple jobs on a certain node at the same time point have abnormalities. The main judgment logic is that within the same time window, multiple jobs on the same node report abnormalities. If the abnormality type is detected as IO abnormality, communication abnormality, startup timeout, etc., it is determined to be a faulty node, and its information is sent to the blacklist service for processing. Compared with focusing only on multiple exceptions of a single job, this method is faster and more accurate in discovering nodes that may have faults.
[0115] By integrating abnormal-service, Flink jobs, and blacklist services, abnormal nodes can be monitored and processed more effectively. This approach not only improves the sensitivity of anomaly detection, but also reduces the impact on system performance, allowing for rapid identification and processing of faulty nodes.
[0116] When a node task is executed too slowly, the slow node can be found by counting the abnormally slow execution time of the task, and the slow node can be avoided at the task scheduling and resource scheduling level. Fig.11 As shown. When the task is delayed, observe whether a job has some concurrent throughput and whether it is significantly higher than other concurrencies. If yes, it means that there is data skew. If not, continue to check whether the processTime of some concurrencies is much higher than other concurrencies; processTime is the time-consuming indicator parameter for processing a single message.
[0117] If processTime is higher than other concurrency, determine whether it is a logic tilt or a slow node. If there is a slow consumption task in a task manager (TM), the slow node vote of this node is +1. If more than half of the task managers on a machine think that the node is slow. Then we will think that the reason for the slow consumption is that it encounters a slow node, and this node will be sent to the blacklist service for processing. For the TM running on the slow node, the blacklist allows it to restore the job consumption throughput to normal after the healthy node is restarted.
[0118] After using the above solution, the Flink cluster is improved as follows:
[0119] When a node disk fails, the number of task restarts is reduced from 5+ to 1;
[0120] After a node goes down, the task will be issued and the task node will be switched within 10 seconds, and the task restart time is reduced from 5 minutes to 10 seconds;
[0121] Tasks that are judged to be running on slow nodes are delayed, and consumption throughput can return to normal after healthy nodes are restarted.
[0122] It can be seen that this method comprehensively considers resource-related issues at both the hardware and software levels, covering the entire process from anomaly perception to processing, and covering multiple stages of job deployment and operation.
[0123] Application layer perception: It can monitor the node and task execution status simultaneously, accurately and comprehensively; by perceiving anomalies from the perspective of the application layer, there is no need to understand the cause of the anomaly in detail, making anomaly discovery simpler and reducing system complexity.
[0124] Fast and accurate node discovery: Using Flink tasks to monitor nodes and tasks, the speed of determining node anomalies is improved to seconds. By monitoring the anomalies of multiple jobs, especially those from the same node, nodes that may have faults can be discovered more quickly and accurately, improving the sensitivity of anomaly detection.
[0125] Support for both stream and batch execution modes: From the perspective of resource management, the exception handling process supports both stream processing and batch processing execution modes, which increases the flexibility and adaptability of the system.
[0126] System maintainability and scalability: The integration of abnormal-service, Flink jobs, and blacklist services improves the maintainability and scalability of the system, making exception handling more flexible and efficient.
[0127] Exception handling granularity and time control: You can flexibly choose to terminate or put a task on hold. You can determine whether to set the entire node as an abnormal node or a single task as an abnormal task based on the exception type. At the same time, the processing time is determined based on the degree of the exception to ensure task timeliness.
[0128] Comprehensiveness: It can monitor the node and task execution status simultaneously, accurately and comprehensively.
[0129] It can be seen from the resource exception handling method in the above embodiment that the method comprehensively perceives the abnormal information of hardware and software based on the operation data of the Flink cluster to generate a corresponding node identification strategy, and directly perceives the occurrence of the exception without clarifying the detailed cause of the exception, thereby improving the sensitivity of exception detection; and then determines the node processing plan and job processing plan corresponding to the exception information through the node identification strategy to generate a resource processing plan, which simplifies the exception handling process from the perspective of resource management and improves the stability and maintainability of the Flink cluster.
[0130] For the resource exception handling method provided in the above embodiment, the embodiment of the present invention provides a resource exception handling system, which is applied to a Flink cluster, such as Fig.12 As shown, the system includes:
[0131] The operation data acquisition module 1210 is used to obtain the node resources of the Flink cluster and determine the operation data of the Flink cluster according to the job nodes and control nodes of the node resources;
[0132] The node identification strategy determination module 1220 is used to obtain the abnormal information contained in the Flink cluster in real time based on the running data, and generate a corresponding node identification strategy according to the type of the abnormal information;
[0133] The resource processing solution generation module 1230 is used to determine the node processing solution and the job processing solution corresponding to the abnormal information by using the node identification strategy, and generate the resource processing solution corresponding to the abnormal information by using the node processing solution and the job processing solution;
[0134] The exception information processing module 1240 is used to control the Flink cluster to clear the exception information after executing the resource processing solution.
[0135] From the resource exception handling system mentioned in the above embodiment, it can be seen that the system comprehensively perceives the abnormal information of hardware and software based on the operation data of the Flink cluster to generate a corresponding node identification strategy. It can directly perceive the occurrence of abnormalities without clarifying the detailed causes of the abnormalities, thereby improving the sensitivity of abnormality detection; and then determine the node processing plan and job processing plan corresponding to the abnormal information through the node identification strategy to generate a resource processing plan, which simplifies the exception handling process from the perspective of resource management and improves the stability and maintainability of the Flink cluster.
[0136] The resource exception handling system provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned resource exception handling method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned resource exception handling method embodiment.
[0137] This embodiment also provides a server, the structural diagram of which is as follows: Fig.13 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the steps of the above-mentioned resource exception handling method.
[0138] Fig.13 The server shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .
[0139] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0140] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.
[0141] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method of the above embodiment in combination with its hardware.
[0142] An embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource exception handling method in the above embodiment are executed.
[0143] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0145] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0146] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0147] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A resource exception handling method, characterized in that: The method is applied to a Flink cluster, and the method includes: Acquire node resources of the Flink cluster, and determine operation data of the Flink cluster according to the job nodes and control nodes of the node resources; Acquire the abnormal information contained in the Flink cluster in real time based on the running data, and generate a corresponding node identification strategy according to the type of the abnormal information; Determine the node processing scheme and the job processing scheme corresponding to the abnormal information by using the node identification strategy, and generate the resource processing scheme corresponding to the abnormal information by using the node processing scheme and the job processing scheme; wherein the node processing scheme is used to process the abnormal node, and the job processing scheme is used to process the corresponding Flink job in the Flink cluster; Controlling the Flink cluster to execute the resource processing solution and then clearing the exception information; The step of clearing the exception information after controlling the Flink cluster to execute the resource processing solution includes: Determine the exception handling method and exception handling timing of the Flink cluster based on the resource processing solution; Processing the nodes and tasks corresponding to the exception information according to the exception processing method; After executing resource exception handling on the Flink cluster using the exception handling method and the exception handling timing, clearing the exception information corresponding to the resource handling solution; Among them, the exception handling method and the exception handling timing determine the processing granularity and processing time. The processing granularity is to determine whether to set the entire node as an abnormal node or a single task as an abnormal task based on the exception type; the processing time is to determine whether to delay the task until the task is restarted or to immediately clear the task on the abnormal node based on the degree of abnormality.
2. The resource exception handling method according to claim 1, characterized in that: The step of obtaining the node resources of the Flink cluster and determining the operation data of the Flink cluster according to the job nodes and control nodes of the node resources includes: Determine the node resources according to the device index parameters and task index parameters of the Flink cluster; wherein the device index parameters include: central processing unit index parameters, memory index parameters, thread parameters, JAVA virtual machine parameters, network index parameters, input / output parameters, and memory management index parameters; and the task index parameters include: job manager index parameters, task manager index parameters, processing slot index parameters, job index parameters, and operator index parameters; Obtain the operation indicator data and abnormal information data corresponding to the Flink cluster under the job through the job node and control node corresponding to the node resource under the same job; The operation data is determined using the operation index data and the abnormal information data.
3. The resource exception handling method according to claim 1, characterized in that: The step of acquiring the abnormal information contained in the Flink cluster in real time based on the running data, and generating a corresponding node identification strategy according to the type of the abnormal information includes: Determine the abnormal information contained in the Flink cluster according to the abnormal operation data and abnormal startup data corresponding to all Flink running jobs in the running data; wherein the abnormal operation data includes: input / output abnormal data, heartbeat timeout abnormal data, task manager abnormal data, and task running abnormal data; the abnormal startup data includes: memory space abnormal data, job manager startup abnormal data, and task manager startup abnormal data; The exception information corresponding to the Flink running job is obtained, and the node identification strategy is determined using a type parameter corresponding to the exception information; wherein the type parameter corresponds to a faulty node type and a slow node type.
4. The resource exception handling method according to claim 3, characterized in that: The step of obtaining the exception information corresponding to the Flink running job and determining the node identification strategy using the type parameter corresponding to the exception information includes: Obtain the exception information corresponding to the Flink running job in the same time window and on the same node; Determine the fault node corresponding to the Flink cluster according to the operation exception data and the startup exception data contained in the exception information; The node identification strategy is determined using the type parameter corresponding to the faulty node.
5. The resource exception handling method according to claim 3, characterized in that: The step of obtaining the exception information corresponding to the Flink running job and determining the node identification strategy using the type parameter corresponding to the exception information includes: Determine the exception information corresponding to the Flink running job according to the data throughput data corresponding to all Flink running tasks in the running data; Determine the number of task managers corresponding to the abnormal information; When the number of task managers exceeds a preset threshold, determining a slow node corresponding to the Flink cluster; The node identification strategy is determined using the type parameter corresponding to the slow node.
6. The resource exception handling method according to claim 5, characterized in that: The step of determining the abnormal information corresponding to the Flink running job according to the data throughput data corresponding to all Flink running tasks in the running data includes: Obtain data throughput data corresponding to all Flink running tasks in the running data, and determine the data throughput corresponding to the data throughput data; If the data throughput does not exceed the preset first threshold, obtaining the message processing time-consuming data contained in the operation data, and determining the time duration corresponding to the message processing time-consuming data; If the time consumed exceeds a preset second threshold, the exception information corresponding to the Flink running job is obtained.
7. The resource exception handling method according to claim 1, characterized in that: The step of using the node identification strategy to determine the node processing scheme and the job processing scheme corresponding to the abnormal information, and generating the resource processing scheme corresponding to the abnormal information through the node processing scheme and the job processing scheme includes: Obtaining a type parameter corresponding to the node identification strategy; wherein the type parameter corresponds to a faulty node type and a slow node type; Determine the node processing solution and the job processing solution according to the abnormal node processing solution, slow node processing solution and task operation monitoring solution determined by the type parameters; The node processing scheme and the job processing scheme are used to generate a resource processing scheme corresponding to the exception information; wherein the node processing scheme performs node processing through yarn; and the job processing scheme performs job processing through Flink.
8. A resource exception handling system, characterized in that: The system is applied to a Flink cluster, and the system includes: An operation data acquisition module is used to acquire the node resources of the Flink cluster and determine the operation data of the Flink cluster according to the job nodes and control nodes of the node resources; A node identification strategy determination module, configured to obtain the abnormal information contained in the Flink cluster in real time based on the operation data, and generate a corresponding node identification strategy according to the type of the abnormal information; A resource processing solution generation module, used to determine the node processing solution and the job processing solution corresponding to the abnormal information by using the node identification strategy, and generate the resource processing solution corresponding to the abnormal information by using the node processing solution and the job processing solution; wherein the node processing solution is used to process the abnormal node, and the job processing solution is used to process the corresponding Flink job in the Flink cluster; An exception information processing module, used to control the Flink cluster to clear the exception information after executing the resource processing solution; The exception information processing module is also used to: determine the exception handling method and exception handling timing of the Flink cluster based on the resource processing scheme; process the nodes and tasks corresponding to the exception information according to the exception handling method; after performing resource exception handling on the Flink cluster using the exception handling method and the exception handling timing, clear the exception information corresponding to the resource processing scheme; wherein the exception handling method and the exception handling timing determine the processing granularity and processing time, and the processing granularity is to determine whether to set the entire node as an abnormal node or a single task as an abnormal task according to the exception type; the processing time is to determine whether to delay the task until the task is restarted or to immediately clear the task on the abnormal node according to the degree of the exception.
9. A server, characterized in that: It comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the resource exception handling method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Initiation node abnormity processing method and device of share nothing cluster
CN104410698A
Node management method and device in data cluster and storage medium
CN115422010A
Processing method and device for kernel exception of system on chip and computer readable storage medium
CN116010140A
Slow node detection method and device during task running, electronic equipment and medium
CN116909714A
Service control method and device based on service cluster, electronic equipment and medium
CN116938720A
