CN117472618A - Fault injection method, device, processor, storage medium and program product - Google Patents

Fault injection method, device, processor, storage medium and program product Download PDF

Info

Publication number
CN117472618A
CN117472618A CN202311369034.3A CN202311369034A CN117472618A CN 117472618 A CN117472618 A CN 117472618A CN 202311369034 A CN202311369034 A CN 202311369034A CN 117472618 A CN117472618 A CN 117472618A
Authority
CN
China
Prior art keywords
fault
container
container cluster
fault injection
metadata
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311369034.3A
Other languages
Chinese (zh)
Inventor
王川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202311369034.3A priority Critical patent/CN117472618A/en
Publication of CN117472618A publication Critical patent/CN117472618A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/008Reliability or availability analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The embodiment of the application discloses a fault injection method, a fault injection device, a fault injection processor, a fault injection storage medium and a fault injection program product, and relates to the field of big data intelligent analysis. The fault injection method comprises the following steps: acquiring metadata and observation data of all containers in a container cluster; determining the topological structure of the container cluster according to all the metadata and the observation data; generating fault scene configuration based on the topological structure; and injecting faults in the fault scene configuration into the container cluster by using the probes. The fault injection is carried out on the nodes of the container cluster through the probes, so that the container-level fault injection of the container cluster is realized, and the object coverage of the reliability test is more comprehensive. Meanwhile, the probes arranged on the nodes of the container cluster can inject and simulate a fault scene of system level call abnormality under the condition of not changing the kernel of the container cluster. The fault type and the fault scene of the reliability test are more comprehensive, and the accuracy of the reliability test result of the containerized application system is improved.

Description

