CN116366508A - Container exception handling method and device, processor and electronic equipment - Google Patents

Container exception handling method and device, processor and electronic equipment Download PDF

Info

Publication number
CN116366508A
CN116366508A CN202310336374.XA CN202310336374A CN116366508A CN 116366508 A CN116366508 A CN 116366508A CN 202310336374 A CN202310336374 A CN 202310336374A CN 116366508 A CN116366508 A CN 116366508A
Authority
CN
China
Prior art keywords
container
target
request
target node
containers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310336374.XA
Other languages
Chinese (zh)
Inventor
陈中渊
闫明阳
张杭俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310336374.XA priority Critical patent/CN116366508A/en
Publication of CN116366508A publication Critical patent/CN116366508A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0686Additional information in the notification, e.g. enhancement of specific meta-data

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a container exception handling method, a device, a processor and electronic equipment. Relates to the technical field of containers. The method comprises the following steps: receiving target heartbeat messages respectively sent by a plurality of containers in a target node; determining a target container set for sending the heartbeat message according to target heartbeat messages respectively sent by a plurality of containers in the target node; comparing the target container set with a preset container set, and determining a cartoon container which does not send a heartbeat message in the target node; and under the condition that the heartbeat message sent by the jamming container is not received within the preset time period, the jamming information is sent to the preset terminal, wherein the jamming information carries the identification code corresponding to the jamming container. The invention solves the technical problems that the state of the container is difficult to be determined in time in the related technology, so that the abnormal state cannot be determined in time for processing.

Description

