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

Cluster component state detection method and device Download PDF

Info

Publication number
CN114979132B
CN114979132B CN202210383471.XA CN202210383471A CN114979132B CN 114979132 B CN114979132 B CN 114979132B CN 202210383471 A CN202210383471 A CN 202210383471A CN 114979132 B CN114979132 B CN 114979132B
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.)
Active
Application number
CN202210383471.XA
Other languages
Chinese (zh)
Other versions
CN114979132A (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
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

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 method and a device for detecting the state of a cluster component, and relates to the technical field of cloud service. One embodiment of the method comprises the following steps: responding to the monitoring of the creation or updating of the task description file, and judging whether to trigger the detection of a task creation event; 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 a 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. According to the embodiment, whether the detection task is created or not is determined by monitoring the creation or updating of the task description file, so that the running state of the component can be actively perceived, and the integration cost and the maintenance cost are low.

Description

Cluster component state detection method and device
Technical Field
The present invention relates to the field of cloud services, and in particular, to a method and apparatus for detecting a cluster component state.
Background
With the development of cloud services, more and more services or components run on a cloud platform, and therefore, detection and monitoring of the running state of the services or components on the cloud platform are required.
The prior art monitors and detects the operation state of the service or the component through Prometaus (a combination of a set of open-source monitoring & alarming & time sequence databases) and corresponding exporter (an application for providing a monitoring data source for Prometaus), but the detection and monitoring mode needs to rely on additional database storage, has high integration cost, and can not actively sense the operation state of the service or the component after failure.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a method and a device for detecting the state of a cluster component, which can actively sense the running state of the component, does not need additional integration or third party storage, and has low integration cost and low maintenance cost.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method for detecting a cluster component status, including:
responding to the monitoring of the creation or updating of the task description file, and judging whether to trigger the detection of a task creation event;
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 a 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, 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 creation event, otherwise, not triggering the detection task creation event.
Optionally, creating a detection task according to the task description content includes:
judging whether the value of an execution mode field of the task description file is empty or not;
if yes, converting each task description content in the task list into a detection task which is executed once;
if not, respectively converting each task description content in the task list into a detection task for cyclic execution.
Optionally, after obtaining the detection result of the component to be detected corresponding to the task description content, the method includes: judging whether the detection result indicates abnormal state, and calling alarm service under the condition that the detection result indicates abnormal state.
Optionally, before invoking the alarm service, the method includes:
determining that the number of state anomalies exceeds a preset threshold; otherwise, the alarm service is not invoked.
Optionally, the task description file is implemented by means of a custom mirror image.
Optionally, the method comprises:
And when the detection task creation 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 still another aspect of an embodiment of the present invention, an apparatus for cluster component status detection includes:
the judging module is used for responding to the creation or update of the monitoring task description file and judging whether to trigger the detection task creation event;
The execution module is used for acquiring a plurality of task description contents of a task list in the task description file when triggering and detecting a task creation event, 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 a 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, no detection task is created.
According to another aspect of an embodiment of the present invention, there is provided an electronic apparatus including:
one or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method for cluster component state detection provided by the present invention.
According to yet another aspect of an embodiment of the present invention, there is provided a computer readable medium having stored thereon a computer program, which when executed by a processor, implements the method for cluster component state 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 to trigger a detection task creation event 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 triggering the detection task creation event, and acquires the detection result of the detection task on the component to be detected, thereby realizing the detection of the cluster component state and realizing the detection of the K8s cluster component state. The method can actively sense the abnormal state of the component, does not need additional integration or third party storage, and has low integration cost and low maintenance cost.
Further effects of the above-described non-conventional alternatives are 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 the main flow of a method for cluster component status detection in accordance with an embodiment of the invention;
FIG. 2 is a schematic diagram of the main flow of another cluster component status detection method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the main flow of a method for cluster component status detection in accordance with yet another embodiment of the invention;
FIG. 4 is a flow chart of a method for cluster component status detection according to an embodiment of the invention;
FIG. 5 is a 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 in accordance with an embodiment of the invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 8 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered 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 detecting status of a cluster component 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 creation or update of the task description file,
Step S102: judging whether a detection task creation event is triggered or not; if not, go to step S103, if yes, go to step S104;
Step S103: the detection task is not 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 so as 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, the attribute of the detection task (probe) is described in the task description file (probe-describe), such as the time interval of the detection task execution, the mirror image of the detection task execution, the parameter of the detection task execution and the like, and the task description file can be converted into kubernetes (K8 s, open-source container arrangement engine) resources by analyzing the task description file so as to create the detection task in the K8s cluster. The task description file can be yaml (a markup language) format file, and the readability is good.
Users can customize and write the task description file and carry on the creation of the resource in 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), POD (minimum resource management component in kubernetes), and the like.
The creation of the task description file may be adding a new task description file, the update of the task description file may be an update of a task list in the task description file, and in particular, the update 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 the task description file in a list-watch (asynchronous message passing mode in K8 s) mode to judge whether to trigger a detection task creation event, optionally judging whether to trigger the detection task creation event by judging whether the value of an identity field (md 5) 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 is unchanged, the detection task creation event is not triggered.
Optionally, whether to trigger detection of the task creation event is judged by whether the task list is changed or not, and if the task description content in the task list is changed, the detection of the task creation event is triggered; if the task description content in the task list is not changed, the detection task creation event is not triggered.
Optionally, the value of the identity field is updated based on a change in the task description content in the task list, i.e. when a change in the task description content in the task list occurs, the value of the identity field is updated.
After triggering the detection task creation event, executing the creation process of the detection task, acquiring a plurality of task description contents of a task list in a task description file, and creating the detection task according to each task description content so as to detect the running state of the component to be detected by using the created detection task.
In the embodiment of the present invention, in step S104, as shown in fig. 2, a detection task is created according to the task description content, including:
Step S201: acquiring a value of an execution mode field of a task description file;
S202: judging whether the value of an execution mode field of the task description file is empty or not; if yes, go to step S203; if not, executing step S204;
step S203: converting each task description content in the task list into a detection task which is executed once respectively;
step S204: and respectively converting each task description content in the task list into a detection task which is circularly executed.
In the embodiment of the invention, when a task description content is utilized to create a detection task, firstly, acquiring the value of an execution mode field, judging whether the value of the execution mode field is empty, and if so, indicating that the execution mode is single execution; if not, the execution mode is loop execution, and the value of the execution mode field is the time interval of loop execution, namely the interval duration of timing execution. Therefore, the detection task of different execution modes is converted for each task description content in the task list, namely each task description content is converted into a detection task (job) which is executed once, or each task description content is converted into a detection task (cornjob) which is executed circularly. The detection task that is executed once, such as the detection task that detects whether the DNS server resolves normally, and the detection task that is executed in a loop, such as whether the POD is created normally.
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 the state abnormality is judged, and the alarm service is invoked under the condition that the detection result indicates the state abnormality.
In an embodiment of the present invention, as shown in fig. 3, after the detection task is created according to the task description content, the method further includes:
Step S301: acquiring a detection result of a component to be detected corresponding to the task description content;
step S302: judging whether the detection result indicates abnormal state of the component to be detected; if yes, go to step S303; if not, ending the flow;
step S303: judging whether the number of state abnormality exceeds a preset threshold, if so, executing step S304, otherwise, executing step S301;
step S304: and calling an alarm service and ending the flow.
When a detection result of the detection task on the component to be detected is obtained, the detection task can be scanned at regular time by starting a timing task to obtain the detection result, so as to judge whether the detection result indicates abnormal state of the component to be detected corresponding to task description content; if the state of the component to be tested is not abnormal, ending the flow; the timing sweep may also be continued. If the state of the component to be tested is abnormal, calling an alarm service, or continuing to scan at fixed time, and when the number of times of detecting that the state is abnormal exceeds a preset threshold value, calling the alarm service.
In the embodiment of the invention, the detection result of the component to be detected corresponding to the task description content can also be obtained from the updated task description file.
In the embodiment of the invention, after the detection result of the component to be detected corresponding to the task description content is obtained, the detection result is updated in the task description file, optionally, the task description file contains a detection result field corresponding to the detection task, and the state of the component to be detected obtained by 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 so as 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 abnormality of the component to be detected exceeds a preset threshold value, calling an alarm service to alarm. Wherein the alarm service may be provided by any third party alarm 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 images are system environment templates, and each image contains executable programs. The task description file can be automatically added or updated in a self-defined mirror image mode to detect or detect the state of the cluster component. Wherein the custom mirror follows the following specifications: the task description content is detected, for example, whether DNS analysis is normal or not is detected, and whether 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 the detection result can be updated in an identity field of the task description file, and parameters in the task description content are read from environment variables.
In the embodiment of the invention, when the detection task creation 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. Namely, when no event triggering to create the detection task exists, the detection result of the created detection task can be obtained at regular time so as to update the task description file; 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 if the number of times of detecting the state abnormality exceeds a preset threshold value, the alarm service is invoked.
Fig. 4 is a flowchart of a method for detecting a cluster component status according to an embodiment of the invention. The method comprises the following steps:
Step S401: monitoring creation or updating of a task description file, judging whether md5 is changed, 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, and if not, executing step S404;
Step S403: converting each task description content in the task list into a detection task which is executed once;
step S404: converting each task description content in the task list into a detection task which is circularly executed;
Step S405: obtaining a detection result of a detection task;
Step S406: judging whether a detection result of the detection task indicates abnormal state of the component to be detected; if yes, go to step S407, if no, end the flow;
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 a step S408, and if not, executing a step S405;
step S408: and calling an alarm service.
Fig. 5 is a timing diagram illustrating a method for detecting status of cluster components according to an embodiment of the invention. The method for detecting the cluster component state is executed by a probe module, a user adds probe task description content into a task list of a task description file probe-describe, 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 gives an alarm to the user to inform the user that the component to be detected is faulty. And 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 alarm.
According to the method for detecting the state of the cluster component, provided by the embodiment of the invention, whether the detection task is created is judged by monitoring the creation or updating 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 K8s cluster component availability detection method which can be customized by a user, and the user can write a task description file in a simple customized 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 has low maintenance cost; the method can actively sense the abnormality 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, an apparatus 600 for cluster component status detection is provided according to still another aspect of an embodiment of the present invention, including:
The judging module 601 is used for responding to the detection of the creation or update of the task description file and judging whether to trigger the detection of the task creation event;
The execution module 602 acquires a plurality of task description contents of a task list in a task description file when triggering a detection task creation event, 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, no detection task is created.
In the embodiment of the present invention, the judging 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 creation event, otherwise, not triggering the detection task creation event.
In an embodiment of the present invention, the execution module 602 is further configured to: judging whether the value of an execution mode field of the task description file is empty or not; if yes, respectively converting each task description content in the task list into a detection task which is executed once; if not, respectively converting each task description content in the task list into a detection task for cyclic execution.
In an embodiment of the present invention, the execution module 602 is further configured to: 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, and calling alarm service under the condition that the detection result indicates abnormal state. Wherein, any third party alarm module can be adopted to provide alarm service for alarming.
In an embodiment of the present invention, the execution module 602 is further configured to: before invoking the alert service, comprising: determining that the number of state anomalies exceeds a preset threshold; otherwise, the alarm service is not invoked.
In the embodiment of the invention, the task description file is realized in a self-defined mirror image mode.
In an embodiment of the present invention, the execution module 602 is further configured to: and when the detection task creation 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; and 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 are enabled to realize the cluster component state detection method provided by the invention.
According to yet another aspect of an embodiment of the present invention, there is provided a computer readable medium having stored thereon a computer program, which when executed by a processor implements the method for cluster component state detection provided by the present invention.
Fig. 7 illustrates an exemplary system architecture 700 of a cluster component state detection method or apparatus to which embodiments of the invention may be applied.
As shown in fig. 7, a system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 705 via the network 704 using the terminal devices 701, 702, 703 to receive or send messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 705 may be a server or cloud server providing various services, such as a background management server (by way of example only) providing support for shopping class websites browsed by users using the terminal devices 701, 702, 703. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the method for detecting the status of the cluster component according to the embodiment of the present invention is generally executed by the server 705, and accordingly, the device for detecting the status 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, there is illustrated a schematic diagram of a computer system 800 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not impose any limitation on the functions and the scope of use 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 according to 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 required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or 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. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 801.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this document, 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, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. 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 of the foregoing. 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 flowcharts 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 involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a determination module and an execution module. The names of these modules do not constitute a limitation on the module itself in some cases, and for example, the judgment module may also be described as "a module that judges whether to trigger detection of a task creation event in response to listening to 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 present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: responding to the monitoring of the creation or updating of the task description file, and judging whether to trigger the detection of a task creation event; if yes, 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; creating a detection task according to task description content so as 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 judges whether to perform the creation of the detection task or not through the creation or update monitoring of the task description file so as to acquire the detection result of the detection task on the state of the component to be detected. The method is a detection type K8s cluster component availability detection method which can be customized by a user, and the user can write a task description file in a simple customized 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 has low maintenance cost; the method can actively sense the abnormality 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 embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A method for cluster component state detection, comprising:
responding to the monitoring of the creation or updating of the task description file, and judging whether to trigger the detection of a task creation event;
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 a 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, the detection task is not created;
Wherein 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 creation event, otherwise, not triggering the detection task creation event.
2. The method of claim 1, wherein creating a detection task from the task description comprises:
judging whether the value of an execution mode field of the task description file is empty or not;
if yes, converting each task description content in the task list into a detection task which is executed once;
if not, respectively converting each task description content in the task list into a detection task for cyclic execution.
3. The method according to claim 1, wherein after obtaining the detection result of the component to be tested corresponding to the task description content, the method comprises: judging whether the detection result indicates abnormal state, and calling alarm service under the condition that the detection result indicates abnormal state.
4. A method according to claim 3, comprising, prior to invoking the alert service:
determining that the number of state anomalies exceeds a preset threshold; otherwise, the alarm service is not invoked.
5. The method of claim 1, wherein the task description file is implemented by means of custom mirroring.
6. The method according to claim 1, characterized in that the method comprises:
And when the detection task creation 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.
7. An apparatus for cluster component status detection, comprising:
the judging module is used for responding to the creation or update of the monitoring task description file and judging whether to trigger the detection task creation event;
The execution module is used for acquiring a plurality of task description contents of a task list in the task description file when triggering and detecting a task creation event, 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 a 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;
The judging module is further used for: and judging whether the value of the identity field of the task description file is changed, if so, triggering the detection task creation event, otherwise, not triggering the detection task creation event.
8. An electronic device, comprising:
one or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202210383471.XA 2022-04-13 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 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 2022-04-13 Cluster component state detection method and device