Fault injection method, device, processor, storage medium and program product
Technical Field
The present disclosure relates to the field of intelligent analysis of big data, and in particular, to a fault injection method, a fault injection device, a processor, a storage medium, and a program product.
Background
Containerization is the packaging of code with the operating system, creating an executable container file that can run on the infrastructure. With the rapid development of cloud native technology, a containerized application system for deploying, expanding and managing containerized applications is widely used. The containerized application system incorporating cloud-native technology reduces the complexity of the application, but increases the complexity of the container virtual layer. For non-containerized systems, fault injection is performed by operating system instructions, or reliability testing is performed by Mock (isolated) tool simulation systems where injection faults are required.
However, fault injection is performed through an operating system instruction, so that a single physical machine or a container-level fault scene inside the virtual machine, such as inter-container network delay, packet loss, container virtual network card faults and the like, which may occur in the containerized application system cannot be simulated, and the simulated fault scene of the containerized application system is not fully covered. The Mock tool simulates the system that the fault needs to be injected, the system call abnormality or the container-level virtual equipment abnormality cannot be simulated, and the simulated fault scene of the containerized application system is not fully covered, so that the reliability test result of the containerized application system is inaccurate.
Disclosure of Invention
An objective of the embodiments of the present application is to provide a fault injection method, device, processor, storage medium and program product, so as to solve the problem that the fault scene coverage of a simulated containerized application system is not comprehensive.
In order to achieve the above object, a first aspect of the present application provides a fault injection method, including:
acquiring metadata and observation data of all containers in a container cluster, wherein the metadata comprises nodes in the container cluster where each container is located;
determining the topological structure of the container cluster according to all the metadata and the observation data;
generating a fault scene configuration based on the topological structure, wherein the fault scene configuration comprises at least one target node and faults of the target node to be injected;
and injecting faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
In an embodiment of the present application, injecting a fault in a fault scenario configuration into a container cluster using a probe includes:
determining a target probe corresponding to each target node based on fault scene configuration;
faults are injected into target nodes in the container cluster with each target probe separately.
In an embodiment of the present application, generating a fault scenario configuration based on a topology structure includes:
determining a container call relationship of the container cluster based on the topological structure;
determining all target nodes to be injected with faults in the container cluster according to the container calling relation;
generating fault scene configuration corresponding to all target nodes.
In the embodiment of the present application, generating fault scenario configuration corresponding to all target nodes includes:
generating fault scene configuration based on the fault injection object, the fault injection type and the fault injection triggering rule of each target node.
In an embodiment of the present application, metadata of all containers in a container cluster is acquired, and observation data of all containers is acquired, including:
accessing a metadata service of the container cluster to obtain metadata of all containers in the container cluster;
observations were collected for all containers using probes.
In the embodiment of the present application, the probe is an eBPF probe.
A second aspect of the present application provides a fault injection apparatus, the fault injection apparatus comprising:
the data acquisition module is used for acquiring metadata and observation data of all containers in the container cluster, wherein the metadata comprises nodes in the container cluster where each container is located;
the topological structure determining module is used for determining the topological structure of the container cluster according to all the metadata and the observation data;
the configuration generation module is used for generating fault scene configuration based on the topological structure, wherein the fault scene configuration comprises at least one target node and faults of the target node to be injected;
and the fault injection module is used for injecting faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
A third aspect of the present application provides a processor configured to perform the fault injection method according to the first aspect.
A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, characterized in that the instructions, when executed by a processor, cause the processor to be configured to perform the fault injection method according to the first aspect.
A fifth aspect of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the fault injection method according to the first aspect.
The application provides a fault injection method, which comprises the following steps: acquiring metadata and observation data of all containers in a container cluster; determining the topological structure of the container cluster according to all the metadata and the observation data; generating fault scene configuration based on the topological structure; and injecting faults in the fault scene configuration into the container cluster by using the probes. The fault injection is carried out on the nodes of the container cluster through the probes, so that the container-level fault injection of the container cluster is realized, and the object coverage of the reliability test is more comprehensive. Meanwhile, the probes arranged on the nodes of the container cluster can inject and simulate the fault scene of system level call abnormality under the condition of not changing the kernel of the container cluster, so that the fault type of the reliability test is more comprehensive. The fault scene coverage of the simulated containerized application system is more comprehensive, and the accuracy of the reliability test result of the containerized application system is improved.
Additional features and advantages of embodiments of the present application will be set forth in the detailed description that follows.
Drawings
The accompanying drawings are included to provide a further understanding of embodiments of the present application and are incorporated in and constitute a part of this specification, illustrate embodiments of the present application and together with the description serve to explain, without limitation, the embodiments of the present application. In the drawings:
FIG. 1 schematically illustrates a flow diagram of a fault injection method according to an embodiment of the present application;
FIG. 2 schematically illustrates another flow diagram of a fault injection method according to an embodiment of the present application;
FIG. 3 schematically illustrates an application diagram of a fault management and control device according to an embodiment of the present application;
FIG. 4 schematically shows a block diagram of a fault injection apparatus according to an embodiment of the present application;
fig. 5 schematically shows an internal structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the specific implementations described herein are only for illustrating and explaining the embodiments of the present application, and are not intended to limit the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present application based on the embodiments herein.
The data acquisition, storage, use, processing and the like in the technical scheme meet the relevant regulations of national laws and regulations.
In addition, if there is a description of "first", "second", etc. in the embodiments of the present application, the description of "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be regarded as not exist and not within the protection scope of the present application.
Example 1
Referring to fig. 1, fig. 1 schematically illustrates a flow chart of a fault injection method according to an embodiment of the present application.
Fig. 1 schematically shows a flow diagram of a fault injection method according to an embodiment of the present application. As shown in fig. 1, in an embodiment of the present application, there is provided a fault injection method, including:
step 110, obtaining metadata and observation data of all containers in a container cluster, wherein the metadata comprises nodes in the container cluster where each container is located;
the container cluster includes a plurality of nodes, where the nodes may be virtual machine nodes or physical machine nodes, which are not described herein. Each container is arranged at a node in the container cluster, and a plurality of containers are connected to form the container cluster.
And when the reliability test is required to be carried out on the container cluster, acquiring metadata and observation data of all containers in the container cluster. Metadata, also called relay data, is data for describing attributes of data. The metadata in embodiments of the present application includes the nodes in the container cluster where each container is located. It should be understood that the metadata of the container may also include data such as a network port of the container and a container ID (Identity document, identity), which is not described herein. The observed data of the container is data generated in the running process of the container, including but not limited to system call data, network event data and the like of the container, which are not described herein.
Step 120, determining the topology of the container cluster according to all metadata and observation data.
And determining the nodes in the container cluster where each container is located according to the metadata of all the containers. And determining the connection relation between the containers in the container cluster according to the observed data of all the containers. According to the nodes in the container cluster where each container is located and the connection relation among the containers in the container cluster, the property, availability requirement, performance requirement and the like of each container in the container cluster are determined, and then the topological structure of the container cluster is determined.
Step 130, generating a fault scenario configuration based on the topology structure, wherein the fault scenario configuration comprises at least one target node and a fault of the target node to be injected.
The topology of a container cluster is a topology that connects containers in the container cluster. Generating a fault scenario configuration based on the topology, wherein the fault scenario configuration comprises at least one target node and a fault of the target node to be injected. Specifically, a container to be injected with a fault is determined based on the topology. And determining the node where the container to be injected with the fault is located as a target node, and generating fault scene configuration corresponding to the target node.
In an embodiment of the present application, generating a fault scenario configuration based on a topology structure includes:
determining a container call relationship of the container cluster based on the topological structure;
determining all target nodes to be injected with faults in the container cluster according to the container calling relation;
generating fault scene configuration corresponding to all target nodes.
The failure types of the container level generally include connection failure between at least two containers, transmission delay, packet loss, and the like. When a container level fault is injected, a calling relationship between at least two containers to be injected with the fault needs to be determined. Since the topology of a container cluster is a topology that connects containers in the container cluster. Based on the topology, a container call relationship for the container cluster is determined. And determining nodes where the containers with the container calling relationship exist according to the container calling relationship, and further determining all target nodes to be injected with faults in the container cluster. Generating fault scene configuration corresponding to all target nodes according to the type of the fault to be injected.
For ease of understanding, in embodiments of the present application, when a TCP (Transmission Control Protocol ) connection failure scenario between container a and container B needs to be emulated, container call relationships of container a and container B are based on topology. And determining target nodes set by the container A and the container B according to the container calling relation, and further generating fault scene configuration corresponding to all the target nodes.
In the embodiment of the present application, generating fault scenario configuration corresponding to all target nodes includes:
generating fault scene configuration based on the fault injection object, the fault injection type and the fault injection triggering rule of each target node.
There are often cases where a plurality of containers are provided on one node, and it is necessary to determine a fault injection object of the target node, that is, a container to be injected with a fault. The fault injection object may be determined by the ID and address of the container, which is not described herein. The fault injection type, i.e., the fault type of the injection node, includes, but is not limited to, connection failure between containers, transmission delay, packet discard, etc., and will not be described in detail herein. The barrier injection triggering rule is set according to the actual triggering requirement of the fault, and is not limited herein. And determining the fault to be injected of each target node based on the fault injection object, the fault injection type and the fault injection triggering rule of each target node, and further generating fault scene configuration.
And 140, injecting faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
The probes are arranged on the inner cores of the container clusters, and specifically, each node in the container clusters is correspondingly provided with one probe. After generating the failure scenario configuration, a failure code can be inserted into the target node using the probe without changing the container cluster kernel to inject a failure in the failure scenario configuration into the container cluster. The fault injection is carried out on the nodes of the container cluster through the probes, so that the container-level fault injection of the container cluster is realized, and the object coverage of the reliability test is more comprehensive. Meanwhile, the probes arranged on the nodes of the container cluster can inject and simulate fault scenes of abnormal system level call such as abnormal process termination, server downtime, network delay and the like under the condition that the inner cores of the container cluster are not changed, so that the fault types of the reliability test are more comprehensive. The fault scene coverage of the simulated containerized application system is more comprehensive, and the accuracy of the reliability test result of the containerized application system is improved.
In an embodiment of the present application, injecting a fault in a fault scenario configuration into a container cluster using a probe includes:
determining a target probe corresponding to each target node based on fault scene configuration;
faults are injected into target nodes in the container cluster with each target probe separately.
After generating the fault scenario configuration based on the topology, distributing the fault scenario configuration to the probes to inject faults in the fault scenario configuration into the container cluster. Specifically, based on the fault scene configuration, the probe set at the target node is determined, that is, the target probe corresponding to the target node is determined. And correspondingly distributing the faults to be injected into the target nodes to the target probes, and then respectively injecting the faults into the target nodes in the container cluster by utilizing each target probe under the condition of not changing the inner core of the container cluster.
The application provides a fault injection method, which comprises the following steps: acquiring metadata and observation data of all containers in a container cluster; determining the topological structure of the container cluster according to all the metadata and the observation data; generating fault scene configuration based on the topological structure; and injecting faults in the fault scene configuration into the container cluster by using the probes. The fault injection is carried out on the nodes of the container cluster through the probes, so that the container-level fault injection of the container cluster is realized, and the object coverage of the reliability test is more comprehensive. Meanwhile, the probes arranged on the nodes of the container cluster can inject and simulate the fault scene of system level call abnormality under the condition of not changing the kernel of the container cluster, so that the fault type of the reliability test is more comprehensive. The fault scene coverage of the simulated containerized application system is more comprehensive, and the accuracy of the reliability test result of the containerized application system is improved.
FIG. 1 is a flow chart of a fault injection method in one embodiment. It should be understood that, although the steps in the flowchart of fig. 1 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps of other steps.
Example 2
Referring to fig. 2, fig. 2 schematically illustrates another flow chart of a fault injection method according to an embodiment of the present application.
Fig. 2 schematically shows another flow diagram of a fault injection method according to an embodiment of the present application. As shown in fig. 2, in an embodiment of the present application, there is provided a fault injection method, including:
step 111, accessing metadata services of the container clusters to obtain metadata of all containers in the container clusters.
Typically, a cluster of containers is provided with a metadata service to store metadata for each container. For ease of understanding, embodiments of the present application take the example of a container cluster as the Kubernetes cluster. The API Server (Application Programming Interface Server, application programming interface service) of Kubernetes cluster is responsible for communication and information storage between containers. The API Server of the Kubernetes cluster is accessed, i.e., the metadata service of the container cluster is accessed to obtain metadata of all containers in the container cluster.
At step 112, observations of all containers are collected using a probe.
The probe can insert the observation data acquisition code into the nodes of the container cluster under the condition that the inner core of the container cluster is not changed, and then the probe can be used for acquiring the observation data of all containers.
In the embodiment of the present application, the probe is an eBPF probe.
An eBPF (Extended Berkeley Packet Filter ) probe is a tool for grabbing packets. In the embodiment of the application, the probe is an eBPF probe, and the eBPF probe can insert codes into the kernel of the container cluster under the condition of not changing the kernel source code of the container cluster or loading the kernel module. Specifically, each eBPF probe is disposed corresponding to a node in the container cluster, and the observation data acquisition code and the fault injection code are inserted into the node in the container cluster through the eBPF probe. When the container cluster is executed to one node, the eBPF probe is used to acquire observation data or inject faults. It should be understood that the fault injection method of the present application may also be implemented by other types of probes. Other fault methods are selected according to actual requirements, and are not limited herein.
Step 120, determining the topology of the container cluster according to all metadata and observation data.
And determining each container in the cluster and the connection relation between the containers according to all metadata and observation data, and further determining the topological structure of the container cluster.
Step 130, generating a fault scenario configuration based on the topology structure, wherein the fault scenario configuration comprises at least one target node and a fault of the target node to be injected.
Referring to fig. 3, fig. 3 schematically illustrates an application diagram of a fault management and control device according to an embodiment of the present application.
For ease of understanding, embodiments of the present application provide a fault injection tool that includes a fault management device 210 and at least one probe 220. For ease of understanding, only one probe 220 is shown in the figure, and only one container 230 is shown for the container cluster 240.
Each probe 220 is disposed corresponding to a node in the container cluster 240. In performing reliability tests on the container cluster 240, the fault management device 210 obtains metadata for all containers 230 within the container cluster 240 and the probe 220 obtains observations of the containers 230. The fault management and control device 210 determines a target node to be injected with a fault based on the topology structure, and further generates a fault scenario configuration.
And 140, injecting faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
The probe 220 in this embodiment is an eBPF probe, and the probe 220 is capable of inserting an observation data acquisition code and a fault injection code into a node in the container cluster 240 without changing the core of the container cluster 240. After the observation data collection code is inserted into the container cluster 240, the probe 220 may be used to collect the observations of all the containers in the container cluster 240. The fault management and control device 210 distributes the fault scenario configuration to the probes 220, and the probes 220 are used for injecting faults in the fault scenario configuration into the container cluster 240, namely, fault injection codes are inserted into nodes in the container cluster 240 by the probes 220, so that fault injection is realized.
FIG. 2 is a schematic flow chart of another fault injection method in one embodiment. It should be understood that, although the steps in the flowchart of fig. 2 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Example 3
Referring to fig. 4, fig. 4 schematically shows a block diagram of a fault injection apparatus according to an embodiment of the present application.
In one embodiment, as shown in fig. 4, a fault injection apparatus 300 is provided, where the fault injection apparatus 300 includes a data acquisition module 310, a topology determination module 320, a configuration generation module 330, and a fault injection module 340
A data obtaining module 310, configured to obtain metadata and observation data of all containers in the container cluster, where the metadata includes a node in the container cluster where each container is located;
a topology determination module 320, configured to determine a topology of the container cluster according to all metadata and observation data;
a configuration generating module 330, configured to generate a fault scenario configuration based on a topology structure, where the fault scenario configuration includes at least one target node and a fault of the target node to be injected;
the fault injection module 340 is configured to inject the fault in the fault scenario configuration into the container cluster by using probes, where each probe is disposed corresponding to a node in the container cluster.
In an embodiment of the present application, the fault injection module 340 includes:
the target probe determining submodule is used for determining a target probe corresponding to each target node based on fault scene configuration;
and the injection submodule is used for respectively injecting faults into target nodes in the container cluster by utilizing each target probe.
In an embodiment of the present application, the configuration generating module 330 includes:
the call relation determining submodule is used for determining a container call relation of the container cluster based on the topological structure;
the target node determining submodule is used for determining all target nodes to be injected with faults in the container cluster according to the container calling relation;
and the fault scene configuration generation sub-module is used for generating fault scene configuration corresponding to all the target nodes.
In the embodiment of the present application, the fault scenario configuration generating submodule is further configured to generate fault scenario configuration based on a fault injection object, a fault injection type and a fault injection triggering rule of each target node.
In an embodiment of the present application, the data acquisition module 310 includes:
the metadata acquisition sub-module is used for accessing metadata service of the container cluster to acquire metadata of all containers in the container cluster;
and the observation data acquisition sub-module is used for acquiring the observation data of all containers by using the probes.
In the embodiment of the present application, the probe is an eBPF probe.
The fault injection device includes a processor and a memory, where the data acquisition module 310, the topology determination module 320, the configuration generation module 330, the fault injection module 340, and the like are stored as program units, and the processor executes the program modules stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the fault injection method is realized by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
Embodiments of the present application also provide a processor configured to perform the fault injection method according to embodiment 1.
Embodiments of the present application also provide a machine-readable storage medium having stored thereon instructions that, when executed by a processor, cause the processor to be configured to perform the fault injection method according to embodiment 1.
Referring to fig. 5, fig. 5 schematically shows an internal structural diagram of a computer device according to an embodiment of the present application.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 5. The computer apparatus includes a processor a01, a network interface a02, a display screen a04, an input device a05, and a memory (not shown in the figure) which are connected through a system bus. Wherein the processor a01 of the computer device is adapted to provide computing and control capabilities. The memory of the computer device includes an internal memory a03 and a nonvolatile storage medium a06. The nonvolatile storage medium a06 stores an operating system B01 and a computer program B02. The internal memory a03 provides an environment for the operation of the operating system B01 and the computer program B02 in the nonvolatile storage medium a06. The network interface a02 of the computer device is used for communication with an external terminal through a network connection. The computer program, when executed by the processor a01, implements a fault injection method. The display screen a04 of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device a05 of the computer device may be a touch layer covered on the display screen, or may be a key, a track ball or a touch pad arranged on a casing of the computer device, or may be an external keyboard, a touch pad or a mouse.
In one embodiment, the fault injection apparatus provided herein may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 5. The memory of the computer device may store various program modules constituting the fault injection apparatus, such as the data acquisition module 310, the topology determination module 320, the configuration generation module 330, and the fault injection module 340 shown in fig. 4. The computer program constituted by the respective program modules causes the processor to execute the steps in the fault injection method of the respective embodiments of the present application described in the present specification.
The computer apparatus shown in fig. 5 may perform step 110 through the data acquisition module 310 in the fault injection apparatus as shown in fig. 4; step 120 is performed by topology determination module 320, step 130 is performed by configuration generation module 330, and step 140 is performed by fault injection module 340.
The present application also provides a computer program product comprising a computer program adapted to perform, when executed on a data processing apparatus, a program initialized with the method steps of:
acquiring metadata and observation data of all containers in a container cluster, wherein the metadata comprises nodes in the container cluster where each container is located;
determining the topological structure of the container cluster according to all the metadata and the observation data;
generating a fault scene configuration based on the topological structure, wherein the fault scene configuration comprises at least one target node and faults of the target node to be injected;
and injecting faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
Injecting faults in the fault scenario configuration into the container cluster using the probe, comprising:
determining a target probe corresponding to each target node based on fault scene configuration;
faults are injected into target nodes in the container cluster with each target probe separately.
In the embodiment of the present application, a program is executed: injecting faults in the fault scenario configuration into the container cluster using the probe, comprising:
determining a target probe corresponding to each target node based on fault scene configuration;
faults are injected into target nodes in the container cluster with each target probe separately.
In the embodiment of the present application, a program is executed: generating a fault scenario configuration based on the topology, comprising:
determining a container call relationship of the container cluster based on the topological structure;
determining all target nodes to be injected with faults in the container cluster according to the container calling relation;
generating fault scene configuration corresponding to all target nodes.
In the embodiment of the present application, a program is executed: generating fault scene configurations for all target nodes, including:
generating fault scene configuration based on the fault injection object, the fault injection type and the fault injection triggering rule of each target node.
In the embodiment of the present application, a program is executed: acquiring metadata of all containers in a container cluster, and acquiring observation data of all containers, wherein the metadata comprises:
accessing a metadata service of the container cluster to obtain metadata of all containers in the container cluster;
observations were collected for all containers using probes.
In the embodiment of the present application, the probe is an eBPF probe.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (10)

