Configuration fault drilling method and device, electronic equipment and storage medium
By generating drill objects with preset resource types and classification of parameter information, the parameter information associated with drill failures is automatically extracted, and fault drill instructions are generated, which solves the problem of cumbersome manual input of configuration information in the existing technology, and realizes automatic configuration and efficient processing of fault drills.
Patent Information
- Application Number
- CN202510312211.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-01
AI Technical Summary
Before performing a fault drill in k8s related scenarios, the prior art requires operators to manually input the configuration information of the fault drill, resulting in cumbersome steps, low efficiency and high usage threshold.
By generating drill objects with preset resource types, the parameter information is classified according to the work unit of resource type, the drill scene and target machine are determined, the parameter information associated with the drill scene is obtained from the classified parameter information, and the fault drill instructions are generated.
It realizes automatic configuration of fault drills, simplifies the configuration process, improves processing efficiency, reduces technical requirements for operators, and saves time and personnel costs.
Smart Images

Figure CN120234668A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technologies, and in particular, to a method, apparatus, electronic device, and storage medium for configuring fault drills. Background Art
[0002] Currently, before the chaos engineering fault drill platform chaosblade executes fault drills for scenarios related to k8s (Kubernetes, a container orchestration platform), operators usually need to manually input the configuration information for the fault drills, such as information about namespaces, pods, and dockers. Only then can the corresponding fault drills be executed based on this configuration information. The process of manually inputting configuration information is cumbersome, with low efficiency, and requires operators to have a certain amount of k8s knowledge to complete, resulting in a relatively high usage threshold. Summary of the Invention
[0003] The purpose of the embodiments of this application is to provide a method, apparatus, electronic device, and storage medium for configuring fault drills, which can achieve automatic configuration of fault drills, improve processing efficiency, and reduce costs.
[0004] To achieve the above technical solution, the embodiments of this application are implemented as follows: In a first aspect, a method for configuring a fault drill provided by an embodiment of this application includes: Generating a drill object of a preset resource type; Classifying the parameter information of the drill object according to the working units of the resource type; Determining a drill scenario and determining the target machines participating in the fault drill; Obtaining the parameter information associated with the drill scenario from the classified parameter information; Generating a fault drill instruction based on the target machines and the obtained parameter information.
[0005] In a second aspect, an apparatus for configuring a fault drill provided by an embodiment of this application includes: A generating module, configured to generate a drill object of a preset resource type; A classifying module, configured to classify the parameter information of the drill object according to the working units of the resource type; A determining module, configured to determine a drill scenario and determine the target machines participating in the fault drill; An obtaining module, configured to obtain the parameter information associated with the drill scenario from the classified parameter information; A configuring module, configured to generate a fault drill instruction based on the target machines and the obtained parameter information.
[0006] In a third aspect, an electronic device provided by an embodiment of the present application, the device includes: a processor; and a memory arranged to store computer-executable instructions, the executable instructions being configured to be executed by the processor, the executable instructions including steps for performing the method of configuring a fault drill as described above.
[0007] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present application, wherein the storage medium is used to store computer-executable instructions, and the executable instructions cause a computer to execute the steps in the method of configuring a fault drill as described above.
[0008] The above technical solution provided by the embodiment of the present application generates a drill object of a preset resource type, classifies the parameter information of the drill object according to the working unit of the resource type, determines the drill scenario and determines the target machine participating in the fault drill, obtains the parameter information associated with the drill scenario from the classified parameter information, and generates a fault drill instruction according to the target machine and the obtained parameter information. This mechanism of classifying parameter information based on the working unit of the resource type can automatically extract the parameter information associated with the drill fault, so that a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some of the embodiments described in one or more of the present applications. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0010] Figure 1 is a schematic flowchart of a method for configuring a fault drill provided by an embodiment of the present application; Figure 2 is a schematic flowchart of another method for configuring a fault drill provided by an embodiment of the present application; Figure 3 is a schematic flowchart of another method for configuring a fault drill provided by an embodiment of the present application; Figure 4 is a schematic flowchart of another method for configuring a fault drill provided by an embodiment of the present application; Figure 5 is a schematic flowchart of another method for configuring a fault drill provided by an embodiment of the present application; Figure 6A schematic flowchart of another method for configuring fault drills provided by an embodiment of the present application; Figure 7 A schematic flowchart of another method for configuring fault drills provided by an embodiment of the present application; Figure 8 A schematic flowchart of another method for configuring fault drills provided by an embodiment of the present application; Figure 9 An application schematic diagram of configuring fault drills provided by an embodiment of the present application; Figure 10 A schematic structural diagram of a device for configuring fault drills provided by an embodiment of the present application; Figure 11 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0011] In order to enable those skilled in the art to better understand the technical solutions in one or more of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in one or more of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0012] It should be noted that, without conflict, the embodiments in one or more of the present application and the features in the embodiments can be combined with each other. The following will refer to the accompanying drawings and combine the embodiments to detail the embodiments of the present application.
[0013] The method and device for configuring fault drills provided by the embodiments of the present invention can be applied to an electronic device, and the electronic device can be a terminal device or a server. The server can be an independent server, or a server cluster composed of multiple servers or a cloud server capable of performing cloud computing, which is not specifically limited. The terminal device can be a device such as a personal computer, or a mobile terminal device such as a mobile phone or a tablet computer, or can also be a smart wearable device, a vehicle-mounted terminal, etc., which is not specifically limited.
[0014] The application scenarios of the above method and device include but are not limited to: the scenario of automatically configuring fault drills on the electronic device of the fault drill platform. Through the above method and device, parameter information associated with the drill fault can be automatically extracted, so that a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0015] As shown Figure 1 in the figure, an embodiment of the present application provides a method for configuring a fault drill, and the method may include the following steps: S102: Generate drill objects of a preset resource type.
[0016] Among them, the resource type may include multiple types, such as a k8s cluster or a host, etc. Exemplarily, the preset resource type in the embodiment of the present application may be a k8s cluster, and the applications in the k8s cluster may be used as drill objects.
[0017] S104: Classify the parameter information of the drill objects according to the working units of the resource type.
[0018] In the embodiment of the present application, the working unit of the resource type refers to various units participating in the work in the resource type, which may be one or more, usually multiple.
[0019] In one implementation, if the preset resource type is a k8s cluster, the working units in the k8s cluster include: node, pod, and docker.
[0020] Among them, the node can be a physical machine or a virtual machine, and is responsible for running containerized applications. The pod is the smallest scheduling unit in the k8s cluster, and may include one or more containers, sharing network and storage resources. The docker is a containerization platform for creating, deploying, and running containers.
[0021] In the case where the preset resource type is a k8s cluster, the parameter information of the drill objects can be divided into three types of parameter information: nodes, pods, and docker. Among them, each type of parameter information may include one or more parameters, and the number of parameters included in various types may be equal or unequal, which is not specifically limited.
[0022] For example, the parameter information of the node type includes 1 parameter, the parameter information of the pod type includes 3 parameters, the parameter information of the docker type includes 2 parameters, etc.
[0023] S106: Determine the drill scenario and determine the target machines participating in the fault drill.
[0024] S108: Obtain the parameter information associated with the drill scenario from the classified parameter information.
[0025] S110: Generate a fault drill instruction according to the target machines and the obtained parameter information.
[0026] The above method provided by the embodiments of the present application generates a drill object of a preset resource type, classifies the parameter information of the drill object according to the work unit of the resource type, determines the drill scenario and the target machine participating in the fault drill, obtains the parameter information associated with the drill scenario from the classified parameter information, and generates a fault drill instruction according to the target machine and the obtained parameter information. This mechanism for classifying parameter information according to the work unit of the resource type can automatically extract the parameter information associated with the drill fault, so that a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0027] As Figure 2 shown, the embodiments of the present application also provide a method for configuring a fault drill, which may include the following steps: S202: Generate a drill object of a preset resource type.
[0028] Among them, the resource type can include multiple types, such as a k8s cluster or a host, etc. Exemplarily, the preset resource type in the embodiments of the present application can be a k8s cluster, and the applications in the k8s cluster can be used as drill objects.
[0029] In the embodiments of the present application, one or more new drill objects can be created, or the required drill object can be obtained by modifying the existing drill object, which is not specifically limited.
[0030] S204: Obtain the parameter information of the drill object in the k8s cluster, and classify the parameter information according to nodes, pod groups, and container engines.
[0031] Among them, the node can be a physical machine or a virtual machine, and is responsible for running containerized applications. The pod group is the smallest scheduling unit in the k8s cluster, and can include one or more containers, sharing network and storage resources. The container engine docker is a containerization platform for creating, deploying, and running containers.
[0032] In the case where the preset resource type is a k8s cluster, the parameter information of the drill object can be divided into three types of parameter information: nodes, pod groups, and container engines. Among them, each type of parameter information can include one or more parameters, and the number of parameters included in each type can be equal or unequal, which is not specifically limited.
[0033] For example, the parameter information of the node type includes 1 parameter, the parameter information of the pod group type includes 3 parameters, the parameter information of the container engine type includes 2 parameters, etc.
[0034] The above method of classifying parameter information according to nodes, container groups, and container engines summarizes the parameter information of the exercise objects from the dimension of work units, providing strong data support for extracting parameter information associated with exercise scenarios subsequently. It can realize the automatic extraction of parameter information associated with exercise scenarios based on classification, without manually configuring parameter information for each exercise scenario, greatly improving the processing efficiency, simplifying the configuration process, and saving time and personnel costs.
[0035] S206: Determine the exercise scenario and the target machines participating in the fault exercise.
[0036] S208: Obtain the parameter information associated with the exercise scenario from the classified parameter information.
[0037] S210: Generate a fault exercise instruction according to the target machines and the obtained parameter information.
[0038] The above method provided by the embodiments of the present application, based on the mechanism of classifying parameter information according to work units of resource types, can automatically extract the parameter information associated with exercise faults, so that a fault exercise instruction can be generated by combining the target machines and the extracted parameter information, realizing the automatic configuration of fault exercises, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0039] As Figure 3 shown, the embodiments of the present application also provide a method for configuring a fault exercise, which may include the following steps: S302: Generate exercise objects of a preset resource type.
[0040] Among them, the resource type may include multiple types, such as k8s clusters or hosts, etc. Exemplarily, the preset resource type in the embodiments of the present application may be a k8s cluster, and the applications in the k8s cluster can be used as exercise objects.
[0041] In the embodiments of the present application, one or more new exercise objects may be created, or the required exercise objects may be obtained by modifying the existing exercise objects, which is not specifically limited.
[0042] S304: Classify the parameter information of the exercise objects according to the work units of the resource type.
[0043] In the embodiments of the present application, the work units of the resource type refer to various units participating in the work in this resource type, which may be one or more, usually multiple.
[0044] In one implementation manner, if the preset resource type is a k8s cluster, the work units in the k8s cluster include: nodes (node), container groups (pod), and container engines (docker).
[0045] Among them, the node can be a physical machine or a virtual machine, and is responsible for running containerized applications. The pod is the smallest scheduling unit in the k8s cluster and can include one or more containers, sharing network and storage resources. The container engine docker is a containerization platform used to create, deploy, and run containers.
[0046] In the case where the preset resource type is a k8s cluster, the parameter information of the drill object can be divided into three types of parameter information: nodes, pods, and container engines. Among them, each type of parameter information can include one or more parameters, and the number of parameters included in each type can be equal or unequal, which is not specifically limited.
[0047] For example, the parameter information of the node type includes 1 parameter, the parameter information of the pod type includes 3 parameters, and the parameter information of the container engine type includes 2 parameters, etc.
[0048] S306: Select one or more drill scenarios and determine the associated work units for each selected drill scenario.
[0049] In the embodiments of the present application, there can be various drill scenarios, including but not limited to at least one of the following: system resources, CPU resources, memory resources, disk resources, network resources, application processes, container resources, JAVA processes, etc. Among them, the work units associated with each drill scenario can be one or more, which is not specifically limited.
[0050] For example, drill scenario 1 is an application process, and the associated work unit is the pod. Drill scenario 2 is CPU resources, and the associated work units include the node and the container engine docker.
[0051] Among them, in the case of selecting multiple drill scenarios, the work units associated with each drill scenario can be selected sequentially, or the work units associated with each drill scenario can also be selected synchronously in parallel, which is not specifically limited.
[0052] The above method of selecting one or more drill scenarios and their associated work units helps to obtain the corresponding parameter information according to the work units in the classified parameter information, so as to obtain the parameter information associated with the drill scenario. This not only helps to improve the processing efficiency, but also the drill scenarios and work units can be combined in various ways, and the configuration is relatively flexible.
[0053] S308: Determine the target machines participating in the fault drill.
[0054] S310: Obtain the parameter information associated with the drill scenario from the classified parameter information.
[0055] S312: Generate a fault drill instruction based on the target machine and the obtained parameter information.
[0056] Based on the mechanism of classifying parameter information by work units of resource types, the method provided in the embodiments of this application can automatically extract parameter information related to the drill fault. Thus, a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of fault drills, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0057] As Figure 4 shown, the embodiments of this application also provide a method for configuring fault drills, which may include the following steps: S402: Generate drill objects of a preset resource type.
[0058] Among them, there can be multiple resource types, such as k8s clusters or hosts, etc. Exemplarily, the preset resource type in the embodiments of this application can be a k8s cluster, and the applications in the k8s cluster can be used as drill objects.
[0059] In the embodiments of this application, one or more new drill objects can be created, or the required drill objects can be obtained by modifying the existing drill objects, which is not specifically limited.
[0060] S404: Classify the parameter information of the drill objects according to the work units of the resource type.
[0061] In the embodiments of this application, the work units of the resource type refer to various units participating in the work in this resource type, which can be one or more, usually multiple.
[0062] In one implementation, if the preset resource type is a k8s cluster, the work units in the k8s cluster include: nodes, pods, and the container engine docker.
[0063] Among them, a node can be a physical machine or a virtual machine, responsible for running containerized applications. A pod is the smallest scheduling unit in a k8s cluster, which can include one or more containers and share network and storage resources. The container engine docker is a containerization platform used to create, deploy, and run containers.
[0064] When the preset resource type is a k8s cluster, the parameter information of the drill objects can be divided into three types of parameter information: nodes, pods, and the container engine. Among them, each type of parameter information can include one or more parameters, and the number of parameters included in various types can be equal or unequal, which is not specifically limited.
[0065] For example, the parameter information of the node type includes 1 parameter, the parameter information of the container group type includes 3 parameters, the parameter information of the container engine type includes 2 parameters, and so on.
[0066] S406: Select one or more drill scenarios, and determine the associated work units for each selected drill scenario.
[0067] In the embodiments of the present application, there can be various drill scenarios, including but not limited to at least one of the following: system resources, CPU resources, memory resources, disk resources, network resources, application processes, container resources, JAVA processes, etc. Among them, the number of work units associated with each drill scenario can be one or more, and is not specifically limited.
[0068] For example, drill scenario 1 is an application process, and the associated work unit is a container group pod; drill scenario 2 is CPU resources, and the associated work units include a node and a container engine docker.
[0069] Among them, in the case of selecting multiple drill scenarios, the work units associated with each drill scenario can be selected sequentially, or the work units associated with each drill scenario can also be selected in parallel and synchronously, which is not specifically limited.
[0070] S408: Determine the target machines participating in the fault drill.
[0071] S410: For each selected drill scenario, obtain the parameter information of the type of work unit in the classified parameter information according to the work unit associated with the drill scenario, as the parameter information associated with the drill scenario.
[0072] In the embodiments of the present application, when there is one selected drill scenario, the above step S810 is executed once; when there are multiple selected drill scenarios, the above step S810 can be executed multiple times, that is, step S810 is executed once for each drill scenario, so that the parameter information associated with multiple drill scenarios can be obtained.
[0073] For example, 3 drill scenarios are selected. Drill scenario 1 is disk resources, and the associated work unit is a container group pod. Drill scenario 2 is container resources, and the associated work units include a container group pod and a container engine docker. Drill scenario 3 is a JAVA process, and the associated work units include: a node, a container group pod, and a container engine docker.
[0074] The above method of selecting each drill scenario and its associated work units can be selected according to needs, and the execution method is relatively flexible. The combination of multiple work units and the combination of multiple drill scenarios can implement various different fault drills, with a flexible method and a wider application scenario.
[0075] S412: Generate a fault drill instruction based on the target machine and the obtained parameter information.
[0076] Based on the mechanism of classifying parameter information according to the work units of resource types, the method provided by the embodiments of the present application can automatically extract the parameter information associated with the drill fault. Thus, a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of fault drills, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0077] As Figure 5 shown, the embodiments of the present application also provide a method for configuring a fault drill, and the method may include the following steps: S502: Generate a drill object of a preset resource type.
[0078] Among them, the resource type may include multiple types, such as a k8s cluster or a host, etc. Exemplarily, the preset resource type in the embodiments of the present application may be a k8s cluster, and the applications in the k8s cluster may be used as drill objects.
[0079] In the embodiments of the present application, one or more new drill objects may be created, or the required drill object may be obtained by modifying the existing drill object, which is not specifically limited.
[0080] S504: Classify the parameter information of the drill object according to the work units of the resource type.
[0081] In the embodiments of the present application, the work unit of the resource type refers to various units participating in the work in this resource type, which may be one or more, usually multiple.
[0082] In one implementation, if the preset resource type is a k8s cluster, the work units in the k8s cluster include: node, pod, and docker.
[0083] Among them, the node can be a physical machine or a virtual machine, responsible for running containerized applications. The pod is the smallest scheduling unit in the k8s cluster, which may include one or more containers and share network and storage resources. The docker is a containerization platform used to create, deploy, and run containers.
[0084] In the case where the preset resource type is a k8s cluster, the parameter information of the drill object can be divided into three types of parameter information: node, pod, and docker. Among them, each type of parameter information may include one or more parameters, and the number of parameters included in each type may be equal or unequal, which is not specifically limited.
[0085] For example, the parameter information of the node type includes 1 parameter, the parameter information of the container group type includes 3 parameters, the parameter information of the container engine type includes 2 parameters, and so on.
[0086] S506: Determine the drill scenario, and select one or more machines from the preset machine list as the target machines participating in the fault drill.
[0087] Among them, the preset machine list includes information of multiple machines, such as the names or IP (Internet Protocol) addresses of the machines, etc., which are not specifically limited. One or more machines can be selected as the target machines participating in the fault drill according to the machine information. Exemplarily, a specified number of machines can be randomly selected, or machines meeting the rules can be selected according to the preset rules, etc., which are not specifically limited.
[0088] The above method of selecting target machines in the machine list can be selected according to needs, and the execution method is relatively flexible. Different target machines can be selected to execute different fault drills, and the application scenarios are more extensive.
[0089] S508: Obtain the parameter information associated with the drill scenario from the classified parameter information.
[0090] S510: Generate a fault drill instruction according to the target machines and the obtained parameter information.
[0091] The above method provided by the embodiments of the present application, based on the mechanism of classifying parameter information by work units of resource types, can automatically extract the parameter information associated with the drill faults, so that a fault drill instruction can be generated by combining the target machines and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0092] As Figure 6 shown, the embodiments of the present application also provide a method for configuring a fault drill, and the method may include the following steps: S602: Generate a drill object of a preset resource type.
[0093] Among them, the resource types may include multiple types, such as k8s clusters or hosts, etc. Exemplarily, the preset resource type in the embodiments of the present application may be a k8s cluster, and the applications in the k8s cluster can be used as the drill objects.
[0094] In the embodiments of the present application, one or more new drill objects can be created, or the required drill objects can be obtained by modifying the existing drill objects, which are not specifically limited.
[0095] S604: Classify the parameter information of the exercise object according to the work units of the resource type.
[0096] In the embodiments of the present application, the work unit of the resource type refers to various units participating in the work in this resource type, which can be one or more, usually multiple.
[0097] In one implementation, the preset resource type is the k8s cluster. Then the work units in the k8s cluster include: node, pod, and docker.
[0098] Among them, the node can be a physical machine or a virtual machine, responsible for running containerized applications. The pod is the smallest scheduling unit in the k8s cluster, which can include one or more containers and share network and storage resources. The docker is a containerization platform used to create, deploy, and run containers.
[0099] In the case where the preset resource type is the k8s cluster, the parameter information of the exercise object can be divided into three types of parameter information: node, pod, and docker. Among them, each type of parameter information can include one or more parameters, and the number of parameters included in various types can be equal or unequal, which is not specifically limited.
[0100] For example, the parameter information of the node type includes 1 parameter, the parameter information of the pod type includes 3 parameters, and the parameter information of the docker type includes 2 parameters, etc.
[0101] S606: Determine the exercise scenario and determine the target machines participating in the fault exercise.
[0102] S608: Obtain the parameter information associated with the exercise scenario from the classified parameter information.
[0103] S610: Concatenate the target machines and the obtained parameter information, and assemble the concatenated information according to the exercise scenario to generate a fault exercise instruction.
[0104] Among them, in the case where there are multiple target machines, the parameter information of each machine can be obtained by concatenation. For example, there are 2 target machines, machine 1 corresponding to IP address 1 and machine 2 corresponding to IP address 2. The parameter information of machine 1 after concatenation includes: the CPU list cpu-list of machine 1, the workspace name namespace of machine 1, the pod name of machine 1, the container name of machine 1, and the labels of machine 1. The parameter information of machine 2 after concatenation includes: the CPU list cpu-list of machine 2, the workspace name namespace of machine 2, the pod name of machine 2, the container name of machine 2, and the labels of machine 2.
[0105] In the embodiments of the present application, assembling the spliced information according to the drill scenario includes two cases: the case of one drill scenario and the case of multiple drill scenarios. In the case of one drill scenario, the spliced information under this drill scenario is directly used to generate a fault drill instruction. In the case of multiple drill scenarios, first assemble the spliced information under each drill scenario together, and then use the assembled information to generate a fault drill instruction.
[0106] For example, if the drill scenario includes system resources and network resources, first assemble the spliced information under the drill scenario of system resources and the spliced information under the drill scenario of network resources, and then use the assembled information of the two drill scenarios to generate a fault drill instruction.
[0107] The above method of generating a fault drill instruction based on splicing and assembling can generate a fault drill instruction after combining various drill scenario combinations based on parameter information, which not only greatly improves the configuration efficiency of fault drills, but also has a flexible usage method and wide application changes.
[0108] The above method provided by the embodiments of the present application, based on the mechanism of classifying parameter information according to the work unit of the resource type, can automatically extract the parameter information associated with the drill fault, so that a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0109] As Figure 7 shown, the embodiments of the present application also provide a method for configuring a fault drill, and this method may include the following steps: S702: Generate a drill object of a preset resource type.
[0110] Among them, the resource type may include multiple types, such as a k8s cluster or a host, etc. Exemplarily, the preset resource type in the embodiments of the present application may be a k8s cluster, and the applications in the k8s cluster can be used as drill objects.
[0111] In the embodiments of the present application, one or more new drill objects can be created, or the required drill object can be obtained by modifying the existing drill object, which is not specifically limited.
[0112] S704: Classify the parameter information of the drill object according to the work unit of the resource type.
[0113] In the embodiments of the present application, the work unit of the resource type refers to various units participating in the work in this resource type, which can be one or more, usually multiple.
[0114] In one implementation, if the preset resource type is a k8s cluster, the working units in the k8s cluster include: nodes, pods, and the container engine docker.
[0115] Among them, a node can be a physical machine or a virtual machine and is responsible for running containerized applications. A pod is the smallest scheduling unit in the k8s cluster and can include one or more containers, sharing network and storage resources. The container engine docker is a containerization platform used to create, deploy, and run containers.
[0116] When the preset resource type is a k8s cluster, the parameter information of the drill object can be divided into three types of parameter information: nodes, pods, and container engines. Among them, each type of parameter information can include one or more parameters, and the number of parameters included in each type can be equal or unequal, without specific limitation.
[0117] For example, the parameter information of the node type includes 1 parameter, the parameter information of the pod type includes 3 parameters, and the parameter information of the container engine type includes 2 parameters, etc.
[0118] S706: Cache the classified parameter information for subsequent fault drills.
[0119] This way of caching the classified parameter information can directly obtain the parameter information from the cache without reclassifying the parameter information when performing subsequent fault drills, which can improve the processing efficiency and save time costs.
[0120] S708: Determine the drill scenario and the target machines participating in the fault drill.
[0121] S710: Obtain the parameter information associated with the drill scenario from the classified parameter information.
[0122] S712: Generate a fault drill instruction based on the target machines and the obtained parameter information.
[0123] The above method provided by the embodiments of the present application, based on the mechanism of classifying parameter information according to the working units of the resource type, can automatically extract the parameter information associated with the drill fault, so that a fault drill instruction can be generated by combining the target machines and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, and saving time and personnel costs.
[0124] As Figure 8 shown, the embodiments of the present application provide another method for configuring a fault drill. Taking the preset resource type as a k8s cluster as an example, this method may include the following steps: S802: Generate a drill object for the k8s cluster.
[0125] Among them, one or more new drill objects can be created, or the required drill object can be obtained by modifying the existing drill object, and there is no specific limitation.
[0126] S804: Obtain the parameter information of the drill object in the k8s cluster, and classify the parameter information according to nodes, container groups, and container engines.
[0127] In one implementation manner, after the above step S804, the following may further be included: Cache the classified parameter information for subsequent failure drills.
[0128] In the embodiments of the present application, the method of classifying parameter information in real time does not require caching the classified data, which can save storage space. The method of caching the classified parameter information does not require classifying the parameter information again when performing subsequent failure drills, and directly obtains it from the cache, which can improve the processing efficiency and save time costs. In specific implementations, according to needs, the method of classifying parameter information in real time or the method of caching the classified parameter information can be adopted, and there is no specific limitation.
[0129] S806: Select one or more drill scenarios, and determine the associated work units for each selected drill scenario.
[0130] In the embodiments of the present application, there can be various drill scenarios, including but not limited to at least one of the following: system resources, CPU resources, memory resources, disk resources, network resources, application processes, container resources, JAVA processes, etc. Among them, the associated work units for each drill scenario can be one or more, and there is no specific limitation.
[0131] For example, drill scenario 1 is an application process, and the associated work unit is a container group pod; drill scenario 2 is CPU resources, and the associated work units include a node node and a container engine docker.
[0132] Among them, in the case of selecting multiple drill scenarios, the associated work units of each drill scenario can be selected sequentially, or the associated work units of each drill scenario can also be selected in parallel and synchronously, and there is no specific limitation.
[0133] S808: Select one or more machines from the preset machine list as the target machines participating in the failure drill.
[0134] Among them, the preset machine list includes information of multiple machines, such as the name or IP (Internet Protocol) address of the machine, etc., without specific limitation. One or more machines can be selected as the target machines participating in the fault drill according to the machine information. Exemplarily, a specified number of machines can be randomly selected, or machines meeting the rules can be selected according to the preset rules, etc., without specific limitation.
[0135] S810: For each selected drill scenario, according to the work unit associated with the drill scenario, obtain the parameter information of the type of work unit in the classified parameter information as the parameter information associated with the drill scenario.
[0136] In the embodiment of the present application, when the number of selected drill scenarios is one, the above step S810 is executed once. When the number of selected drill scenarios is multiple, the above step S810 can be executed repeatedly, that is, step S810 is executed once for each drill scenario, so that parameter information associated with multiple drill scenarios can be obtained.
[0137] For example, the number of selected drill scenarios is 3. Drill scenario 1 is disk resources, and the associated work unit is the container group pod. Drill scenario 2 is container resources, and the associated work units include the container group pod and the container engine docker. Drill scenario 3 is the JAVA process, and the associated work units include: node, container group pod, and container engine docker.
[0138] S812: Concatenate the target machines and the obtained parameter information, and assemble the concatenated information according to the drill scenario to generate a fault drill instruction.
[0139] Among them, when the number of target machines is multiple, the parameter information of each machine can be obtained by concatenation. For example, the number of target machines is 2, machine 1 corresponding to IP address 1 and machine 2 corresponding to IP address 2. The parameter information of machine 1 after concatenation includes: the CPU list cpu-list of machine 1, the workspace name namespace of machine 1, the pod name of machine 1, the container name of machine 1, and the labels of machine 1. The parameter information of machine 2 after concatenation includes: the CPU list cpu-list of machine 2, the workspace name namespace of machine 2, the pod name of machine 2, the container name of machine 2, and the labels of machine 2.
[0140] In the embodiments of the present application, assembling the spliced information according to the drill scenario includes two cases, one drill scenario and multiple drill scenarios. In the case of one drill scenario, the spliced information under the drill scenario is directly used to generate a fault drill instruction. In the case of multiple drill scenarios, the spliced information under each drill scenario is first assembled together, and then the assembled information is used to generate a fault drill instruction.
[0141] For example, if the drill scenario includes system resources and network resources, the spliced information under the drill scenario of system resources and the spliced information under the drill scenario of network resources are first assembled, and then the assembled information of the two drill scenarios is used to generate a fault drill instruction.
[0142] In the above method provided by the embodiments of the present application, by generating a drill object of the k8s cluster, classifying the parameter information of the drill object according to nodes, container groups, and container engines, determining the drill scenario and the target machine participating in the fault drill, obtaining the parameter information associated with the drill scenario from the classified parameter information, and generating a fault drill instruction according to the target machine and the obtained parameter information, this mechanism for classifying parameter information based on nodes, container groups, and container engines can automatically extract the parameter information associated with the drill fault, so that a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of the k8s cluster fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, saving time and personnel costs, and lowering the usage threshold of the fault drill configuration.
[0143] In addition, in any of the above embodiments provided by the present application, before classifying the parameter information of the drill object according to the work unit of the resource type, it is necessary to first obtain the parameter information of the drill object, which can be specifically implemented in various ways. For example, in the k8s cluster scenario, tools of the k8s cluster can be used to obtain the parameter information of the drill object. The embodiments of the present application do not make specific limitations on this. The following combination of Figure 9 takes the example of an agent in the k8s cluster using a probe to obtain the parameter information of the drill object for illustration.
[0144] Figure 9 This is an application schematic diagram of configuring a fault drill provided by the embodiments of the present application. As Figure 9As shown in the figure, first create or edit a drill object on the fault drill platform, and select a drill object with the resource type of k8s cluster. Search for the proxy agent information of the k8s cluster corresponding to the drill object in the database to determine the corresponding agent. This agent uses a probe to obtain the parameter information of the drill object and returns it to the fault drill platform. The fault drill platform classifies the obtained parameter information according to nodes, pods, and docker, and caches the classification results. Then select one or more target machines, and select one or more drill scenarios, and determine the associated work units for each selected drill scenario. Obtain the parameter information of the type of this work unit from the classified parameter information as the parameter information associated with the drill scenario. Concatenate the target machines and the obtained parameter information, and assemble the concatenated information according to the drill scenario to generate a fault drill instruction. Finally, save the generated fault drill instruction to the database for subsequent execution of the fault drill at any time.
[0145] The above is the method for configuring a fault drill provided by the embodiment of the present application. Based on the same technical concept, the embodiment of the present application also provides a device for configuring a fault drill, as Figure 10 shown, the device includes: a generation module 1001, a classification module 1002, a determination module 1003, an acquisition module 1004, and a configuration module 1005.
[0146] The generation module 1001 is used to generate a drill object of a preset resource type.
[0147] The classification module 1002 is used to classify the parameter information of the drill object according to the work units of the resource type.
[0148] The determination module 1003 is used to determine the drill scenario and determine the target machines participating in the fault drill.
[0149] The acquisition module 1004 is used to obtain the parameter information associated with the drill scenario from the classified parameter information.
[0150] The configuration module 1005 is used to generate a fault drill instruction according to the target machines and the obtained parameter information.
[0151] In the embodiment of the present application, in the case where the resource type is a k8s cluster, the classification module 1002 may specifically be used to: obtain the parameter information of the drill object in the k8s cluster, and classify the parameter information according to nodes, container groups, and container engines.
[0152] In the embodiment of the present application, when the determination module 1003 determines the drill scenario, it may specifically be used to: select one or more drill scenarios, and determine the associated work units for each selected drill scenario.
[0153] Accordingly, the obtaining module 1004 can be specifically configured to: for each selected drill scenario, obtain the parameter information of the type of work unit from the classified parameter information according to the work unit associated with the drill scenario, as the parameter information associated with the drill scenario.
[0154] In the embodiment of the present application, when determining the target machine participating in the fault drill, the determining module 1003 can be specifically configured to: select one or more machines from the preset machine list as the target machines participating in the fault drill.
[0155] In the embodiment of the present application, the configuration module 1005 can be specifically configured to: splice the target machine and the obtained parameter information, and assemble the spliced information according to the drill scenario to generate a fault drill instruction.
[0156] In the embodiment of the present application, the above device may further include: A caching module, configured to cache the classified parameter information for subsequent use in fault drills.
[0157] In the embodiment of the present application, the method of classifying the parameter information in real time does not require caching the classified data, which can save storage space. The method of caching the classified parameter information does not require re-classifying the parameter information during subsequent execution of the fault drill, and directly obtains it from the cache, which can improve the processing efficiency and save time costs. In specific implementation, according to needs, the method of classifying the parameter information in real time or the method of caching the classified parameter information can be adopted, and the specific method is not limited.
[0158] The above device provided in this embodiment can execute the steps in the methods provided in the above various embodiments. For the detailed process, refer to the description in the method embodiments, and details are not described herein again.
[0159] The above device provided in this embodiment, through the mechanism of classifying parameter information based on work units of resource types, can automatically extract the parameter information associated with the drill fault, so that a fault drill instruction can be generated by combining the target machine and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, saving time and personnel costs, and lowering the usage threshold of the fault drill configuration.
[0160] Corresponding to the methods provided in the above various embodiments, based on the same technical concept, the embodiment of the present application also provides an electronic device for executing the methods provided in the above various embodiments, as Figure 11 shown.
[0161] Electronic devices can vary significantly due to different configurations or performances. They may include one or more processors 1101 and a memory 1102. One or more application programs or data can be stored in the memory 1102. Among them, the memory 1102 can be transient storage or persistent storage. The application programs stored in the memory 1102 can include one or more modules (not shown in the figure), and each module can include a series of computer-executable instructions for the electronic device. Further, the processor 1101 can be configured to communicate with the memory 1102 and execute a series of computer-executable instructions in the memory 1102 on the electronic device. The electronic device can also include one or more power supplies 1103, one or more wired or wireless network interfaces 1104, one or more input / output interfaces 1105, one or more keyboards 1106, etc.
[0162] The electronic device includes a memory and one or more programs. One or more of the programs are stored in the memory, and one or more of the programs can include one or more modules. Each module can include a series of computer-executable instructions for the electronic device and is configured to be executed by one or more processors. The one or more programs include the following computer-executable instructions for: Generating a drill object of a preset resource type; classifying the parameter information of the drill object according to the work units of the resource type; determining a drill scenario and determining the target machines participating in the fault drill; obtaining the parameter information associated with the drill scenario from the classified parameter information; generating a fault drill instruction according to the target machines and the obtained parameter information.
[0163] In one implementation, the resource type is a k8s cluster. The classifying the parameter information of the drill object according to the work units of the resource type includes: obtaining the parameter information of the drill object in the k8s cluster; classifying the parameter information according to nodes, container groups, and container engines.
[0164] In one implementation, the determining the drill scenario includes: selecting one or more drill scenarios and determining the associated work units for each selected drill scenario.
[0165] In one implementation, the obtaining the parameter information associated with the drill scenario from the classified parameter information includes: for each selected drill scenario, obtaining the parameter information of the type of the work unit associated with the drill scenario from the classified parameter information as the parameter information associated with the drill scenario.
[0166] In one implementation, the determination of the target machines participating in the fault drill includes: selecting one or more machines from a preset machine list as the target machines participating in the fault drill.
[0167] In one implementation, the generation of the fault drill instruction according to the target machines and the obtained parameter information includes: splicing the target machines and the obtained parameter information; assembling the spliced information according to the drill scenario to generate a fault drill instruction.
[0168] In one implementation, an instruction can also be executed: caching the classified parameter information for subsequent fault drills.
[0169] The above electronic device provided by the embodiments of the present application, through the mechanism of classifying parameter information by work units based on resource types, can automatically extract the parameter information associated with the drill faults, so that fault drill instructions can be generated by combining the target machines and the extracted parameter information, realizing the automatic configuration of fault drills, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, saving time and personnel costs, and reducing the usage threshold of fault drill configuration.
[0170] It should be noted that the embodiments of the electronic device in the present application and the method embodiments in the present application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding method described above, and the repeated parts will not be elaborated.
[0171] Corresponding to the method provided in the above embodiments, based on the same technical concept, the embodiments of the present application also provide a computer-readable storage medium for storing computer-executable instructions. The storage medium can be a USB flash drive, an optical disc, a hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by a processor, the following processes can be realized: Generating a drill object of a preset resource type; classifying the parameter information of the drill object according to the work units of the resource type; determining the drill scenario and determining the target machines participating in the fault drill; obtaining the parameter information associated with the drill scenario from the classified parameter information; Generating a fault drill instruction according to the target machines and the obtained parameter information.
[0172] In one implementation, the resource type is a k8s cluster, and the classification of the parameter information of the drill object according to the work units of the resource type includes: obtaining the parameter information of the drill object in the k8s cluster; classifying the parameter information according to nodes, container groups, and container engines.
[0173] In one implementation, the determining of the drill scenario includes: selecting one or more drill scenarios and determining associated work units for each selected drill scenario.
[0174] In one implementation, the obtaining of the parameter information associated with the drill scenario from the classified parameter information includes: for each selected drill scenario, obtaining, according to the work unit associated with the drill scenario, the parameter information of the type of the work unit from the classified parameter information as the parameter information associated with the drill scenario.
[0175] In one implementation, the determining of the target machines participating in the fault drill includes: selecting one or more machines from a preset list of machines as the target machines participating in the fault drill.
[0176] In one implementation, the generating of the fault drill instruction according to the target machines and the obtained parameter information includes: splicing the target machines and the obtained parameter information; assembling the spliced information according to the drill scenario to generate the fault drill instruction.
[0177] In one implementation, an instruction can also be executed: caching the classified parameter information for subsequent use in the fault drill.
[0178] When the computer-executable instructions stored in the storage medium in the embodiments of the present application are executed by a processor, through the mechanism of classifying parameter information by work units based on resource types, the parameter information associated with the drill fault can be automatically extracted. Thus, a fault drill instruction can be generated by combining the target machines and the extracted parameter information, realizing the automatic configuration of the fault drill, simplifying the configuration process, improving the processing efficiency, reducing the technical requirements for operators, saving time and personnel costs, and lowering the usage threshold for the configuration of the fault drill.
[0179] It should be noted that the embodiments of the storage medium in the present application and the method embodiments in the present application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the foregoing method, and the repeated parts will not be elaborated.
[0180] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain implementations, multitasking and parallel processing are also possible or may be advantageous.
[0181] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present application can take the form of an all-hardware embodiment, an all-software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0182] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0183] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that realizes the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks. These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0184] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory. The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media. Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for information storage. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transitory media for storing information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0185] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.
[0186] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present application may also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media including storage devices. Each embodiment in the present application is described in a progressive manner. For parts that are the same or similar among the embodiments, reference may be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, reference may be made to the partial description of the method embodiment.
[0187] The above are only embodiments of this document and are not intended to limit this document. For those skilled in the art, various changes and modifications can be made to this document. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document shall be included within the scope of the claims of this document.
Claims
1. A method for configuring a fault drill, characterized in that: The method comprises: Generate a drill object of a preset resource type; Classifying the parameter information of the drill object according to the work unit of the resource type; Determine the drill scenario and the target machines to participate in the fault drill; Acquire parameter information associated with the drill scenario from the classified parameter information; Generate a fault drill instruction according to the target machine and the acquired parameter information.
2. The method according to claim 1, characterized in that The resource type is a k8s cluster, and the parameter information of the drill object is classified according to the work unit of the resource type, including: Get the parameter information of the drill object in the k8s cluster; The parameter information is classified according to nodes, container groups, and container engines.
3. The method according to claim 1, characterized in that The determination of the drill scenario includes: Select one or more drill scenarios and determine the associated work unit for each selected drill scenario.
4. The method according to claim 3, characterized in that The acquiring the parameter information associated with the drill scenario from the classified parameter information includes: For each selected drill scenario, according to the work unit associated with the drill scenario, parameter information of the type of the work unit is obtained from the classified parameter information as the parameter information associated with the drill scenario.
5. The method according to claim 1, characterized in that The step of determining a target machine to participate in the fault drill includes: Select one or more machines from the preset machine list as target machines for the fault drill.
6. The method according to claim 1, characterized in that The generating of the fault drill instruction according to the target machine and the acquired parameter information includes: Splicing the target machine and the acquired parameter information; The spliced information is assembled according to the drill scenario to generate fault drill instructions.
7. The method according to any one of claims 1 to 6, characterized in that Also includes: The classified parameter information is cached for use in subsequent fault drills.
8. A device for configuring a fault drill, characterized in that: The device comprises: A generation module, used to generate a drill object of a preset resource type; A classification module, used for classifying the parameter information of the exercise object according to the work unit of the resource type; A determination module, used to determine the drill scenario and the target machine involved in the fault drill; An acquisition module, used to acquire parameter information associated with the drill scenario from the classified parameter information; The configuration module is used to generate a fault drill instruction according to the target machine and the acquired parameter information.
9. An electronic device, characterized in that: The device comprises: Processor; and A memory arranged to store computer executable instructions, wherein the executable instructions are configured to be executed by the processor, and the executable instructions include instructions for executing the steps in the method for configuring fault drill according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium is used to store computer-executable instructions, and the executable instructions enable a computer to execute the steps in the method for configuring fault drills as described in any one of claims 1 to 7.