Publications (2)

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

Family

ID=82977584

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN114979132B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10719505B2 (en) * 2017-05-17 2020-07-21 International Business Machines Corporation Database server system monitoring
US11243830B2 (en) * 2020-03-25 2022-02-08 Atlassian Pty Ltd. Incident detection and management

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Also Published As

Publication number Publication date
CN114979132A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
EP2847944B1 (en) Transmitting and displaying offline data
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN111460129B (en) Method, device, electronic equipment and storage medium for generating identification
CN111427701A (en) Workflow engine system and business processing method
CN113377626A (en) Visual unified alarm method, device, equipment and medium based on service tree
US9563485B2 (en) Business transaction context for call graph
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
US11734057B2 (en) Method and apparatus for processing a service of an abnormal server
CN111831503B (en) Monitoring method based on monitoring agent and monitoring agent device
CN114979132B (en) Cluster component state detection method and device
CN113778780B (en) Application stability determining method and device, electronic equipment and storage medium
CN113762910B (en) Document monitoring method and device
CN112835609B (en) Method and device for modifying download address of dependent packet
CN114020513A (en) Method and device for processing log information
CN110445628B (en) NGINX-based server and deployment and monitoring methods and devices thereof
CN113282455A (en) Monitoring processing method and device
CN112395194A (en) Method and device for accessing test platform
CN113132447A (en) Reverse proxy method and system
US11973770B1 (en) Techniques for multi-tenant vulnerability scanning
CN110554942A (en) method and device for monitoring code execution
CN111898046B (en) Method and device for redirection management
CN113778504B (en) Publishing method, publishing system and routing device
CN113542185B (en) Method and device for preventing hijacking of page, electronic equipment and storage medium
CN109981806B (en) Domain name processing and registering method and system, and computer system
CN112788075B (en) Business service monitoring method and device

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