1. A fault injection method, the fault injection method comprising:
acquiring metadata and observation data of all containers in a container cluster, wherein the metadata comprises nodes in the container cluster where each container is located;
determining the topological structure of the container cluster according to all the metadata and the observation data;
generating a fault scene configuration based on the topological structure, wherein the fault scene configuration comprises at least one target node and a fault to be injected into the target node;
and injecting the faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
2. The method of claim 1, wherein the injecting the fault in the fault scenario configuration into the cluster of containers with a probe comprises:
determining a target probe corresponding to each target node based on the fault scene configuration;
the fault is injected into the target nodes in the container cluster with each of the target probes, respectively.
3. The method of claim 1, wherein generating a fault scenario configuration based on the topology comprises:
determining a container call relationship of the container cluster based on the topology;
determining all target nodes to be injected with faults in the container cluster according to the container calling relation;
and generating the fault scene configuration corresponding to all the target nodes.
4. A method according to claim 3, wherein said generating said fault scenario configuration for all of said target nodes comprises:
and generating the fault scene configuration based on the fault injection object, the fault injection type and the fault injection triggering rule of each target node.
5. The method of claim 1, wherein the obtaining metadata for all containers in a cluster of containers and obtaining observations for all the containers comprises:
accessing metadata services of the container clusters to obtain metadata of all containers in the container clusters;
and collecting observation data of all the containers by using the probes.
6. The method of claim 1, wherein the probe is an eBPF probe.
7. A fault injection apparatus, the fault injection apparatus comprising:
the data acquisition module is used for acquiring metadata and observation data of all containers in the container cluster, wherein the metadata comprises nodes in the container cluster where each container is located;
the topological structure determining module is used for determining the topological structure of the container cluster according to all the metadata and the observation data;
the configuration generation module is used for generating fault scene configuration based on the topological structure, wherein the fault scene configuration comprises at least one target node and a fault to be injected into the target node;
and the fault injection module is used for injecting the faults in the fault scene configuration into the container cluster by using probes, wherein each probe is arranged corresponding to a node in the container cluster.
8. A processor configured to perform the fault injection method according to any one of claims 1 to 6.
9. A machine-readable storage medium having instructions stored thereon, which when executed by a processor cause the processor to be configured to perform the fault injection method according to any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the fault injection method according to any of claims 1 to 6.
CN202311369034.3A 2023-10-20 2023-10-20 Fault injection method, device, processor, storage medium and program product Pending CN117472618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311369034.3A CN117472618A (en) 2023-10-20 2023-10-20 Fault injection method, device, processor, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311369034.3A CN117472618A (en) 2023-10-20 2023-10-20 Fault injection method, device, processor, storage medium and program product

