CN114979132A - Cluster component state detection method and device - Google Patents

Cluster component state detection method and device Download PDF

Info

Publication number
CN114979132A
CN114979132A CN202210383471.XA CN202210383471A CN114979132A CN 114979132 A CN114979132 A CN 114979132A CN 202210383471 A CN202210383471 A CN 202210383471A CN 114979132 A CN114979132 A CN 114979132A
Authority
CN
China
Prior art keywords
task
detection
task description
component
description file
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.)
Granted
Application number
CN202210383471.XA
Other languages
Chinese (zh)
Other versions
CN114979132B (en
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210383471.XA priority Critical patent/CN114979132B/en
Priority claimed from CN202210383471.XA external-priority patent/CN114979132B/en
Publication of CN114979132A publication Critical patent/CN114979132A/en
Application granted granted Critical
Publication of CN114979132B publication Critical patent/CN114979132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a cluster component state detection method and device, and relates to the technical field of cloud services. One embodiment of the method comprises: responding to the monitoring of the creation or the update of the task description file, and judging whether a task creation event is triggered or not; if yes, acquiring a plurality of task description contents of a task list in the task description file, wherein each task description content indicates a component to be tested; creating a detection task according to the task description content so as to detect the component to be detected corresponding to the task description content; acquiring a detection result of a component to be detected corresponding to the task description content, and updating the task description file according to the detection result; otherwise, no detection task is created. The embodiment monitors the creation or update of the task description file to determine whether to create the detection task, so that the running state of the component can be actively sensed, and the integration cost and the maintenance cost are low.

Description

Cluster component state detection method and device
Technical Field
The invention relates to the technical field of cloud services, in particular to a cluster component state detection method and device.
Background
With the development of cloud services, more and more services or components run on a cloud platform, and therefore, the running state of the services or components on the cloud platform needs to be detected and monitored.
In the prior art, the operating state of a service or a component is monitored and detected by Prometheus (a set of source-open monitoring & alarm & time sequence database combination) and a corresponding exporter (an application providing a monitoring data source for Prometheus), but the detection and monitoring mode needs to rely on additional database storage and has high integration cost, and the sensing and reporting of the operating state of the service or the component cannot actively sense the operating state of the service or the component after a fault occurs.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for detecting a cluster component state, which can actively sense an operating state of a component, do not need additional integration, do not depend on third-party storage, and have low integration cost and low maintenance cost.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for cluster component status detection, including:
responding to the monitoring of the creation or the update of the task description file, and judging whether a task creation event is triggered or not;
if yes, acquiring a plurality of task description contents of a task list in the task description file, wherein each task description content indicates a component to be tested; creating a detection task according to the task description content so as to detect the component to be detected corresponding to the task description content; acquiring a detection result of a component to be detected corresponding to the task description content, and updating the task description file according to the detection result;
otherwise, no detection task is created.
Optionally, the determining whether to trigger the detection task creation event includes:
and judging whether the value of the identity field of the task description file is changed, if so, triggering the detection task creating event, otherwise, not triggering the detection task creating event.
Optionally, creating a detection task according to the task description content includes:
judging whether the value of the execution mode field of the task description file is null or not;
if yes, converting each task description content in the task list into a detection task executed once respectively;
if not, converting the task description content in the task list into a detection task which is executed circularly.
Optionally, after obtaining the detection result of the component to be detected corresponding to the task description content, the method includes: and judging whether the detection result indicates abnormal state or not, and calling alarm service under the condition that the detection result indicates abnormal state.
Optionally, before invoking the alert service, comprising:
determining that the number of times of the state abnormity exceeds a preset threshold value; otherwise, the alert service is not invoked.
Optionally, the task description file is implemented by a custom mirror.
Optionally, the method comprises:
and when the detection task creating event is not triggered, acquiring a detection result of the created detection task, and updating the task description file corresponding to the created detection task according to the detection result of the created detection task.
According to another aspect of the embodiments of the present invention, an apparatus for cluster component status detection includes:
the judging module is used for responding to the monitoring of the creation or the update of the task description file and judging whether a task creation event is triggered or not;
the execution module is used for acquiring a plurality of task description contents of a task list in the task description file when a task creating event is triggered and detected, wherein each task description content indicates a component to be detected; creating a detection task according to the task description content so as to detect the component to be detected corresponding to the task description content; acquiring a detection result of a component to be detected corresponding to the task description content, and updating the task description file according to the detection result; when the detection task creation event is not triggered, the detection task is not created.
According to another aspect of an embodiment of the present invention, there is provided an electronic apparatus including:
one or more processors;
a storage device to store one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for cluster component state detection provided by the present invention.
According to a further aspect of the embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method for cluster component status detection provided by the present invention.
One embodiment of the above invention has the following advantages or benefits: the embodiment of the invention judges whether a detection task creation event is triggered or not by monitoring the creation or updating of the task description file, creates a detection task according to the task description content of the task list in the task description file after the detection task creation event is triggered, and acquires the detection result of the detection task on the component to be detected, thereby realizing the detection of the cluster component state, such as the detection of the K8s cluster component state. The method can actively sense the state abnormity of the assembly, does not need additional integration, does not depend on third-party storage, and has low integration cost and low maintenance cost.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of cluster component status detection according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a main flow of another method of cluster component status detection according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a main flow of a further method of cluster component status detection according to an embodiment of the invention;
FIG. 4 is a flow chart illustrating a method for cluster component status detection according to an embodiment of the present invention;
FIG. 5 is a schematic timing diagram illustrating a method for cluster component status detection according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the main modules of an apparatus for cluster component status detection according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method for cluster component status detection according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101: in response to listening to the creation or update of the task description file,
step S102: judging whether a detection task creating event is triggered or not; if not, executing step S103, if yes, executing step S104;
step S103: no detection task is created;
step S104: acquiring a plurality of task description contents of a task list in a task description file, wherein each task description content indicates a component to be tested;
step S105: creating a detection task according to task description content to detect a component to be detected corresponding to the task description content;
step S106: and acquiring a detection result of the component to be detected corresponding to the task description content, and updating the task description file according to the detection result.
In the embodiment of the invention, attributes of the detection tasks (probe) are described in the task description file (probe-descriptor), such as time intervals of execution of the detection tasks, images of execution of the detection tasks, parameters of execution of the detection tasks and the like, and the task description file can be converted into kubernets (K8s, open source container orchestration engine) resources by parsing the task description file to create the detection tasks in the K8s cluster. The task description file can be a yaml (markup language) format file, and readability is good.
The user can custom write the task description file and create the resource in the K8s cluster. The task description file comprises a task list (probeList), the task list comprises a plurality of task description contents, each task description content is used for describing each detection task, namely the task list describes a set of detection tasks, each task description content indicates a component to be detected, each task description content can obtain a corresponding K8s resource by analyzing each task description content, and the detection tasks are created in a K8s cluster. The component to be tested may be a component based on a K8s cluster, such as a DNS server (domain name server), a POD (minimal resource management component in kubernets), and the like.
The creation of the task description file may be adding a new task description file, and the updating of the task description file may be updating of a task list in the task description file, and specifically, the updating of the task list may be adding or deleting one or more task description contents.
The task description file includes an execution mode field (policy) for describing whether the execution mode of the detection task is single execution or loop execution. The task description file also comprises an identity field, and when the value of the identity field is changed, the task description file is updated.
Monitoring creation or update of a task description file in a list-watch (asynchronous message passing mode in K8 s) mode to judge whether a detection task creation event is triggered, optionally, judging whether a detection task creation event is triggered by judging whether a value of an identity field (md5) of the task description file is changed, and if the value of the identity field is changed, triggering the detection task creation event; if the value of the identity field has not changed, then no detection task creation event is triggered.
Optionally, whether to trigger the detection task creation event may also be determined by whether the task list is changed, and if the task description content in the task list is changed, the detection task creation event is triggered; and if the task description content in the task list is not changed, not triggering the detection task creating event.
Alternatively, the value of the identity field is updated based on a change in the task description content in the task list, i.e., when the task description content in the task list is changed, the value of the identity field is updated.
And after the detection task creation event is triggered, executing a creation process of the detection task, acquiring a plurality of task description contents of the task list in the task description file, creating the detection task according to each task description content, and detecting the running state of the component to be detected by using the created detection task.
In this embodiment of the present invention, as shown in fig. 2, in step S104, creating a detection task according to task description content includes:
step S201: acquiring the value of an execution mode field of a task description file;
s202: judging whether the value of the execution mode field of the task description file is null or not; if yes, go to step S203; if not, executing step S204;
step S203: respectively converting the description content of each task in the task list into a detection task executed once;
step S204: and respectively converting the description content of each task in the task list into a detection task which is executed circularly.
In the embodiment of the invention, when a detection task is created by using task description content, the value of an execution mode field is firstly obtained, whether the value of the execution mode field is null or not is judged, and if the value of the execution mode field is null, the execution mode is indicated to be single execution; if not, the execution mode is the loop execution, and the value of the execution mode field is the time interval of the loop execution, i.e. the interval duration of the timing execution. Therefore, each task description content in the task list is converted into a detection task in a different execution mode, namely each task description content is converted into a detection task (joba) which is executed once, or each task description content is converted into a detection task (cornjoba) which is executed circularly. And the detection task executed once, such as a detection task for detecting whether DNS server analysis is normal or not, and the detection task executed circularly, such as whether POD can be normally created or not.
In the embodiment of the invention, after the detection result of the component to be detected corresponding to the task description content is obtained, whether the detection result indicates abnormal state or not is judged, and the alarm service is called under the condition that the detection result indicates abnormal state.
In the embodiment of the present invention, as shown in fig. 3, after creating the detection task according to the task description content, the method further includes:
step S301: acquiring a detection result of the component to be detected corresponding to the task description content;
step S302: judging whether the detection result indicates that the state of the component to be detected is abnormal or not; if yes, go to step S303; if not, ending the flow;
step S303: judging whether the number of times of state abnormity exceeds a preset threshold value, if so, executing a step S304, and if not, executing a step S301;
step S304: and calling the alarm service and ending the process.
When the detection result of the detection task on the component to be detected is obtained, the detection result can be obtained by starting the timing task to scan the detection task at regular time, so as to judge whether the detection result indicates that the state of the component to be detected corresponding to the task description content is abnormal; if the state of the component to be tested is not abnormal, ending the process; the timing scan may also continue. If the state of the component to be detected is abnormal, calling an alarm service, or continuing to scan at regular time, and when the number of times of detecting the state is abnormal exceeds a preset threshold value, calling the alarm service.
In the embodiment of the present invention, the detection result of the component to be detected corresponding to the task description content may also be obtained from the updated task description file.
In the embodiment of the present invention, after the detection result of the component to be detected corresponding to the task description content is obtained, the detection result is updated into the task description file, optionally, the task description file includes a detection result field corresponding to the detection task, and the state of the component to be detected, which is obtained by detecting the detection task, can be obtained by scanning the value of the detection result field. For each task description file, scanning the detection result of the detection task corresponding to the task description file, and enabling the timing task to perform timing scanning to judge whether the detection result is abnormal. And when the detection result indicates that the state of the component to be detected is abnormal, calling an alarm service to alarm. Or when the number of times of detecting the abnormity of the component to be detected exceeds a preset threshold value, calling an alarm service to alarm. Wherein the alert service may be provided by any third party alert module.
In the embodiment of the invention, the task description file can be realized in a self-defined mirror image mode so as to execute the detection task. The mirror images are system environment templates, and each mirror image comprises an executable program. The task description file can be added or updated by self in a self-defined mirror image mode to detect or detect the state of the cluster component. Wherein the custom image complies with the following specification: the task description content is in a detection mode, for example, whether DNS analysis is normal or not is detected, and whether a Pod can be normally created or not is detected; if the execution mode of the detection task is the timing cycle execution, the detection task is realized through an execution mode field; and ensuring that the detection result can be updated into the identity field of the task description file, and reading the parameters in the task description content from the environment variables.
In the embodiment of the invention, when the detection task creating event is not triggered, the detection result of the created detection task is obtained, and the task description file corresponding to the created detection task is updated according to the detection result of the created detection task. When the event for creating the detection task is not triggered, the detection result of the created detection task can be obtained at regular time so as to update the task description file; and the detection result in the task description file can be continuously scanned to judge whether the state of the component to be detected is abnormal or not, or the number of times of detecting the abnormal state exceeds a preset threshold value, and then the alarm service is called.
Fig. 4 is a flowchart illustrating a method for detecting a status of a cluster component according to an embodiment of the present invention. The method comprises the following steps:
step S401: monitoring the creation or update of the task description file, judging whether md5 changes, if so, executing step S402, and if not, executing step S406;
step S402: judging whether the value of the execution mode field is empty, if so, executing step S403, otherwise, executing step S404;
step S403: converting each task description content in the task list into a detection task executed once;
step S404: converting each task description content in the task list into a detection task which is executed circularly;
step S405: acquiring a detection result of a detection task;
step S406: judging whether the detection result of the detection task indicates that the state of the component to be detected is abnormal or not; if yes, go to step S407, otherwise, end the process;
step S407: judging whether the number of times of detecting the state abnormality of the component to be detected exceeds a preset threshold value, if so, executing step S408, and if not, executing step S405;
step S408: an alert service is invoked.
Fig. 5 is a timing diagram illustrating a method for cluster component status detection according to an embodiment of the invention. The method for detecting the state of the cluster component is executed by a probe module, a user adds probe task description content to a task list of a task description file probe-descriptor, the task description file is updated and notified to the probe module, the probe module converts the task description content into a probe task, namely, a detection task is created in a K8s cluster, the detection task returns a detection result and updates the task description file, whether an alarm service is called or not is judged according to the detection result, if the detection result indicates that the state of the component to be detected is abnormal, the alarm service is called, and the alarm module alarms the user to notify the user of the fault of the component to be detected. The probe module continuously scans the task description file to obtain a detection result, and when the detection result indicates that the component to be detected is abnormal, the alarm module is called to give an alarm.
The method for detecting the state of the cluster component provided by the embodiment of the invention judges whether to establish the detection task or not by monitoring the establishment or the update of the task description file so as to obtain the detection result of the detection task on the state of the component to be detected. The method is a detection type user-defined K8s cluster component availability detection method, and a user can write a task description file in a simple user-defined mirror image mode, so that the detection capability is integrated into the detection process, additional integration is not needed, and the integration cost is low; the method does not depend on third-party storage, and is low in maintenance cost; the method can actively sense the abnormity of the component and achieve the purpose of alarming, and can acquire the running state of the component before use and timely process faults.
As shown in fig. 6, according to still another aspect of the embodiment of the present invention, there is provided an apparatus 600 for cluster component status detection, including:
the judging module 601, responding to the creation or update of the monitored task description file, judging whether to trigger a detection task creation event;
the execution module 602, when a detection task creation event is triggered, obtains a plurality of task description contents of a task list in a task description file, wherein each task description content indicates a component to be detected; creating a detection task according to the task description content so as to detect the component to be detected corresponding to the task description content; acquiring a detection result of the component to be detected corresponding to the task description content, and updating the task description file according to the detection result; when the detection task creation event is not triggered, the detection task is not created.
In this embodiment of the present invention, the determining module 601 is further configured to: and judging whether the value of the identity field of the task description file is changed, if so, triggering a detection task creating event, otherwise, not triggering the detection task creating event.
In this embodiment of the present invention, the executing module 602 is further configured to: judging whether the value of the execution mode field of the task description file is null or not; if yes, converting the description content of each task in the task list into a detection task executed once respectively; if not, converting the description content of each task in the task list into a detection task which is executed circularly.
In this embodiment of the present invention, the executing module 602 is further configured to: and after the detection result of the component to be detected corresponding to the task description content is obtained, judging whether the detection result indicates abnormal state or not, and calling an alarm service under the condition that the detection result indicates abnormal state. Any third-party alarm module can be adopted to provide alarm service for alarming.
In this embodiment of the present invention, the execution module 602 is further configured to: before calling the alarm service, the method comprises the following steps: determining that the times of state abnormity exceed a preset threshold; otherwise, the alert service is not invoked.
In the embodiment of the invention, the task description file is realized in a self-defined mirror image mode.
In this embodiment of the present invention, the execution module 602 is further configured to: and when the detection task creating event is not triggered, acquiring a detection result of the created detection task, and updating a task description file corresponding to the created detection task according to the detection result of the created detection task.
According to another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement the cluster component state detection method provided by the invention.
According to a further aspect of the embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method for cluster component status detection provided by the present invention.
Fig. 7 shows an exemplary system architecture 700 to which the method for cluster component state detection or the apparatus for cluster component state detection of the embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server or cloud server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for detecting the state of the cluster component provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the apparatus for detecting the state of the cluster component is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the use range of the embodiment of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a determination module and an execution module. The names of these modules do not form a limitation on the module itself in some cases, for example, the determination module may also be described as a "module for determining whether to trigger a detection task creation event in response to monitoring creation or update of a task description file".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: responding to the monitoring of the creation or the updating of the task description file, and judging whether a task creation event is triggered or not; if yes, acquiring a plurality of task description contents of a task list in the task description file, wherein each task description content indicates a component to be tested; creating a detection task according to task description content to detect a component to be detected corresponding to the task description content; acquiring a detection result of the component to be detected corresponding to the task description content, and updating the task description file according to the detection result; otherwise, no detection task is created.
According to the technical scheme of the embodiment of the invention, the method for detecting the state of the cluster component provided by the embodiment of the invention judges whether to establish the detection task or not by monitoring the establishment or the update of the task description file so as to obtain the detection result of the detection task on the state of the component to be detected. The method is a detection type user-defined K8s cluster component availability detection method, and a user can write a task description file in a simple user-defined mirror image mode, so that detection capacity is integrated into the detection process, additional integration is not needed, and the integration cost is low; the method does not depend on third-party storage, and is low in maintenance cost; the method can actively sense the abnormity of the component and achieve the purpose of alarming, and can acquire the running state of the component before use and timely process faults.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for cluster component status detection, comprising:
responding to the monitoring of the creation or the update of the task description file, and judging whether a task creation event is triggered or not;
if yes, acquiring a plurality of task description contents of a task list in the task description file, wherein each task description content indicates a component to be tested; creating a detection task according to the task description content so as to detect the component to be detected corresponding to the task description content; acquiring a detection result of a component to be detected corresponding to the task description content, and updating the task description file according to the detection result;
otherwise, no detection task is created.
2. The method of claim 1, wherein determining whether to trigger a detect task creation event comprises:
and judging whether the value of the identity field of the task description file is changed, if so, triggering the detection task creating event, otherwise, not triggering the detection task creating event.
3. The method of claim 1, wherein creating a detection task from the task description comprises:
judging whether the value of the execution mode field of the task description file is null or not;
if yes, converting each task description content in the task list into a detection task executed once respectively;
if not, converting the task description content in the task list into a detection task which is executed circularly.
4. The method of claim 1, wherein after obtaining the detection result of the component under test corresponding to the task description content, the method comprises: and judging whether the detection result indicates abnormal state or not, and calling alarm service under the condition that the detection result indicates abnormal state.
5. The method of claim 1, prior to invoking the alert service, comprising:
determining that the number of times of the state abnormity exceeds a preset threshold value; otherwise, the alert service is not invoked.
6. The method of claim 1, wherein the task description file is implemented by means of a custom image.
7. The method according to claim 1, characterized in that it comprises:
and when the detection task creating event is not triggered, acquiring a detection result of the created detection task, and updating the task description file corresponding to the created detection task according to the detection result of the created detection task.
8. An apparatus for cluster component status detection, comprising:
the judging module is used for responding to the monitoring of the creation or the update of the task description file and judging whether a task creation event is triggered or not;
the execution module is used for acquiring a plurality of task description contents of a task list in the task description file when a task creating event is triggered and detected, wherein each task description content indicates a component to be detected; creating a detection task according to the task description content so as to detect the component to be detected corresponding to the task description content; acquiring a detection result of a component to be detected corresponding to the task description content, and updating the task description file according to the detection result; when the detection task creation event is not triggered, the detection task is not created.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202210383471.XA 2022-04-13 Cluster component state detection method and device Active CN114979132B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210383471.XA CN114979132B (en) 2022-04-13 Cluster component state detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210383471.XA CN114979132B (en) 2022-04-13 Cluster component state detection method and device

Publications (2)

Publication Number Publication Date
CN114979132A true CN114979132A (en) 2022-08-30
CN114979132B CN114979132B (en) 2024-05-17

Family

ID=

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180336227A1 (en) * 2017-05-17 2018-11-22 International Business Machines Corporation Database server system monitoring
CN108897854A (en) * 2018-06-29 2018-11-27 北京京东金融科技控股有限公司 A kind of monitoring method and device of overtime task
CN109582441A (en) * 2018-11-30 2019-04-05 北京百度网讯科技有限公司 For providing system, the method and apparatus of container service
CN111130948A (en) * 2019-12-30 2020-05-08 迈普通信技术股份有限公司 Network quality detection method and device
CN111355775A (en) * 2019-12-30 2020-06-30 深圳创新科技术有限公司 Method, device, equipment and storage medium for judging state of CloudStack cluster sub-server
WO2020253347A1 (en) * 2019-06-17 2020-12-24 深圳前海微众银行股份有限公司 Container cluster management method, device and system
CN112543127A (en) * 2019-09-23 2021-03-23 北京轻享科技有限公司 Monitoring method and device of micro-service architecture
US20210191802A1 (en) * 2019-12-23 2021-06-24 Atlassian Pty Ltd. Incident detection and management
CN113626280A (en) * 2021-06-30 2021-11-09 广东浪潮智慧计算技术有限公司 Cluster state control method and device, electronic equipment and readable storage medium
CN113904932A (en) * 2021-09-29 2022-01-07 厦门亿联网络技术股份有限公司 Modularized server upgrading method and device, electronic equipment and medium
CN114036530A (en) * 2021-11-22 2022-02-11 中邮信息科技(北京)有限公司 Kubernetes-based web vulnerability scanning method and device, electronic equipment and medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180336227A1 (en) * 2017-05-17 2018-11-22 International Business Machines Corporation Database server system monitoring
CN108897854A (en) * 2018-06-29 2018-11-27 北京京东金融科技控股有限公司 A kind of monitoring method and device of overtime task
CN109582441A (en) * 2018-11-30 2019-04-05 北京百度网讯科技有限公司 For providing system, the method and apparatus of container service
WO2020253347A1 (en) * 2019-06-17 2020-12-24 深圳前海微众银行股份有限公司 Container cluster management method, device and system
CN112543127A (en) * 2019-09-23 2021-03-23 北京轻享科技有限公司 Monitoring method and device of micro-service architecture
US20210191802A1 (en) * 2019-12-23 2021-06-24 Atlassian Pty Ltd. Incident detection and management
CN111130948A (en) * 2019-12-30 2020-05-08 迈普通信技术股份有限公司 Network quality detection method and device
CN111355775A (en) * 2019-12-30 2020-06-30 深圳创新科技术有限公司 Method, device, equipment and storage medium for judging state of CloudStack cluster sub-server
CN113626280A (en) * 2021-06-30 2021-11-09 广东浪潮智慧计算技术有限公司 Cluster state control method and device, electronic equipment and readable storage medium
CN113904932A (en) * 2021-09-29 2022-01-07 厦门亿联网络技术股份有限公司 Modularized server upgrading method and device, electronic equipment and medium
CN114036530A (en) * 2021-11-22 2022-02-11 中邮信息科技(北京)有限公司 Kubernetes-based web vulnerability scanning method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN110765422A (en) Parameter checking method and device
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN112953791A (en) Network detection method and device, electronic equipment and computer readable storage medium
CN114144761A (en) Publishing system, pushing method, application device, receiving device and service management device
CN114153703A (en) Micro-service exception positioning method and device, electronic equipment and program product
CN112751689B (en) Network connectivity detection method, monitoring server and monitoring proxy device
CN112118352A (en) Method and device for processing notification trigger message
CN111783005A (en) Method, apparatus and system for displaying web page, computer system and medium
CN114979132B (en) Cluster component state detection method and device
CN114979132A (en) Cluster component state detection method and device
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN114490272A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN114020513A (en) Method and device for processing log information
CN113282455A (en) Monitoring processing method and device
CN112905197A (en) Information processing method, device and system, electronic equipment and storage medium
CN113568695A (en) Corner mark processing method and device for boarder application
CN113722193A (en) Method and device for detecting page abnormity
CN112835609A (en) Method and device for modifying dependent package download address
CN112214500A (en) Data comparison method and device, electronic equipment and storage medium
US11973770B1 (en) Techniques for multi-tenant vulnerability scanning
CN111898046B (en) Method and device for redirection management
CN113778780B (en) Application stability determining method and device, electronic equipment and storage medium
CN112134755A (en) Method and device for monitoring public gateway interface program
CN116933264A (en) Vulnerability detection method and device
CN115470027A (en) Method and device for processing page exception

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
GR01 Patent grant