Container exception handling method and device, processor and electronic equipment
Technical Field
The present invention relates to the field of containers, and in particular, to a container exception handling method, device, processor, and electronic apparatus.
Background
The container alarming technology in the related art is difficult to determine the state of the container in time, so that the abnormal state cannot be determined in time for processing.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a container exception handling method, a device, a processor and electronic equipment, which at least solve the technical problem that the container state is difficult to determine in time in the related technology, so that the exception state cannot be determined in time for handling.
According to an aspect of an embodiment of the present invention, there is provided a container exception handling method, including: receiving target heartbeat messages respectively sent by a plurality of containers in a target node; determining a target container set for sending the heartbeat messages according to target heartbeat messages respectively sent by a plurality of containers in the target node; comparing the target container set with a preset container set, and determining a cartoon container which does not send a heartbeat message in the target node; and under the condition that the heartbeat message sent by the jamming container is not received within a preset time period, the jamming information is sent to a preset terminal, wherein the jamming information carries an identification code corresponding to the jamming container.
Optionally, before comparing the target container set with a predetermined container set and determining a katon container in the target node that does not send a heartbeat message, the method further includes: receiving a registration new container request sent by a monitoring container in the target node, wherein the registration new container request is generated when the monitoring container monitors that a new container event occurs in the target node, and the registration new container request carries an identification code corresponding to the new container; and in response to the request for registering the newly added container, updating the initial container set to obtain a preset container set comprising the newly added container.
Optionally, before comparing the target container set with a predetermined container set and determining a katon container in the target node that does not send a heartbeat message, the method further includes: receiving a deregistration vanishing container request sent by a monitoring container in the target node, wherein the deregistration vanishing container request is generated when the monitoring container monitors that a vanishing container event occurs in the target node, and the deregistration vanishing container request carries an identification code corresponding to the vanishing container; and in response to the deregistration vanishing container request, updating the initial container set to obtain a preset container set with the vanishing container removed.
Optionally, before comparing the target container set with a predetermined container set and determining a katon container in the target node that does not send a heartbeat message, the method further includes: receiving a registration supplementary container request sent by a monitoring container in the target node, wherein the registration supplementary container request acquires a database container set and a real-time container set which are stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the database container set is a proper subset of the real-time container set, carries an identification code corresponding to a supplementary container, and the supplementary container is a container which is included in the real-time container set and is not included in the database container set; in response to the registration supplemental container request, the initial container set is updated to obtain a predetermined container set including the supplemental container.
Optionally, before comparing the target container set with a predetermined container set and determining a katon container in the target node that does not send a heartbeat message, the method further includes: receiving a de-registration release container request sent by a monitoring container in the target node, wherein the de-registration release container request acquires a database container set and a real-time container set which are stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the real-time container set is a proper subset of the database container set, and carries an identification code corresponding to a release container, wherein the release container is a container which is not included in the real-time container set and is included in the database container set; and in response to the de-registration release container request, updating the initial container set to obtain a predetermined container set from which the release container is removed.
Optionally, after determining the target container set for sending the heartbeat message according to the target heartbeat messages sent by the multiple containers in the target node, the method further includes: and determining container states corresponding to the containers in the target container set according to target heartbeat messages respectively sent by the containers in the target node.
Optionally, after sending the katon information to the predetermined terminal, if the heartbeat message sent by the katon container is not received within the predetermined time period, the method further includes: receiving a de-registration katon container request sent by the preset terminal, wherein the de-registration katon container request is generated when the preset terminal determines that the katon container is a fault container, and the de-registration katon container request carries an identification code corresponding to the katon container; and in response to the unregistered katon container request, updating the preset container set to obtain a container set with the katon container removed.
According to an aspect of an embodiment of the present invention, there is provided a container abnormality processing apparatus including: the receiving module is used for receiving target heartbeat messages respectively sent by a plurality of containers in the target node; the determining module is used for determining a target container set for sending the heartbeat messages according to the target heartbeat messages respectively sent by the containers in the target node; the comparison module is used for comparing the target container set with a preset container set and determining a cartoon container which does not send a heartbeat message in the target node; and the sending module is used for sending the jamming information to a preset terminal when the heartbeat message sent by the jamming container is not received within a preset time period, wherein the jamming information carries an identification code corresponding to the jamming container.
According to an aspect of an embodiment of the present invention, there is provided a processor, configured to execute a program, where the program executes any one of the above methods for processing container exceptions.
According to an aspect of an embodiment of the present invention, there is provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any one of the container exception handling methods described above.
In the embodiment of the invention, the target container set for sending the heartbeat messages is determined according to the target heartbeat messages sent by the containers in the target node respectively by receiving the target heartbeat messages sent by the containers in the target node, so that the target container set is compared with the preset container set, the cartoon container of the heartbeat messages which are not sent in the target node is determined, then the cartoon container is monitored again, and when the heart messages sent by the cartoon container are not received in the preset time period, the cartoon information comprising the corresponding identification code of the cartoon container is sent to the preset terminal, so that an operation and maintenance person using the preset terminal can process the cartoon abnormality in time, check the cartoon container state and process the cartoon container in time, and further the technical problem that the container state is difficult to be determined in time in the related technology, so that the abnormal state cannot be determined in time for processing is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a flow chart of a container exception handling method provided in accordance with an embodiment of the present application;
FIG. 2 is a block diagram of a container exception handling apparatus provided according to an embodiment of the present application;
fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party.
The present invention will be described with reference to preferred embodiments, and FIG. 1 is a flowchart of a method for handling container exceptions according to an embodiment of the present application, as shown in FIG. 1.
It should be first introduced that the method provided in the present application is applied to a scenario where a cluster includes a plurality of nodes, each node is further provided with one or more containers, and at least one monitoring container is included in the one or more containers, where the monitoring container is used to monitor a state of a node corresponding to the monitoring container, for example, a newly added container event, a disappeared container event, and so on may be monitored. The cluster is in turn connected to an application management controller AMC for monitoring the status of containers on nodes within the cluster by the method described below.
The following describes a method provided in an embodiment of the present application, including the following steps:
step S101, receiving target heartbeat messages respectively sent by a plurality of containers in a target node;
in step S101 provided in the present application, the target node refers to a node in a cluster, where a node includes a plurality of containers, and each container sends a target heartbeat packet. The heartbeat message may contain basic information of the container, such as the ID of the container, IP address, resource utilization, etc. By receiving heartbeat messages sent by a plurality of containers respectively, the running state of the containers can be monitored in real time, so that the containers can be processed and repaired in time when faults or anomalies occur.
Step S102, determining a target container set for sending heartbeat messages according to target heartbeat messages respectively sent by a plurality of containers in a target node;
in step S102 provided in the present application, according to the target heartbeat message, it can be determined which containers that have sent the heartbeat message on the target node are called a target container set.
It should be noted that, the heartbeat message may be obtained by accessing an http interface in the container or executing a specific script, which is not limited herein, and may be set in a customized manner according to an actual application and a scene, so long as the heartbeat message can be obtained.
Step S103, comparing the target container set with a preset container set, and determining a cartoon container which does not send a heartbeat message in the target node;
in step S103 provided in the present application, the predetermined container set is a set that has been previously stored by the application management controller AMC, and the predetermined container set represents all containers on the target node, so by comparing the target container set with the predetermined container set, it is possible to determine a container in the target node that does not send a heartbeat message, and this container is referred to as a katon container. I.e., indicating that the container may be abnormal, a determination of the state of the container is required to determine whether the container is in a stuck state or other state for corresponding processing.
Step S104, under the condition that the heartbeat message sent by the cartoon container is not received within the preset time period, the cartoon information is sent to the preset terminal, wherein the cartoon information carries the identification code corresponding to the cartoon container.
In step S104 provided in the present application, after determining the katon container, the katon container is monitored with emphasis, if the heartbeat message sent by the katon container is not received in a predetermined period of time, the abnormal state of the katon container is indicated, and intervention is required, so that the katon information carrying the identification code corresponding to the katon container is sent to the predetermined terminal, so that the predetermined terminal finds the katon container according to the identification code, and processes the katon container.
Through the steps, the target container set for sending the heartbeat messages is determined according to the target heartbeat messages respectively sent by the containers in the target node by receiving the target heartbeat messages respectively sent by the containers in the target node, so that the target container set is compared with the preset container set, the cartoon container of the heartbeat messages which are not sent in the target node is determined, then the cartoon container is monitored again, and when the heart messages sent by the cartoon container are not received in the preset time period, the cartoon information comprising the corresponding identification code of the cartoon container is sent to the preset terminal, so that an operation and maintenance person using the preset terminal can timely process the cartoon abnormality, check the cartoon container state and timely process the cartoon container, and further the technical problem that the container state is difficult to be determined timely in the related technology, so that the abnormal state cannot be timely determined for processing is solved.
As an optional embodiment, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a new container registration request sent by a monitoring container in a target node, wherein the new container registration request is generated when the monitoring container monitors that a new container event occurs in the target node, and the new container registration request carries an identification code corresponding to the new container; in response to a request to register a newly added container, the initial container set is updated to obtain a predetermined container set including the newly added container.
In this embodiment, it is described that, in the case that the monitoring container monitors that a new container event occurs in the target node, the monitoring container sends a registration new container request to the AMC, the AMC receives the registration new container request sent by the monitoring container, updates the initial container set according to the identification code corresponding to the new container carried in the registration new container request, and adds the new container to the initial container set to obtain a predetermined container set including the new container, so that the predetermined container set is updated in real time, and an accurate katon container result can be obtained after comparison.
As an optional embodiment, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a deregistration vanishing container request sent by a monitoring container in a target node, wherein the deregistration vanishing container request is generated when the monitoring container monitors that a vanishing container event occurs in the target node, and the deregistration vanishing container request carries an identification code corresponding to the vanishing container; in response to a deregistration vanishing container request, the initial container set is updated, resulting in a predetermined container set with vanishing containers removed.
In this embodiment, it is described that, in the case that the monitoring container monitors that the vanishing container event occurs in the target node, the monitoring container sends a deregistration message container request to the AMC, the AMC receives the deregistration vanishing container request sent by the monitoring container, updates the initial container set according to the identifier code corresponding to the vanishing container carried in the deregistration vanishing container request, deletes the vanishing container from the initial container set, and obtains the predetermined container set from which the vanishing container is removed, so that the predetermined container set is updated in real time, and an accurate katon container result can be obtained after comparison.
As an optional embodiment, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a registration supplementary container request sent by a monitoring container in a target node, wherein the registration supplementary container request acquires a database container set and a real-time container set stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the database container set is a proper subset of the real-time container set, and carries an identification code corresponding to the supplementary container, wherein the supplementary container is a container which is included in the real-time container set and is not included in the database container set; in response to registering the supplemental container request, the initial container set is updated to obtain a predetermined container set including the supplemental container.
In this embodiment, the monitoring container obtains a database container set and a real-time container set stored in the database, and it should be noted that the database container set is consistent with the containers in the predetermined container set, so it may be determined whether the predetermined container set is faulty by comparing the database container set with the real-time container set. The real-time container set can call the corresponding interface to obtain. In case the database container set is a proper subset of the real-time container set, it is explained that there is no container actually present in AMC, so the monitoring container sends a registration supplementary container request to AMC, AMC receives the registration supplementary container request sent by the monitoring container, updates the initial container set according to the identification code corresponding to the supplementary container carried in the registration supplementary container request, and adds the supplementary container to the initial container set, so as to obtain a predetermined container set including the supplementary container, so that the predetermined container set is corrected, and an accurate katon container result can be obtained after comparison.
As an optional embodiment, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a de-registration release container request sent by a monitoring container in a target node, wherein the de-registration release container request is generated when the monitoring container acquires a database container set and a real-time container set stored in a database and the database container set are compared with each other and the real-time container set is a proper subset of the database container set, and the de-registration release container request carries an identification code corresponding to the release container, and the release container is a container which is not included in the real-time container set and is included in the database container set; in response to a de-registering the release container request, the initial container set is updated to obtain a predetermined container set with release containers removed.
In this embodiment, the monitoring container obtains a database container set and a real-time container set stored in the database, and it should be noted that the database container set is consistent with the containers in the predetermined container set, so it may be determined whether the predetermined container set is faulty by comparing the database container set with the real-time container set. The real-time container set can call the corresponding interface to obtain. Under the condition that the real-time container set is a proper subset of the database container set, the fact that the container which does not exist actually is recorded in the AMC is described, the monitoring container sends a deregistration release container request to the AMC, the AMC receives the deregistration release container request sent by the monitoring container, the initial container set is updated according to the identification code corresponding to the release container carried in the deregistration release container request, the release container is deleted from the initial container set, the preset container set with the release container removed is obtained, the preset container set is corrected, and an accurate katon container result can be obtained after comparison.
As an optional embodiment, after determining the target container set for sending the heartbeat message according to the target heartbeat messages sent by the multiple containers in the target node respectively, the method further includes: and determining the container states corresponding to the containers in the target container set respectively according to the target heartbeat messages respectively sent by the containers in the target node.
In this embodiment, the container state of a container can also be determined by target heartbeat messages transmitted by a plurality of containers, respectively. Because the target heartbeat message comprises various information, the container states respectively corresponding to the containers can be determined through a series of information contained in the target heartbeat message.
As an optional embodiment, after sending the katon information to the predetermined terminal, if the heartbeat message sent by the katon container is not received within the predetermined period of time, the method further includes: receiving a de-registration katon container request sent by a preset terminal, wherein the de-registration katon container request is generated under the condition that the preset terminal determines that a katon container is a fault container, and the de-registration katon container request carries an identification code corresponding to the katon container; in response to a de-registration katon container request, updating the predetermined container set to obtain a container set with the katon container removed.
In this embodiment, feedback from the intended terminal is also received after the katon information is sent to the intended terminal. Under the condition that the preset terminal determines that the katon container is faulty, the container is determined to be the faulty container, a de-registration katon request is sent to the AMC, the AMC receives the de-registration katon container request, and updates a preset container set to obtain a container set with the katon container removed, so that the container set after the katon container is removed is used for comparison operation in the process of executing the method later.
Based on the foregoing embodiments and optional embodiments, an optional implementation is provided, and is specifically described below.
The invention provides a container fault processing method in an alternative embodiment, which not only monitors the starting and death states of a container, but also tracks heartbeat messages on the container, and generally, the uploading of the heartbeat messages is from deep health inspection in the container, so that whether the state of the container is normal can be effectively detected.
When a container is newly added in a target node of the cluster, a new container event, also called a container start event, is triggered, and after an event monitor (the monitoring node) monitors the container start event, a registration request is sent to the AMC, specifically, the registration request may be called a registration new container request, where a new container id (the identification code is the same as the identification code) is included in the registration new container request, which is the unique identification of the container. AMC will then begin to pay attention to the health of this container.
The container concerned by the AMC in the cluster can continuously send the heartbeat message to the AMC, if the AMC does not receive the heartbeat message within a preset time period, such as ten minutes, the AMC can send the cartoon information to a preset terminal, for example, a disconnection alarm can be sent to an operation and maintenance personnel using the preset terminal, so that the operation and maintenance personnel can intervene in time for processing, and the container is convenient and quick to process.
When there is a container death (or a container may disappear) in the target node of the cluster, the cluster may release a container death event, after the eventmonitor monitors the container death event, the eventmonitor may issue a deregistration request, which may be specifically referred to as a deregistration disappearing container request, and the AMC may not pay attention to the container. It should be noted that, after the container death event is monitored, it is determined whether the container death is a death caused by unified scheduling of the cluster, that is, whether the container death is a death caused by manual operation or a system specified process, where the manual operation may include an operation and maintenance person upgrading or dropping the container. If the death caused by the unified dispatching of the clusters is not detected, the restarting operation of the container can be carried out, and the restarting alarm of the container is sent to the preset terminal, so that operation and maintenance personnel using the preset terminal intervene in the process. Because there are many causes of death, such as internal errors of the application, in cases where death is not caused by cluster unified scheduling: the bug or abnormal situation exists in the application program code, which causes the container process to crash or stop running, or is a resource limitation, the resources required by the container exceed the allocated limitation, the container is forced to be terminated by the system, and the like, and specific analysis of specific reasons and intervention of operation and maintenance personnel are required.
The Eventmonitor can also be connected with a persistent file storage system hdfs, and after the container is restarted, the container progress log reserved on the target node is sent to the hdfs to facilitate the downloading analysis of operation and maintenance personnel. Without downloading, the system would periodically clean the container log, which would be inconvenient to analyze the problem.
The Eventmonitor also records the historical state of the container, the starting time, the death time, the allocation node, the cluster, the death reason to the database, and the operation and maintenance personnel can analyze the restarting record of the container conveniently and summarize the restarting reason.
The Eventmonitor compares the container (same as the database container set) already recorded in the database with the container (same as the real-time container set) existing on the host machine, and if the container existing on the host machine in real time does not exist in the database, the Eventmonitor supplements the record to the database and sends a request for registering the supplement container to the AMC. If the container identified as surviving in the database is not on the current host, it will identify that the status of this container in the database is dead and send a de-registration release container request to the AMC.
By the alternative embodiments, at least the following advantages can be achieved:
(1) The problems that in the related art, the container is alive but the process is blocked and the like, and the state of the container cannot be simply inquired to give an alarm in time are solved;
(2) The problems that the history information and the abnormal log of the container cannot be recorded in the related technology and the problem is inconvenient to check are solved;
(3) The container is automatically accessed to the alarm mechanism without special configuration rules.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
According to an embodiment of the present invention, there is further provided an apparatus for implementing the above method for processing a container exception, and fig. 2 is a block diagram of a structure of the apparatus for processing a container exception provided according to an embodiment of the present application, as shown in fig. 2, where the apparatus includes: the receiving module 201, the determining module 202, the comparing module 203 and the transmitting module 204 are described in detail below.
A receiving module 201, configured to receive target heartbeat messages sent by a plurality of containers in a target node respectively; a determining module 202, coupled to the receiving module 201, configured to determine a target container set for sending the heartbeat message according to target heartbeat messages sent by multiple containers in the target node respectively; the comparison module 203 is connected to the determination module 202, and is configured to compare the target container set with a predetermined container set, and determine a cartoon container in the target node, where the heart beat message is not sent; and the sending module 204 is connected to the comparing module 203, and is configured to send the katon information to the predetermined terminal when the katon container sends the heartbeat message in a predetermined period of time, where the katon information carries an identification code corresponding to the katon container.
Here, the above-mentioned receiving module 201, determining module 202, comparing module 203 and transmitting module 204 correspond to steps S101 to S106 in implementing the container exception handling method, and a plurality of modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the above-mentioned embodiments.
According to the container exception handling device provided by the embodiment of the application, the target heartbeat messages sent by the containers in the target node are received, the target container set for sending the heartbeat messages is determined according to the target heartbeat messages sent by the containers in the target node, so that the target container set is compared with the preset container set, the katon container of the heartbeat messages which are not sent in the target node is determined, then the katon container is monitored again, and under the condition that the katon container sent heartbeat messages are not received in the preset time period, the katon information comprising the corresponding identification code of the katon container is sent to the preset terminal, so that operation and maintenance personnel using the preset terminal can process the katon exception in time, check the state of the katon container and process the katon container in time, and further the technical problems that the container state is difficult to be determined in time in the related technology, and the exception state cannot be determined in time are solved.
The container abnormality processing device includes a processor and a memory, the plurality of modules and the like are stored as program units in the memory, and the processor executes the program units stored in the memory to realize the corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and the technical problem that the state of the container is difficult to be determined in time in the related technology, so that the abnormal state cannot be determined in time for processing is solved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a computer readable storage medium, on which a program is stored, which when executed by a processor, implements a container exception handling method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program runs to execute a container exception handling method.
Fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 3, the embodiment of the present invention provides an electronic device, where the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: receiving target heartbeat messages respectively sent by a plurality of containers in a target node; determining a target container set for sending the heartbeat message according to target heartbeat messages respectively sent by a plurality of containers in the target node; comparing the target container set with a preset container set, and determining a cartoon container which does not send a heartbeat message in the target node; and under the condition that the heartbeat message sent by the jamming container is not received within the preset time period, the jamming information is sent to the preset terminal, wherein the jamming information carries the identification code corresponding to the jamming container.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a new container registration request sent by a monitoring container in a target node, wherein the new container registration request is generated when the monitoring container monitors that a new container event occurs in the target node, and the new container registration request carries an identification code corresponding to the new container; in response to a request to register a newly added container, the initial container set is updated to obtain a predetermined container set including the newly added container.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a deregistration vanishing container request sent by a monitoring container in a target node, wherein the deregistration vanishing container request is generated when the monitoring container monitors that a vanishing container event occurs in the target node, and the deregistration vanishing container request carries an identification code corresponding to the vanishing container; in response to a deregistration vanishing container request, the initial container set is updated, resulting in a predetermined container set with vanishing containers removed.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a registration supplementary container request sent by a monitoring container in a target node, wherein the registration supplementary container request acquires a database container set and a real-time container set stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the database container set is a proper subset of the real-time container set, and carries an identification code corresponding to the supplementary container, wherein the supplementary container is a container which is included in the real-time container set and is not included in the database container set; in response to registering the supplemental container request, the initial container set is updated to obtain a predetermined container set including the supplemental container.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a de-registration release container request sent by a monitoring container in a target node, wherein the de-registration release container request is generated when the monitoring container acquires a database container set and a real-time container set stored in a database and the database container set are compared with each other and the real-time container set is a proper subset of the database container set, and the de-registration release container request carries an identification code corresponding to the release container, and the release container is a container which is not included in the real-time container set and is included in the database container set; in response to a de-registering the release container request, the initial container set is updated to obtain a predetermined container set with release containers removed.
Optionally, after determining the target container set for sending the heartbeat message according to the target heartbeat messages sent by the multiple containers in the target node respectively, the method further includes: and determining the container states corresponding to the containers in the target container set respectively according to the target heartbeat messages respectively sent by the containers in the target node.
Optionally, after sending the katon information to the predetermined terminal, if the heartbeat message sent by the katon container is not received within the predetermined time period, the method further includes: receiving a de-registration katon container request sent by a preset terminal, wherein the de-registration katon container request is generated under the condition that the preset terminal determines that a katon container is a fault container, and the de-registration katon container request carries an identification code corresponding to the katon container; in response to a de-registration katon container request, updating the predetermined container set to obtain a container set with the katon container removed.
The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: receiving target heartbeat messages respectively sent by a plurality of containers in a target node; determining a target container set for sending the heartbeat message according to target heartbeat messages respectively sent by a plurality of containers in the target node; comparing the target container set with a preset container set, and determining a cartoon container which does not send a heartbeat message in the target node; and under the condition that the heartbeat message sent by the jamming container is not received within the preset time period, the jamming information is sent to the preset terminal, wherein the jamming information carries the identification code corresponding to the jamming container.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a new container registration request sent by a monitoring container in a target node, wherein the new container registration request is generated when the monitoring container monitors that a new container event occurs in the target node, and the new container registration request carries an identification code corresponding to the new container; in response to a request to register a newly added container, the initial container set is updated to obtain a predetermined container set including the newly added container.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a deregistration vanishing container request sent by a monitoring container in a target node, wherein the deregistration vanishing container request is generated when the monitoring container monitors that a vanishing container event occurs in the target node, and the deregistration vanishing container request carries an identification code corresponding to the vanishing container; in response to a deregistration vanishing container request, the initial container set is updated, resulting in a predetermined container set with vanishing containers removed.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a registration supplementary container request sent by a monitoring container in a target node, wherein the registration supplementary container request acquires a database container set and a real-time container set stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the database container set is a proper subset of the real-time container set, and carries an identification code corresponding to the supplementary container, wherein the supplementary container is a container which is included in the real-time container set and is not included in the database container set; in response to registering the supplemental container request, the initial container set is updated to obtain a predetermined container set including the supplemental container.
Optionally, before comparing the target container set with the predetermined container set and determining the katon container in the target node that does not send the heartbeat message, the method further includes: receiving a de-registration release container request sent by a monitoring container in a target node, wherein the de-registration release container request is generated when the monitoring container acquires a database container set and a real-time container set stored in a database and the database container set are compared with each other and the real-time container set is a proper subset of the database container set, and the de-registration release container request carries an identification code corresponding to the release container, and the release container is a container which is not included in the real-time container set and is included in the database container set; in response to a de-registering the release container request, the initial container set is updated to obtain a predetermined container set with release containers removed.
Optionally, after determining the target container set for sending the heartbeat message according to the target heartbeat messages sent by the multiple containers in the target node respectively, the method further includes: and determining the container states corresponding to the containers in the target container set respectively according to the target heartbeat messages respectively sent by the containers in the target node.
Optionally, after sending the katon information to the predetermined terminal, if the heartbeat message sent by the katon container is not received within the predetermined time period, the method further includes: receiving a de-registration katon container request sent by a preset terminal, wherein the de-registration katon container request is generated under the condition that the preset terminal determines that a katon container is a fault container, and the de-registration katon container request carries an identification code corresponding to the katon container; in response to a de-registration katon container request, updating the predetermined container set to obtain a container set with the katon container removed.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A container exception handling method, comprising:
receiving target heartbeat messages respectively sent by a plurality of containers in a target node;
determining a target container set for sending the heartbeat messages according to target heartbeat messages respectively sent by a plurality of containers in the target node;
comparing the target container set with a preset container set, and determining a cartoon container which does not send a heartbeat message in the target node;
and under the condition that the heartbeat message sent by the jamming container is not received within a preset time period, the jamming information is sent to a preset terminal, wherein the jamming information carries an identification code corresponding to the jamming container.
2. The method of claim 1, wherein the comparing the set of target containers to a set of predetermined containers, before determining a cartoon container in the target node that does not send a heartbeat message, further comprises:
receiving a registration new container request sent by a monitoring container in the target node, wherein the registration new container request is generated when the monitoring container monitors that a new container event occurs in the target node, and the registration new container request carries an identification code corresponding to the new container;
And in response to the request for registering the newly added container, updating the initial container set to obtain a preset container set comprising the newly added container.
3. The method of claim 1, wherein the comparing the set of target containers to a set of predetermined containers, before determining a cartoon container in the target node that does not send a heartbeat message, further comprises:
receiving a deregistration vanishing container request sent by a monitoring container in the target node, wherein the deregistration vanishing container request is generated when the monitoring container monitors that a vanishing container event occurs in the target node, and the deregistration vanishing container request carries an identification code corresponding to the vanishing container;
and in response to the deregistration vanishing container request, updating the initial container set to obtain a preset container set with the vanishing container removed.
4. The method of claim 1, wherein the comparing the set of target containers to a set of predetermined containers, before determining a cartoon container in the target node that does not send a heartbeat message, further comprises:
receiving a registration supplementary container request sent by a monitoring container in the target node, wherein the registration supplementary container request acquires a database container set and a real-time container set which are stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the database container set is a proper subset of the real-time container set, carries an identification code corresponding to a supplementary container, and the supplementary container is a container which is included in the real-time container set and is not included in the database container set;
In response to the registration supplemental container request, the initial container set is updated to obtain a predetermined container set including the supplemental container.
5. The method of claim 1, wherein the comparing the set of target containers to a set of predetermined containers, before determining a cartoon container in the target node that does not send a heartbeat message, further comprises:
receiving a de-registration release container request sent by a monitoring container in the target node, wherein the de-registration release container request acquires a database container set and a real-time container set which are stored in a database for the monitoring container, compares the database container set with the real-time container set, is generated under the condition that the real-time container set is a proper subset of the database container set, and carries an identification code corresponding to a release container, wherein the release container is a container which is not included in the real-time container set and is included in the database container set;
and in response to the de-registration release container request, updating the initial container set to obtain a predetermined container set from which the release container is removed.
6. The method according to claim 1, wherein after determining the target container set for sending the heartbeat message according to the target heartbeat messages sent by the plurality of containers in the target node, the method further comprises:
And determining container states corresponding to the containers in the target container set according to target heartbeat messages respectively sent by the containers in the target node.
7. The method according to any one of claims 1 to 6, wherein, after the step of sending the katon information to the predetermined terminal if the heartbeat message sent by the katon container is not received within the predetermined period of time, the method further comprises:
receiving a de-registration katon container request sent by the preset terminal, wherein the de-registration katon container request is generated when the preset terminal determines that the katon container is a fault container, and the de-registration katon container request carries an identification code corresponding to the katon container;
and in response to the unregistered katon container request, updating the preset container set to obtain a container set with the katon container removed.
8. A container abnormality processing apparatus, comprising:
the receiving module is used for receiving target heartbeat messages respectively sent by a plurality of containers in the target node;
the determining module is used for determining a target container set for sending the heartbeat messages according to the target heartbeat messages respectively sent by the containers in the target node;
The comparison module is used for comparing the target container set with a preset container set and determining a cartoon container which does not send a heartbeat message in the target node;
and the sending module is used for sending the jamming information to a preset terminal when the heartbeat message sent by the jamming container is not received within a preset time period, wherein the jamming information carries an identification code corresponding to the jamming container.
9. A processor for running a program, wherein the program runs on performing the container exception handling method according to any one of claims 1 to 7.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the container exception handling method of any of claims 1 to 7.
CN202310336374.XA 2023-03-30 2023-03-30 Container exception handling method and device, processor and electronic equipment Pending CN116366508A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310336374.XA CN116366508A (en) 2023-03-30 2023-03-30 Container exception handling method and device, processor and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310336374.XA CN116366508A (en) 2023-03-30 2023-03-30 Container exception handling method and device, processor and electronic equipment