Publications (1)

Publication Number Publication Date
CN117472618A true CN117472618A (en) 2024-01-30

Family

ID=89632307

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311369034.3A Pending CN117472618A (en) 2023-10-20 2023-10-20 Fault injection method, device, processor, storage medium and program product

Country Status (1)

Country Link
CN (1) CN117472618A (en)

Similar Documents

Publication Publication Date Title
CN111625452B (en) Flow playback method and system
CN112035314B (en) Memory leakage monitoring method and device and electronic equipment
CN102834806A (en) System structure managing device, method of managing system structure, and program
CN111858296B (en) Interface testing method, device, equipment and storage medium
CN110059068B (en) Data verification method and data verification system in distributed storage system
CN111181800A (en) Test data processing method and device, electronic equipment and storage medium
CN113076253A (en) Test method and test device
CN109408361A (en) Monkey tests restored method, device, electronic equipment and computer readable storage medium
CN114490375A (en) Method, device and equipment for testing performance of application program and storage medium
CN115827436A (en) Data processing method, device, equipment and storage medium
CN115705190A (en) Method and device for determining dependence degree
CN108280024A (en) Traffic distribution strategy test method, device and electronic equipment
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN116974874A (en) Database testing method and device, electronic equipment and readable storage medium
CN108763039B (en) Service fault simulation method, device and equipment
CN113127331A (en) Fault injection-based test method and device and computer equipment
CN116955148A (en) Service system testing method, device, equipment, storage medium and product
CN117472618A (en) Fault injection method, device, processor, storage medium and program product
CN109656825A (en) The method and device of fine arts resource processing, electronic equipment, storage medium
CN112416488B (en) User portrait implementing method, device, computer equipment and computer readable storage medium
CN115617668A (en) Compatibility testing method, device and equipment
CN115687129A (en) Coverage rate report generation method and device, storage medium and computer equipment
CN114157662A (en) Cloud platform parameter adaptation method and device, terminal equipment and storage medium
CN114285756A (en) Service call dependency relationship analysis method and related device
CN107885659A (en) Method and device, the equipment of request analog response to client

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