Publications (1)

Publication Number Publication Date
CN116366508A true CN116366508A (en) 2023-06-30

Family

ID=86941533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310336374.XA Pending CN116366508A (en) 2023-03-30 2023-03-30 Container exception handling method and device, processor and electronic equipment

Country Status (1)

Country Link
CN (1) CN116366508A (en)

Similar Documents

Publication Publication Date Title
US10152382B2 (en) Method and system for monitoring virtual machine cluster
CN111324423B (en) Method and device for monitoring processes in container, storage medium and computer equipment
CN106936622A (en) A kind of distributed memory system upgrade method and device
US8694835B2 (en) System health monitoring
CN108038039B (en) Method for recording log and micro-service system
CN102761432B (en) CGI method for supervising and device thereof and system
CN110858166A (en) Application exception processing method and device, storage medium and processor
CN105975384B (en) The monitoring method and device of distributed process
CN113608982A (en) Function execution performance monitoring method and device, computer equipment and storage medium
CN114691445A (en) Cluster fault processing method and device, electronic equipment and readable storage medium
CN116366508A (en) Container exception handling method and device, processor and electronic equipment
US20200305300A1 (en) Method for remotely clearing abnormal status of racks applied in data center
CN115756888A (en) Data processing method, processor, device and storage medium
CN115687036A (en) Log collection method and device and log system
CN110955579A (en) Ambari-based large data platform monitoring method
CN111756778A (en) Server disk cleaning script pushing method and device and storage medium
CN110597603A (en) Scheduling method and system of distributed scheduling tasks
CN115604135B (en) Service monitoring method and device
US11954693B2 (en) Dynamic test suite creation using event communications from customers
CN115426247B (en) Fault node processing method and device, storage medium and electronic equipment
CN116954975A (en) Fault processing method, system and device for software product and storage medium
CN109428914B (en) Monitoring method and device, storage medium and processor
CN117493120A (en) Running state monitoring method and device, electronic equipment and storage medium
CN116303399A (en) Data monitoring method, system, device and storage medium
CN116860554A (en) Container monitoring method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination