Fault testing method and server
Through random algorithms and fault testing strategies, comprehensive fault testing is performed on hyper-converged clusters, which solves the shortcomings of hyper-converged clusters in fault testing and improves the coverage of fault testing and the stability and reliability of the cluster.
Patent Information
- Application Number
- CN202410639592.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-03
AI Technical Summary
Existing technologies fail to effectively solve the stability problems of hyper-converged clusters caused by network or hardware failures, and lack effective fault testing methods.
Using a method based on random algorithms and fault testing strategies, we conduct comprehensive fault testing on the server cluster. By comparing performance data before and after the fault test, we evaluate the stability and reliability of the cluster under various fault conditions, and provide targeted guidance to improve the cluster. performance and availability.
It improves the coverage and comprehensiveness of fault testing, evaluates the performance of server clusters in the face of various fault conditions, helps administrators optimize and manage server clusters, and enhances its stability and reliability.
Smart Images

Figure CN118585364A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of servers, and in particular to a fault testing method and a server. Background Art
[0002] With the rapid development of computing technology, storage technology and network technology, hyper-convergence technology has emerged. Hyper-convergence technology is an Internet solution that integrates computing, storage and network functions. Hyper-convergence technology integrates computing and storage resources in a software-defined way and provides them to users through virtualization technology.
[0003] A hyperconverged Infrastructure (HCI) cluster is a cluster consisting of multiple computing devices, each of which integrates computing, storage, and network functions. The server can perform tasks as a host to realize the relevant business functions of the hyperconverged platform. The hyperconverged platform is a software platform based on the hyperconverged cluster and an overall solution built on hyperconverged technology. The hyperconverged cluster organizes the computing resources and storage resources in the cluster by using virtualization and management software, realizing resource sharing and management.
[0004] Hyper-converged clusters integrate all physical hardware resources of multiple physical computing devices through the network. Various problems that affect the stability of the hyper-converged cluster often occur due to factors such as network or hardware failures. The larger the hyper-converged cluster, the more computing nodes, and the more complex the network, the greater the probability of failure. Therefore, effective and continuous reliability testing of the hyper-converged system is required to ensure the normal operation of the hyper-converged cluster.
[0005] The related art does not provide an effective solution to implement fault testing on a hyper-converged cluster. Summary of the invention
[0006] In view of this, an embodiment of the present application provides a fault testing method and a server, aiming to solve the problem of being unable to perform fault testing on a hyper-converged cluster.
[0007] In a first aspect, the present application provides a fault testing method, the method comprising:
[0008] Performing a fault test on the server cluster based on a random algorithm and a fault test strategy corresponding to the server cluster; the fault test strategy is used to limit the test scope of the fault test;
[0009] The first performance data and the second performance data are compared to obtain the test result of the server cluster; the first performance data is the performance data of the server cluster before the fault test, and the second performance data is the performance data of the server cluster after the fault test.
[0010] In the embodiment of the present application, the server cluster is tested based on the fault testing strategy and random algorithm to ensure that the fault test covers various possible fault conditions, thereby improving the fault coverage and the comprehensiveness of the test, and then testing the performance of the server cluster under various fault conditions. In addition, by comparing the performance data before and after the fault test, the stability and reliability of the server cluster in the face of various fault conditions are evaluated, providing guidance for subsequent server cluster optimization and management work. Managers can adjust and optimize the server cluster in a targeted manner based on the test results to improve the performance and availability of the server cluster.
[0011] In a possible implementation, the performing a fault test on the server cluster based on a random algorithm and a fault test strategy corresponding to the server cluster includes:
[0012] Determine the fault type of the fault test using a random algorithm;
[0013] If the fault type is a cluster fault, a cluster fault is selected from a cluster fault library by a random algorithm, and the cluster fault is injected into the server cluster for cluster fault testing;
[0014] as well as;
[0015] If the fault type is a non-cluster fault, a non-cluster fault test is performed on the server cluster by a random algorithm within the test range defined by the fault test strategy.
[0016] In an embodiment of the present application, the use of a random algorithm to determine the fault type can increase the diversity and coverage of fault testing, simulate various types of fault conditions, and thus better test the stability and reliability of the server cluster. For cluster faults, a random algorithm is used to select faults from a cluster fault library and inject them into a server cluster, so that cluster-level fault conditions can be simulated, such as overall power failure of a server cluster, etc., to test the performance of the server cluster in the face of cluster-level faults and evaluate its fault tolerance. For non-cluster faults, a random algorithm is used to test the performance of the server cluster in the face of non-cluster-level faults and evaluate its fault tolerance according to the test scope defined by the fault testing strategy. This method can cover a variety of fault types and conditions, and the use of a random algorithm increases the randomness and scalability of fault testing. Even in the absence of clearly specified fault conditions, the server cluster can be effectively tested.
[0017] In a possible implementation, the method further includes:
[0018] The fault testing strategy is determined according to the data plane strategy, management plane architecture and total number of servers of the server cluster.
[0019] In an embodiment of the present application, a fault testing strategy is determined in combination with the data plane strategy, management plane architecture and total number of servers of the server cluster, and corresponding fault testing strategies are formulated for different server clusters to improve the pertinence and effectiveness of fault testing and further strengthen the testing of server cluster performance and stability.
[0020] In a possible implementation, the fault testing strategy includes an allowable number of faults, a number of business nodes, a first number of degraded faults, and a first number of general faults; the allowable number of faults is the maximum number of servers in the server cluster that are allowed to have degraded faults; the number of business nodes is the number of servers in the server cluster that do not participate in non-cluster fault testing; the first number of degraded faults is the maximum number of servers in the server cluster that undergo degraded fault testing; and the first number of general faults is the maximum number of servers in the server cluster that undergo general fault testing.
[0021] In the embodiment of the present application, various parameters are set to control the test range of the fault test and ensure accurate implementation of the fault test.
[0022] In a possible implementation, determining the fault test strategy according to the data plane strategy, management plane architecture, and total number of servers of the server cluster includes:
[0023] Determining the allowed number of failures according to the data plane policy and the management plane architecture;
[0024] According to the absolute value of the difference between the allowed number of failures and the total number of servers, the value range of the number of business nodes is determined, and the absolute value of the difference between the total number of servers and the number of business nodes is used as the number of test nodes; the number of business nodes is less than or equal to the absolute value of the difference between the allowed number of failures and the total number of servers; the number of test nodes is the number of servers in the server cluster that participate in the fault test;
[0025] The allowed number of faults is used as the first number of degraded faults, and the difference between the number of test nodes and the first number of degraded faults is used as the first number of general faults.
[0026] In the embodiments of the present application, different data processing methods and management architectures may affect the system's tolerance for failures, so the number of allowed failures is determined based on the data plane policy and management plane architecture. The number of business nodes refers to the number of servers that do not participate in the fault test. These servers are reserved for providing actual business services to ensure that there are still enough server resources to provide business functions during the fault test. The number of allowed failures is used as the first downgraded failure number, and the difference between the number of test nodes and the first downgraded failure number is used as the first general failure number to ensure that different failure situations are taken into account in the fault test, so as to more comprehensively evaluate the stability and reliability of the system.
[0027] In a possible implementation, if the fault type is a non-cluster fault, performing a fault test on the server cluster by using a random algorithm within a test range defined by the fault test strategy includes:
[0028] The second degradation failure number and the second general failure number are determined by a random algorithm; the second degradation failure number is the number of servers in the server cluster that undergo a degradation failure test, the second degradation failure number is less than or equal to the first degradation failure number, and the second degradation failure number is greater than or equal to 0; the second general failure number is the number of servers in the server cluster that undergo a general failure test, the second general failure number is less than or equal to the first general failure number, and the second general failure number is greater than or equal to 0;
[0029] Determine nodes to be tested for non-cluster fault testing from the server cluster by a random algorithm, wherein the number of nodes to be tested for non-cluster fault testing is equal to the sum of the second general fault number and the second degraded fault number;
[0030] Determine the degraded faults from the degraded fault library by a random algorithm, and determine the general faults from the general fault library, the number of the degraded faults being the second degraded fault number, and the number of the general faults being the second general fault number;
[0031] Establishing a test list by a random algorithm, wherein the test list is used to describe the corresponding relationship between the node to be tested and the degradation fault and the general fault;
[0032] Based on the test list, the degradation fault and the general fault are injected into the corresponding node to be tested to perform a non-cluster fault test.
[0033] In the embodiment of the present application, within the scope defined by the fault testing strategy, a comprehensive non-cluster fault test is performed on the server cluster through a random algorithm, thereby evaluating the performance of the server cluster under various non-cluster fault conditions.
[0034] In a possible implementation, determining the degradation fault from the degradation fault library by using a random algorithm and determining the general fault from the general fault library includes:
[0035] Determining the multiple degradation faults by a random algorithm according to the fault weight corresponding to each degradation fault in the degradation fault library;
[0036] And according to the fault weight corresponding to each general fault in the general fault library, the plurality of general faults are determined by a random algorithm; the fault weight is used to indicate the possibility of occurrence of the corresponding fault.
[0037] In the embodiment of the present application, by considering the fault weight, the selected fault can be more consistent with the actual possibility of occurrence, better simulate the fault conditions that may occur in the real environment, thereby improving the authenticity and effectiveness of the fault test.
[0038] In a possible implementation, the fault test strategy includes the number of fault tests, and the second performance data is performance data of the server cluster after the server cluster has undergone the fault tests for the number of fault tests.
[0039] In the embodiment of the present application, the performance and stability of the server cluster under different fault conditions can be evaluated through multiple fault tests. Each fault test can simulate the behavior of the server cluster under specific fault conditions, thereby helping to evaluate the reliability and robustness of the server cluster. The second performance data reflects the performance of the server cluster after undergoing a series of fault tests. By setting the number of fault tests and collecting the second performance data, a more comprehensive understanding of the performance and stability of the server cluster under different fault conditions can be obtained.
[0040] In a possible implementation manner, injecting the cluster fault into the server cluster to perform a cluster fault test includes:
[0041] After the server cluster status is restored, the server cluster is controlled to execute basic tasks, and fault testing is suspended when the server cluster fails to execute the basic tasks, wherein the basic tasks are tasks executed when the server cluster implements basic functions;
[0042] The performing a non-cluster fault test on the server cluster by using a random algorithm includes:
[0043] After the state of the node to be tested in the server cluster is restored, the node to be tested is controlled to execute the basic task, and the fault test is suspended when the node to be tested fails to execute the basic task.
[0044] In the embodiment of the present application, by executing the basic task after the server cluster status is restored, it is verified whether the server cluster can run normally after the failure occurs. If the server cluster fails when executing the basic task, the fault test will be suspended to prevent further damage to the server cluster or data loss.
[0045] In a second aspect, the present application provides a fault testing device for a server cluster, comprising:
[0046] A testing module, used for performing a fault test on the server cluster based on a random algorithm and a fault test strategy corresponding to the server cluster; the fault test strategy is used for limiting the test scope of the fault test;
[0047] The comparison module is used to compare the first performance data and the second performance data to obtain the test result of the server cluster; the first performance data is the performance data of the server cluster before the fault test, and the second performance data is the performance data of the server cluster after the fault test.
[0048] In a possible implementation, the test module is specifically used to determine the fault type of the fault test by using a random algorithm; if the fault type is a cluster fault, a cluster fault is selected from a cluster fault library by using a random algorithm, and the cluster fault is injected into the server cluster for cluster fault testing;
[0049] as well as;
[0050] If the fault type is a non-cluster fault, a non-cluster fault test is performed on the server cluster by a random algorithm within the test range defined by the fault test strategy.
[0051] In a possible implementation, the device further includes a determination module, which is used to determine the fault testing strategy according to the data plane strategy, management plane architecture and total number of servers of the server cluster.
[0052] In a possible implementation, the fault testing strategy includes an allowable number of faults, a number of business nodes, a first number of degraded faults, and a first number of general faults; the allowable number of faults is the maximum number of servers in the server cluster that are allowed to have degraded faults; the number of business nodes is the number of servers in the server cluster that do not participate in non-cluster fault testing; the first number of degraded faults is the maximum number of servers in the server cluster that undergo degraded fault testing; and the first number of general faults is the maximum number of servers in the server cluster that undergo general fault testing.
[0053] In a possible implementation, the determination module is specifically used to determine the allowable number of failures based on the data plane policy and the management plane architecture; determine the value range of the number of business nodes based on the absolute value of the difference between the allowable number of failures and the total number of servers, and use the absolute value of the difference between the total number of servers and the number of business nodes as the number of test nodes; the number of business nodes is less than or equal to the absolute value of the difference between the allowable number of failures and the total number of servers; the number of test nodes is the number of servers in the server cluster participating in the fault test; use the allowable number of failures as the first degraded failure number, and use the difference between the number of test nodes and the first degraded failure number as the first general failure number.
[0054] In a possible implementation, the test module is specifically used to determine a second degradation fault number and a second general fault number through a random algorithm; the second degradation fault number is the number of servers in the server cluster that undergo a degradation fault test, the second degradation fault number is less than or equal to the first degradation fault number, and the second degradation fault number is greater than or equal to 0; the second general fault number is the number of servers in the server cluster that undergo a general fault test, the second general fault number is less than or equal to the first general fault number, and the second general fault number is greater than or equal to 0; determine the server cluster that undergoes a non-cluster fault test through a random algorithm The method comprises the following steps: determining a node to be tested for a non-cluster fault test, wherein the number of the nodes to be tested for a non-cluster fault test is equal to the sum of the second general fault number and the second degradation fault number; determining degradation faults from a degradation fault library and determining general faults from a general fault library by a random algorithm, wherein the number of degradation faults is the second degradation fault number and the number of general faults is the second general fault number; establishing a test list by a random algorithm, wherein the test list is used to describe the corresponding relationship between the node to be tested and the degradation fault and the general fault; and injecting the degradation fault and the general fault into the corresponding node to be tested based on the test list to perform a non-cluster fault test.
[0055] In a possible implementation, the test module is specifically used to determine the multiple downgraded faults by a random algorithm according to the fault weights corresponding to each downgraded fault in the downgraded fault library; and to determine the multiple general faults by a random algorithm according to the fault weights corresponding to each general fault in the general fault library; the fault weights are used to indicate the possibility of occurrence of the corresponding faults.
[0056] In a possible implementation, the fault test strategy includes the number of fault tests, and the second performance data is performance data of the server cluster after the server cluster has undergone the fault tests for the number of fault tests.
[0057] In one possible implementation, the test module is specifically used to control the server cluster to execute basic tasks after the status of the server cluster is restored, and to suspend fault testing when the server cluster fails to execute the basic tasks, wherein the basic tasks are tasks executed when the server cluster implements basic functions; and, after the status of the node to be tested in the server cluster is restored, to control the node to be tested to execute the basic tasks, and to suspend fault testing when the node to be tested fails to execute the basic tasks.
[0058] In a third aspect, the present application provides a server, comprising at least one processor and at least one memory, wherein the at least one memory stores computer program instructions; the at least one processor executes the computer program instructions so that the server performs a method as described in any one of the first aspects.
[0059] In a fourth aspect, the present application provides a computer storage medium, wherein instructions are stored in the computer storage medium. When the instructions are executed on a computing device, the computing device executing the instructions implements the method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 A schematic diagram of the architecture of a server cluster provided in an embodiment of the present application;
[0062] Figure 2 A flowchart of a fault testing method provided in an embodiment of the present application;
[0063] Figure 3 A schematic diagram of a process for determining a fault testing strategy provided in an embodiment of the present application;
[0064] Figure 4 A flow chart of a server cluster fault testing process provided in an embodiment of the present application;
[0065] Figure 5 A schematic diagram of a server cluster networking environment provided in an embodiment of the present application;
[0066] Figure 6 A flowchart of another server cluster fault testing process provided in an embodiment of the present application;
[0067] Figure 7 A schematic diagram of the structure of a fault testing device provided in an embodiment of the present application;
[0068] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] It should be noted that the embodiments described in this application are only part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0070] In order to make the following embodiments clear, the technical terms involved in this application are first introduced.
[0071] A server cluster is a cluster composed of multiple interconnected computing devices. These computing devices can work together to provide users with application and data resource services. The computing devices can be connected through a high-speed network and managed through distributed resource management software (Digital Rights Management, DRM). Computing devices are, for example, devices with computing capabilities such as servers and computers. Servers can be, for example, rack servers, blade servers, high-density servers, tower servers, whole cabinet servers and other servers in various forms. The embodiments of the present application are described by taking the computing device as a server as an example.
[0072] The management plane is responsible for managing and monitoring the server cluster. The management plane provides managers with visualization and control over the resources, configuration, and status of the server cluster. The management plane is usually composed of management software, management tools, and user interfaces, and is used to configure, monitor, and adjust various parameters and settings in the cluster. The functions of the management plane include, but are not limited to: deployment and configuration of cluster nodes, monitoring the performance and health of the cluster, fault detection and recovery, resource allocation and load balancing, as well as security management and access control. The management plane simplifies the operation and maintenance of the server cluster by managers by providing various automated and intelligent functions, thereby improving the efficiency and stability of the cluster.
[0073] The data plane is responsible for data transmission and processing in the server cluster. The data plane can process requests from clients and perform related computing, storage, or forwarding operations. The data plane is mainly used to provide services to users and execute the functions of various applications and services. In a server cluster, the data plane usually includes network devices such as routers, switches, and load balancers, which are responsible for transmitting data packets between different servers and forwarding and processing them according to specific rules.
[0074] Fault testing is a testing process that evaluates the reliability of a server cluster when facing various types of faults. In fault testing, various faults, such as cluster faults or non-cluster faults, are artificially injected into the server cluster to simulate the problems that may occur in the actual production application environment of the server cluster, thereby verifying the reliability and stability of the server cluster when facing various abnormal situations. By simulating server failures or network interruptions, the automatic failover, load balancing and fault tolerance capabilities of the server cluster can be tested to ensure that various faults can be handled in a timely manner in actual operation, ensuring the high availability and stability of the system.
[0075] A cluster failure refers to a failure that makes the entire server cluster unable to execute services, such as power failure of the entire server cluster, network interruption of the server cluster, and overall failure of stacked switches.
[0076] Non-cluster failures refer to failures that affect some computing devices in a server cluster. Non-cluster failures include degradation failures and general failures. Degradation failures refer to failures that degrade the redundancy of the server cluster management plane or data plane, such as node power failure, storage network failure, and hard disk failure. General failures refer to failures other than cluster failures and degradation failures, such as certain process failures.
[0077] The number of failures to tolerate (FTT) refers to the number of computing devices that are allowed to have degraded failures in a server cluster. If the number of computing devices that have degraded failures in a server cluster is within the allowed number of failures, that is, the number of computing devices that have degraded failures is less than or equal to the allowed number of failures, the server cluster can execute services; if the number of computing devices that have degraded failures in a server cluster exceeds the allowed number of failures, that is, the number of computing devices that have degraded failures is greater than the allowed number of failures, the server cluster will be unable to execute services.
[0078] In the related art, manual fault injection is usually used. After the technician determines the fault type and computing device to be tested, the technician manually injects the fault into the computing device to implement fault testing of the server cluster. However, there are many types of faults that may occur in the server cluster, and in actual use, the server cluster may have multiple types of faults at the same time. Therefore, the test method of manually injecting faults cannot cover various fault conditions, resulting in poor accuracy of the test results; if the exhaustive method is used, it will cost a lot of manpower and time costs.
[0079] In response to this technical problem, the present application provides a testing method and server for a server cluster. Using computing devices (such as servers) outside the server cluster, the server cluster is fault tested by a random algorithm to improve the objectivity of the fault test. And the fault test strategy corresponding to the server cluster is used to limit the test scope of the fault test to ensure the feasibility of fault testing using a random algorithm. Fault testing by a random algorithm can cover various fault conditions within the scope limited by the fault test strategy, thereby achieving comprehensive testing of the server cluster and improving the accuracy of the test results.
[0080] The server cluster architecture provided by the embodiment of the present application is introduced below in conjunction with the accompanying drawings. The embodiment of the present application is described by taking the computing device as a server as an example.
[0081] like Figure 1 As shown, Figure 1 A schematic diagram of the architecture of a server cluster provided in an embodiment of the present application. The server cluster includes multiple servers, and each server in the server cluster is connected to a test server outside the server cluster. Each server in the server cluster is used to run a business; the test server is used to execute the above-mentioned test method and perform fault testing on the servers in the server cluster.
[0082] In a possible application scenario, during the operation of the server cluster, the test server executes the above test method to inject faults into some servers in the server cluster to achieve automated testing of the server cluster. After the test, the test server can detect the performance and status of the server cluster, compare the performance changes of the server cluster before and after the fault injection, and then determine whether the stability of the server cluster meets the expected standards, providing a reference for technical personnel to manage the server cluster.
[0083] In another possible application scenario, in some distributed systems, such as distributed storage and distributed databases, it is necessary to perform fault tests on each storage or database to further test the stability of the distributed storage and distributed database.
[0084] Below, taking a server cluster as an example, the fault testing method provided by the embodiment of the present application is introduced in conjunction with the accompanying drawings. The execution subject of the testing method is a computing device outside the server cluster, such as Figure 1 The test server shown in the present application embodiment is Figure 1 The test server shown is introduced as an exemplary execution subject.
[0085] like Figure 2 As shown, Figure 2 A flowchart of a fault testing method provided in an embodiment of the present application. The method includes:
[0086] S201: The test server collects first performance data of the server cluster.
[0087] The first performance data refers to the performance data when the server cluster has not failed or has not been fault-tested. The first performance data may include the central processing unit (CPU) utilization rate of the server cluster (used to indicate the CPU utilization of the server, which may include the utilization rate of each core (CPU core) in each server in the server cluster), memory utilization rate (used to indicate the memory utilization of the server cluster, such as the size of used memory and the size of available memory), disk read and write speed, network bandwidth (used to indicate the network transmission rate of the server cluster, such as upload and download speeds), response time (used to indicate the response speed of the server cluster to requests, such as average response time, maximum response time, etc.), number of concurrent connections (used to indicate the number of servers that simultaneously process services in the server cluster, which can reflect the load of the server cluster to a certain extent) and error rate (used to indicate the proportion of errors that occur when the server cluster processes requests), etc.
[0088] In a possible implementation, the first performance data of the server cluster is data collected by taking the server cluster as an object, that is, the first performance data of the server cluster is the overall performance data of the server cluster. Correspondingly, the second performance data of the server cluster is also the overall performance data of the server cluster.
[0089] In another possible implementation, the first performance data of the server cluster includes the first performance data of multiple servers, each server is taken as an object, the performance data of each server is collected as the first performance data of the server, and the first performance data of each server is taken as the first performance data of the server cluster. Correspondingly, the second performance data of the server cluster includes the second performance data of each server.
[0090] In addition, the embodiments of the present application do not limit the manner in which the test server collects the first performance data of the server cluster. For example, it may be done through the Simple Network Management Protocol (SNMP); or an agent program may be deployed in the server cluster to periodically collect the performance data of the server cluster; or the first performance data of the server cluster may be obtained by analyzing the log files of the server cluster.
[0091] S202: The test server determines a fault test strategy corresponding to the server cluster.
[0092] The fault test strategy includes, for example, the number of service nodes, the number of test nodes, the number of allowed faults, the first number of degraded faults, and the first number of general faults. The fault test strategy can be understood as a limiting condition for the fault test, which is used to limit the test scope of the fault test.
[0093] When performing fault testing on a server cluster, the nodes in the server cluster can be divided into business nodes and test nodes. When performing cluster fault testing, faults are injected into all nodes in the server cluster. All nodes in the server cluster are test nodes, so the number of business nodes is zero, and the number of test nodes is equal to the total number of nodes in the server cluster. When performing non-cluster fault testing, faults are injected into only some nodes in the server cluster, leaving some business nodes to continue processing requests and maintain the functionality of the server cluster.
[0094] The number of business nodes can also be called the number of fault-free nodes. The number of business nodes refers to the number of business nodes in the server cluster that are not tested for faults and are used to process requests or execute tasks during the test server's fault testing of the server cluster. When the test server injects non-cluster faults into the server cluster, the business nodes can execute tasks or process requests normally and maintain the server cluster function.
[0095] The number of test nodes may also be referred to as the number of fault nodes. The number of test nodes refers to the number of nodes to be tested in the server cluster that can be fault-tested when the test server performs fault testing on the server cluster.
[0096] The allowed number of failures is the number of servers in the server cluster that are allowed to have degraded failures. It is also the maximum number of servers in the server cluster that can have degraded failures while ensuring that the server cluster can process requests or execute tasks. If the number of nodes to be tested that have degraded failures in the server cluster is less than or equal to the allowed number of failures, the business nodes in the server cluster can work normally; if the number of nodes to be tested that have degraded failures in the server cluster is greater than the allowed number of failures, the business nodes in the server cluster cannot work normally.
[0097] The first degradation fault number is the maximum number of servers that have degradation faults in the server cluster, and can also be the maximum number of degradation faults injected into the server cluster by the test server. Generally, when the fault test is a non-cluster test, in order to ensure that the service nodes in the server cluster can work normally, the maximum degradation fault number should be less than or equal to the allowed fault number of the server cluster.
[0098] The first general fault number is the maximum number of servers with general faults in the server cluster, and can also be the maximum number of general faults injected by the test server into the server cluster. In the embodiment of the present application, the test server injects only one type of fault into a node to be tested, that is, the node to be tested may have a degradation fault or a general fault, and will not have a degradation fault and a general fault at the same time. Therefore, the first degradation fault number and the first general fault number should be less than or equal to the number of test nodes in the server cluster.
[0099] There are differences in the data and management planes of different server clusters. In an embodiment of the present application, the test server can determine the corresponding fault testing strategy based on the architecture of the server cluster to make subsequent fault tests more in line with the test scenario and networking environment, thereby improving the accuracy of server cluster fault testing.
[0100] The process of the test server determining the corresponding fault test strategy according to the server cluster will be introduced below and will not be described in detail here.
[0101] S203: The test server performs a fault test on the server cluster by using a random algorithm in combination with the fault test strategy.
[0102] A random algorithm refers to an algorithm that uses random numbers to make decisions during operation. In an embodiment of the present application, the fault test strategy limits the test scope of the fault test, and the test content is randomly determined using a random algorithm. For example, the test server randomly determines the server as the node to be tested in the server cluster through a random algorithm, but the number of nodes to be tested determined by the random algorithm is less than or equal to the number of test nodes in the fault test strategy. For another example, the test server randomly determines the number of nodes to be tested that are injected with degraded faults through a random algorithm, but the number of nodes to be tested that are injected with degraded faults determined by the random algorithm is less than or equal to the first number of degraded faults in the fault test strategy.
[0103] In the embodiment of the present application, the fault test strategy is used to limit the test scope of the fault test to ensure that the randomly determined test content meets the numerical requirements. By combining the fault test strategy and the random algorithm, a comprehensive fault test of the server cluster can be achieved, and the randomness and objectivity of the fault test can be ensured, providing a reference for technicians to maintain the server cluster.
[0104] In a possible implementation, the test server can determine the type of this fault test as a cluster fault test or a non-cluster fault test through a random algorithm. Determining the type of the fault test through a random algorithm can improve randomness, ensure the randomness and objectivity of the test, and thus more effectively evaluate the performance and reliability of the system.
[0105] In another possible implementation, the test server may determine the number of fault tests for the server cluster by a random algorithm. Of course, the number of fault tests may also be manually set by a technician in combination with the test time. For example, if the server cluster test time is 2 days, the number of fault tests may be set to 100 times.
[0106] In another possible implementation, the test server may determine the type of each fault test as a cluster fault test or a non-cluster fault test by a random algorithm. After completing a fault test on the server cluster, before performing the next fault test on the server cluster, the test server will re-determine the type of the next fault test by a random algorithm. The type of the fault test is re-determined for each fault test by a random algorithm, thereby further improving the randomness of the fault test.
[0107] S204: The test server collects second performance data of the server cluster.
[0108] The second performance data is the performance data after the server cluster completes the fault test. The performance data type in the second performance data is the same as the data type in the first performance data. If the first performance data includes CPU usage and network bandwidth, the second performance data also includes CPU usage and network bandwidth. In addition, the second performance data has the same granularity as the first performance data. If the first performance data of the server cluster is the overall performance data of the server cluster, the second performance data of the server cluster is also the overall performance data of the server cluster; if the first performance data of the server cluster includes the first performance data of multiple servers, the second performance data of the server cluster also includes the second performance data of multiple servers. As an example, nodes A, B and C in the server cluster participate in the fault test. Before the fault test, the first performance data of nodes A, B and C are obtained as the first performance data of the server cluster, and after the fault test, the second performance data of nodes A, B and C are obtained as the second performance data of the server cluster.
[0109] It should be noted that the multiple servers corresponding to the first performance data and the second performance data are the same.
[0110] In a possible implementation, the test server collects the performance data of the server cluster after the last fault test as the second performance data. If the performance data of the server cluster after the last fault test can still meet the expected results, it can be considered that the performance data of the server cluster after each fault test can meet the expected results. Therefore, using the performance data of the server cluster after the last fault test as the second performance data can accurately measure the performance changes of the server cluster after the fault test, without the need to collect performance data after each fault test, simplifying the fault test process and shortening the time spent on fault testing.
[0111] In another possible implementation, after the server cluster completes the last fault test, the test server collects the performance data of the server cluster as the second performance data after a preset time period. The preset time period is the time interval between the time point when the server cluster completes the last fault test and the time point when the test server collects the performance data of the server cluster. By setting the preset time period, the server cluster can be adaptively adjusted after completing the fault test, so that the performance of the server cluster returns to a stable state. After waiting for the preset time period, the test server collects relatively stable performance data of the server cluster as the second performance data, avoiding the influence of the performance fluctuation of the server cluster just after the fault test on the accuracy of the fault test, thereby improving the accuracy of the fault test.
[0112] The preset time period can be set by the technicians according to actual needs, or by the test server according to the time it takes for the server cluster to restore stable performance. As an example, the test server collects the time it takes for the server cluster to restore stable performance after completing the fault test multiple times, and takes the average of the multiple collected times as the preset time period. It can also use a random algorithm to randomly select a time from the multiple collected times as the preset time period, so as to further improve the randomness of the fault test.
[0113] The embodiment of the present application does not limit the method for the test server to collect the second performance data of the server cluster, for example, it can be through SNMP; it can also be achieved by deploying an agent program in the server cluster to periodically collect the performance data of the server cluster; it can also be obtained by analyzing the log files of the server cluster.
[0114] S205: The test server compares the first performance data and the second performance data, and outputs a test result.
[0115] The test results are used to measure the stability of the server cluster or the server cluster's ability to resist faults. The test results can be whether the server cluster's functions have returned to normal or whether the server cluster's performance has returned to normal levels after the fault test; the test results can also be changes or fluctuations in the server cluster's performance during the fault test.
[0116] By comparing the performance data of the server cluster before and after the fault test, the test server can compare the performance changes of the server cluster before and after the fault occurs, and determine the server cluster's ability to resist the fault. Then the test results are presented to the technicians, providing a basis for the technicians to manage the server cluster.
[0117] Through the method provided in the embodiment of the present application, a corresponding fault test strategy is formulated for the server cluster, the fault test strategy is limited to the test scope of the fault test, and the server cluster is fault tested using a random algorithm to ensure the randomness of the fault test content, and random and uncertain faults are introduced into the server cluster to evaluate the stability and recoverability of the server cluster in the face of faults and uncertainties, thereby realizing chaos testing. In addition, through the above method, all fault conditions within the scope of the fault test strategy limit can be covered by increasing the number of fault tests, without exhaustively enumerating various fault scenarios, greatly reducing labor costs and time costs.
[0118] In a possible implementation, based on the above step S202, the embodiment of the present application can determine the fault test strategy corresponding to the server cluster according to the data plane strategy and management plane architecture of the server cluster, so as to formulate corresponding fault test strategies for different server clusters. Figure 3 The above process is introduced as follows: Figure 3 As shown, Figure 3 A flowchart of a fault testing strategy for determining a fault testing strategy is provided in an embodiment of the present application. The process includes:
[0119] S301: The test server determines a first allowed number of failures FTT1 according to a data plane policy, and determines a second allowed number of failures FTT2 according to a management plane architecture.
[0120] The first allowed failure number FTT1 is the number of servers that are allowed to have degradation failures on the data plane. The data plane refers to the part of the server cluster that actually processes the data flow. In a server cluster, the data plane is responsible for receiving, processing, and forwarding data from user requests, such as load balancing, data caching, data storage, data processing, and other functions. The data plane strategy refers to the data processing strategy adopted in the data plane of the server cluster. The data plane strategy includes, for example, a replica redundancy strategy and a data block redundancy strategy. The replica redundancy strategy is a strategy that improves data reliability by creating multiple copies of data and distributing them on different servers.
[0121] Data block redundancy strategy is a common data protection and fault tolerance mechanism, which is usually used to ensure data reliability and availability. In the data block redundancy strategy, data is divided into multiple blocks and stored and replicated on different nodes in the cluster to prevent data loss or damage. The data block redundancy strategy is divided into data blocks and redundant data blocks (also called check blocks). In order to achieve redundant backup of data, check blocks are usually introduced on the basis of data blocks. Redundant data blocks are generated by calculating the original data blocks, and they contain check information or redundant information of the original data blocks. When data recovery is required, these redundant data blocks can be used to repair damaged or lost data blocks, thereby ensuring data integrity and reliability.
[0122] In a server cluster, different nodes are responsible for storing and processing data. Some nodes may be responsible for storing data blocks, while other nodes may be responsible for storing check blocks. A node user stores one data block or one check block. That is, in a server cluster at the node level, the sum of the number of check blocks and data blocks is equal to the number of nodes in the server cluster.
[0123] Different data plane strategies correspond to different allowed numbers of failures. Therefore, the test server needs to determine the corresponding first allowed number of failures based on the data plane strategy. As an example, if the data plane strategy is a replica redundancy strategy, the first allowed number of failures FTT1 is the number of replicas - 1, where the number of replicas is the number of data replicas created. As another example, if the data plane strategy is a data block redundancy strategy, the first allowed number of failures FTT1 is the number of check blocks.
[0124] The second allowed failure number FTT2 is the number of servers that the management plane allows to have degraded failures. The management plane refers to the components and functions used to manage and monitor the entire cluster. The management plane architecture is, for example, the active-standby mode or the Kubernetes (K8S) mode. The active-standby mode adopts an active-standby node architecture, which contains a master node and one or more backup nodes. The master node is responsible for handling all requests and data processing tasks, while the backup node is on standby and will only take over its functions when the master node fails or is unavailable. The K8S mode adopts a containerized architecture, packages applications and services into containers, and uses Kubernetes for container orchestration and management.
[0125] Different management plane architectures correspond to different allowed fault numbers. Therefore, the test server needs to determine the corresponding second allowed fault number FTT2 according to the management plane architecture. As an example, if the management plane architecture is in active-standby mode, the second allowed fault number FTT2 is 1. As another example, if the management plane architecture is in K8S mode, the second allowed fault number FTT2 can be 3. When the management plane architecture is in K8S mode, the value of the second allowed fault number FTT2 can be any value, which is related to the container and business requirements.
[0126] S302: The test server determines the tolerable number of failures FTT of the server cluster according to the first tolerable number of failures FTT1 and the second tolerable number of failures FTT2.
[0127] The first allowed failure number FTT1 and the second allowed failure number FTT2 are the number of servers that are allowed to have degraded failures on the data plane and the management plane respectively. The test server can determine the number of servers that are allowed to have degraded failures based on the first allowed failure number FTT1 and the second allowed failure number FTT2, that is, the allowed failure number FTT of the server cluster.
[0128] In one possible implementation, the allowed number of failures FTT of the server cluster is the minimum value of the first allowed number of failures FTT1 and the second allowed number of failures FTT2. As an example, if the first allowed number of failures FTT1 is greater than the second allowed number of failures FTT2, the second allowed number of failures FTT2 is used as the allowed number of failures FTT of the server cluster; if the first allowed number of failures FTT1 is less than the second allowed number of failures FTT2, the first allowed number of failures FTT1 is used as the allowed number of failures FTT of the server cluster. As another example, if the first allowed number of failures FTT1 is 3 and the second allowed number of failures FTT2 is 2, the allowed number of failures FTT of the server cluster is 2; if the first allowed number of failures FTT1 is 3 and the second allowed number of failures FTT2 is 4, the allowed number of failures FTT of the server cluster is 3. By taking the minimum value of the first allowable failure number FTT1 and the second allowable failure number FTT2 as the allowable failure number FTT of the server cluster, that is, taking the minimum value of the first allowable failure number FTT1 and the second allowable failure number FTT2 as the limitation of the random algorithm, the feasibility of non-cluster fault testing of the server cluster is improved, and it is avoided that the number of servers with degraded failures during the fault test exceeds the first allowable failure number FTT1 or the second allowable failure number FTT2, which causes the overall paralysis of the server cluster and the inability to implement the non-cluster fault test failure.
[0129] S303: The test server determines the number of service nodes N1 and the number of test nodes N2 according to the allowed number of failures FTT and the total number of servers N in the server cluster.
[0130] The total number of servers N refers to the total number of servers in the server cluster. The number of business nodes N1 refers to the number of servers in the server cluster that do not participate in the fault test, and the number of test nodes N2 refers to the number of servers in the server cluster that participate in the fault test. The sum of the number of business nodes N1 and the number of test nodes N2 equals the total number of servers N.
[0131] In a possible implementation, the number of service nodes N1 may be less than or equal to the absolute value of the difference between the total number of servers N and the tolerable number of failures FTT. The number of test nodes N2 is equal to the absolute value of the difference between the total number of servers N and the number of service nodes N1. The specific number of service nodes N1 may be determined by the test server during the test by combining this limit range with a random algorithm, or may be determined by a technician based on this limit range.
[0132] By setting the number of service nodes N1, it can be ensured that the service nodes can continue to maintain the function of the server cluster when the server cluster is performing non-cluster fault testing. And by setting the limit range of the number of service nodes N1 and the number of test nodes N2, the test server can use the random algorithm to accurately perform non-cluster fault testing on the server cluster.
[0133] S304: The test server determines a first degradation fault number UF1 and a first general fault number NF1 of the server cluster.
[0134] The first degradation fault number UF1 is the maximum number of servers that are tested for degradation faults in the server cluster. The first general fault number NF1 is the maximum number of servers that are tested for general faults in the server cluster. By limiting the maximum number of servers that are tested for degradation faults and general faults during non-cluster fault testing, the test server determines the number of servers that need to be tested for degradation faults and the number of servers that need to be tested for general faults through a random algorithm, which is below the maximum value limited by the first degradation fault number UF1 and the first general fault number NF1.
[0135] In a possible implementation, the first degradation fault number UF1 may be the allowable fault number of the server cluster, and the first general fault number NF1 may be the absolute value of the difference between the number of test nodes N2 and the first degradation fault number UF1. By setting the first degradation fault number UF1 to the allowable fault number FTT, the number of servers in the server cluster that are subjected to degradation fault testing may be less than or equal to the allowable fault number FTT, thereby preventing the number of servers subjected to degradation fault testing from exceeding the number allowed by the server cluster, thereby causing the non-cluster fault test to fail. Furthermore, the first general fault number NF1 may be set to the absolute value of the difference between the number of test nodes N2 and the first degradation fault number UF1, that is, the sum of the first general fault number NF1 and the first degradation fault number UF1 is equal to the number of test nodes, thereby preventing the total number of servers subjected to general fault testing and degradation fault testing from exceeding the number of test nodes N2, thereby affecting the normal operation of the service nodes, thereby enabling the server cluster to normally execute tasks or process requests when conducting non-cluster fault testing, thereby improving the stability of the server cluster.
[0136] In the embodiment of the present application, the test server formulates a corresponding fault test strategy for the server cluster according to the data plane strategy and management plane architecture of the server cluster, providing a restriction range that is more in line with the server cluster architecture for subsequent fault testing using random algorithms. In addition, by determining the fault test strategy to limit the test range of the fault test, the feasibility of the fault test can be improved while ensuring the randomness of the fault test.
[0137] Based on the above step S203, the embodiment of the present application limits the test scope of the fault test by the above fault test strategy, and uses a random algorithm to perform a fault test on the server cluster, specifically as follows: Figure 4 As shown, Figure 4 A flow chart of a server cluster fault testing process provided in an embodiment of the present application includes:
[0138] S401: The test server determines the fault type through a random algorithm.
[0139] Fault types include cluster faults and non-cluster faults. Non-cluster faults include degradation faults and general faults. The test server randomly determines the fault type of this fault test as cluster fault or non-cluster fault through a random algorithm.
[0140] In a possible implementation, the test server determines a number from the numbers "0" and "1" based on the fault type weight through a random algorithm. The number "0" indicates a non-cluster fault, and the number "1" indicates a cluster fault; or the number "0" indicates a cluster fault, and the number "1" indicates a non-cluster fault. The fault type weight is used to indicate the probability of occurrence of the type of fault. As an example, the fault type weight corresponding to the cluster fault is 0.3, and the fault type weight corresponding to the non-cluster fault is 0.7. It can be understood that the probability of cluster fault occurring in the server cluster is 30%, and the probability of non-cluster fault occurring is 70%. The fault type weight can be set by the test server according to the fault log of the server cluster. As an example, if the fault log records the number of cluster faults occurring 3 times and the number of non-cluster faults occurring 7 times, the fault type weight corresponding to the cluster fault can be set to 0.3, and the fault type weight corresponding to the non-cluster fault can be set to 0.7. It can also be set by a technician based on experience or actual needs. By introducing the fault type weight, the reliability of the fault test is improved while ensuring randomness, so that the fault test is more in line with the actual fault scenario.
[0141] If the test server determines that the fault type is a cluster fault, then step S402 is continued to be executed; if the test server determines that the fault type is a non-cluster fault, then step S403 is continued to be executed.
[0142] S402: The test server selects a cluster fault from a cluster fault library by using a random algorithm.
[0143] The cluster fault library is a collection of cluster faults, and the cluster fault library includes multiple cluster faults, such as server cluster power failure, server cluster network failure, and server cluster shared storage failure. The test server determines a cluster fault from the cluster fault library based on the fault weight through a random algorithm. Each cluster fault corresponds to a fault weight, which is used to indicate the probability of the occurrence of the fault. In the embodiment of the present application, the method for determining the fault weight corresponding to the cluster fault is not limited, and the above-mentioned fault type weight can be referred to.
[0144] After the test server determines the faulty cluster, it proceeds to step S407 to inject the cluster fault into the server cluster for fault testing.
[0145] S403: The test server determines the second degraded fault number UF2 and the second general fault number NF2 through a random algorithm.
[0146] The second degradation fault number UF2 is the number of servers in the server cluster that are subjected to the degradation fault test in this fault test, that is, the number of nodes to be tested that the test server needs to inject degradation faults into in this fault test. The second degradation fault number UF2 is less than or equal to the first degradation fault number UF1, and the second degradation fault number UF2 is greater than or equal to 0, that is, the second degradation fault number UF2 is less than or equal to the allowed fault number FTT of the server cluster. The test server determines the second degradation fault number UF2 as the number of servers to be subjected to the degradation fault test in this non-cluster fault test from the range of 0 to the first degradation fault number UF1 through a random algorithm.
[0147] The second general fault number NF2 is the number of servers in the server cluster for general fault testing in this fault test. That is, in this fault test, the test server needs to inject the number of nodes to be tested with general faults. The second general fault number NF2 is less than or equal to the first general fault number NF1, and the second general fault number NF2 is greater than or equal to 0. The test server determines the second general fault number NF2 as the number of servers for general fault testing in this non-cluster fault test from the range of 0 to the first general fault number NF1 through a random algorithm.
[0148] In the embodiment of the present application, the sum of the second degradation fault number UF2 and the second general fault number NF2 is less than or equal to the test fault number N2. The second degradation fault number UF2 and the second general fault number NF2 are determined by a random algorithm within the limited range of the fault test, which can improve the randomness of the fault test and ensure the feasibility of the fault test.
[0149] It should be noted that the second degradation fault number UF2 and the second general fault number NF2 determined by the test server through a random algorithm are both integers.
[0150] S404: The test server determines a node to be tested according to the second degraded fault number UF2 and the second general fault number NF2 by using a random algorithm.
[0151] The test server determines the nodes to be tested for this fault test from the server cluster by a random algorithm, that is, randomly selects a specified number of nodes to be tested from the server cluster. The number of nodes to be tested for this fault test is the sum of the second degraded fault number UF2 and the second general fault number NF2. At the same time, the test server can also use a random algorithm to determine the service nodes that maintain the server cluster function in this fault test from the remaining servers in the server cluster, and the number of service nodes determined is equal to the number of service nodes N1.
[0152] In the embodiment of the present application, a random algorithm is used to randomly select (UF2+NF2) nodes to be tested from the server cluster to participate in the fault test, thereby further improving the randomness of the fault test. In addition, a random algorithm can also be used to determine N1 service nodes from the remaining servers to ensure that the server cluster can continue to execute tasks or process requests during the fault test, thereby improving the stability of the server cluster.
[0153] S405: The test server selects a degraded fault and a general fault from the degraded fault library and the general fault library by using a random algorithm.
[0154] The degradation fault library is a collection of degradation faults, and the degradation fault library includes multiple degradation faults, such as node power off, business network interruption, storage network interruption, cache disk failure, data disk failure, business network flash outage, storage network flash outage, storage network packet loss, ceph-mon process failure, and ceph-osd process failure. The test server selects UF2 degradation faults from the degradation fault library through a random algorithm. If the second degradation fault number UF2 is greater than or equal to 2, the multiple degradation faults selected by the test server may include the same degradation fault. As an example, if the second degradation fault number UF2 is equal to 4, the 4 degradation faults selected by the test server can be node power off, node power off, business network interruption, and storage network interruption.
[0155] In one possible implementation, each downgrade fault in the downgrade fault library corresponds to a fault weight, and the fault weight is used to characterize the probability of occurrence of this downgrade fault. The test server uses a random algorithm to select UF2 downgrade faults from the downgrade fault library based on the fault weights corresponding to various downgrade faults. As an example, the higher the fault weight, the higher the possibility that the corresponding downgrade fault will be selected; and the higher the fault weight, the higher the possibility that the corresponding downgrade fault will be repeatedly selected. Randomly selecting downgrade faults in combination with fault weights can make fault testing more in line with the actual usage of the server cluster and improve the accuracy of fault testing.
[0156] The general fault database is a collection of general faults, including various general faults, such as slow system disk, single network port disconnection of service network, single network port disconnection of storage network, service network delay, storage network delay, service network speed reduction, storage network speed reduction, management network disconnection, management network delay, management network packet loss, management network card failure, mysqld process failure, sdsom-rabbitmq process failure, zookeeper process failure, httpd process failure, sdsom-master process failure, sdsom-agent process failure, sdsom-rcm process failure, sdsom-diamond process failure, carbon-cache process failure, sdsom-hd-monitor process failure, sdsom-operation process failure, sdsom-nas process failure, sdsom-ceph-api process failure, sdsom-websocket process failure, sdsom-dmc process failure, and ceph-mgr process failure. The test server selects NF2 general faults from the general fault library through a random algorithm. If the second general fault number NF2 is greater than or equal to 2, the multiple general faults selected by the test server may include the same general fault. As an example, if the second general fault number NF2 is equal to 3, the three general faults selected by the test server may be a slow system disk, a slow system disk, and a single network port disconnection of the service network.
[0157] In a possible implementation, each general fault in the general fault library corresponds to a fault weight, and the fault weight is used to characterize the probability of occurrence of this general fault. The test server uses a random algorithm based on the fault weights corresponding to various general faults to select NF2 general faults from the general fault library. As an example, the higher the fault weight, the higher the possibility that the corresponding general fault will be selected; and the higher the fault weight, the higher the possibility that the corresponding general fault will be repeatedly selected. Randomly selecting general faults in combination with fault weights can make fault testing more in line with the actual usage of the server cluster and improve the accuracy of fault testing.
[0158] In the embodiment of the present application, the method for determining the fault weight corresponding to the degraded fault and the fault weight corresponding to the general fault is not limited, and the above-mentioned fault type weight can be referred to.
[0159] S406: The test server creates a test list through a random algorithm.
[0160] The test list is used to describe the correspondence between the node to be tested and the fault (degraded fault or general fault). The node to be tested corresponds to a degraded fault or a general fault; in other words, when performing a fault test, the test server injects a general fault or a degraded fault into the node to be tested. Therefore, the first degraded fault number UF1 can also be understood as the maximum number of degraded faults selected by the test server from the degraded fault library; the first general fault number NF1 can also be understood as the maximum number of general faults selected by the test server from the general fault library; the second degraded fault number UF2 can also be understood as the number of degraded faults selected by the test server from the degraded fault library; the second general fault number NF2 can also be understood as the number of general faults selected by the test server from the general fault library.
[0161] The test server establishes the corresponding relationship between the nodes to be tested and the faults through a random algorithm, further improving the randomness of the fault test. The test list can be shown in Table 1.
[0162] Table 1: Test list
[0163] Nodes to be tested Fault Node 1 to be tested Business network delay Node 3 under test Storage network latency Node 5 to be tested Power off the node Node 6 under test Cache disk failure Node 7 under test Data disk failure
[0164] As shown in Table 1, the number of nodes to be tested in the server cluster can be 8, including nodes to be tested 1 to 8. However, the sum of the second degradation fault number UF2 and the second general fault number NF2 is 5, and the test server will select 5 nodes to be tested from nodes to be tested 1 to 8 through a random algorithm to participate in this fault test, such as nodes to be tested 1, 3, 5, 6 and 7 shown in Table 1.
[0165] S407: The test server injects a fault into the server cluster to perform a fault test.
[0166] If the fault type of this fault test is a cluster test, the test server directly injects a cluster fault into the server cluster. After the test server injects a cluster fault into the server cluster, the server cluster cannot continue to process requests or execute tasks, and all servers in the server cluster fail. In the face of a cluster fault, the server cluster can restore the server cluster status through an automated fault detection and recovery mechanism. If the server cluster can restore the server cluster status, the server cluster is tested to perform basic tasks such as computing, storage, and networking after recovery. These basic tasks are tasks performed when the server cluster implements basic functions, and are used to determine whether the server cluster can work normally. When each basic task is executed successfully, it indicates that the server cluster has passed the fault test. If a basic task fails to execute, the test is stopped and an alarm is issued to the technician.
[0167] If the fault type of this fault test is a non-cluster test, the test server will inject a downgrade fault or a general fault into the corresponding node under test according to the test list. By executing basic tasks such as computing, storage, and network on each node under test, if the node under test executes all basic tasks, the node under test passes the fault test; if a basic task fails to execute, the test is stopped and an alarm is issued to the technician.
[0168] The above steps S401-S407 are a fault test process. In actual application scenarios, it is usually necessary to perform multiple fault tests on the server cluster to enrich different fault test situations and improve the accuracy of the fault test.
[0169] The above fault testing method is further described below in conjunction with an exemplary scenario.
[0170] like Figure 5 As shown, Figure 5 A schematic diagram of a server cluster networking environment provided for an embodiment of the present application. The server cluster includes 5 servers, each of which is connected to the management plane and the data plane respectively. The data plane strategy of the server cluster is a replica redundancy strategy with 3 replicas; the management plane architecture is a master-slave mode. The fault test number is 20 times for example. The fault test process is as follows Figure 6 As shown, including:
[0171] S601: The test server determines a fault test strategy corresponding to the server cluster.
[0172] First, the test server determines the corresponding first tolerable number of failures FTT1 and second tolerable number of failures FTT2 according to the data plane policy and management plane architecture of the server cluster. The data plane policy of the server cluster adopts a replica redundancy strategy with 3 replicas, and the corresponding first tolerable number of failures FTT1 is 2; the management plane architecture is in active-standby mode, and the corresponding second tolerable number of failures FTT2 is 1.
[0173] Secondly, the test server determines the allowed failure number FTT of the server cluster according to the first allowed failure number FTT1 and the second allowed failure number FTT2. Since the first allowed failure number FTT1 is greater than the second allowed failure number FTT2, the second allowed failure number FTT2 is used as the allowed failure number of the server cluster (FTT=1).
[0174] Then, the test server determines the number of business nodes N1 and the number of test nodes N2 according to the allowable number of failures FTT and the total number of servers N in the server cluster (N=5). The number of business nodes N1 is less than or equal to the absolute value of the difference between the total number of servers N and the allowable number of failures FTT, that is, N1≤|N-FTT|, and the number of business nodes N1 can be a non-negative integer less than or equal to 4. The number of test nodes N2 is equal to the absolute value of the difference between the total number of servers N and the number of business nodes N1, that is, N2=|N-N1|, and the number of test nodes N2 can be a non-negative integer less than or equal to 4. In an embodiment of the present application, exemplarily, the number of business nodes N1 is 1 and the number of test nodes N2 is 4.
[0175] Finally, the test server determines the first degradation fault number UF1 and the first general fault number NF1 of the server cluster. The first degradation fault number UF1 is equal to the allowed fault number FTT, that is, UF1=1, and the first general fault number NF1 is equal to the absolute value of the difference between the number of test nodes N2 and the first degradation fault number UF1, that is, NF1=|N2-UF1|, and the first general fault number can be a non-negative integer less than or equal to 4. In the embodiment of the present application, if the number of test nodes N2 is 4, the first general fault number NF1 is 3.
[0176] The manner in which the test server determines the fault test strategy corresponding to the server cluster may refer to the above steps S301 - S304 .
[0177] S602: The test server collects first performance data of the server cluster.
[0178] The test server collects performance data of the server cluster before the fault test as first performance data.
[0179] S603: The test server performs a fault test on the server cluster.
[0180] The test server determines the fault type of this fault test through a random algorithm. If the fault type is a cluster fault, the test server randomly selects a cluster fault from the cluster fault library through a random algorithm and injects the cluster fault into the server cluster. The test server detects the status of the server cluster during the fault test. When the server cluster status is restored, the server cluster is enabled to perform basic tasks, such as computing tasks, storage tasks, and network tasks. When the server cluster completes the basic tasks, step S604 is continued; if the server cluster fails to perform the basic tasks, the fault test is interrupted and an alarm is issued to the technician.
[0181] If the fault type is a non-cluster fault, under the constraints of the first degradation fault number UF1 and the first general fault number NF1 (0≤UF2≤UF1, 0≤NF2≤NF1), the test server determines the second degradation fault number UF2 and the second general fault number NF2 through a random algorithm. The second degradation fault number UF2 is proposed to be 1, and the second general fault number NF2 is proposed to be 3. The test server selects the nodes to be tested from the 5 servers in the server cluster through a random algorithm, and proposes to select server 1, server 2, server 3 and server 4 as the nodes to be tested, and server 5 as the service node. The test server randomly selects 1 degradation fault from the degradation fault library and 3 general faults from the general fault library through a random algorithm. The degradation fault proposed to be selected is node power off, and the general faults are service network delay, storage network delay and service network speed reduction. The test server establishes the corresponding relationship between non-cluster faults and nodes to be tested through a random algorithm to obtain a test case table. The test list is shown in Table 2.
[0182] Table 2: Test list
[0183]
[0184]
[0185] The test server injects downgrade faults and general faults into the corresponding nodes to be tested according to the test list. The test server detects the status of each node to be tested during the fault test. When the status of the node to be tested is restored, the node to be tested is made to perform basic tasks, such as computing tasks, storage tasks, and network tasks. When each node to be tested has completed the basic tasks, step S604 is continued; if a node to be tested fails to perform a basic task, the fault test is interrupted and an alarm is issued to the technician.
[0186] The process of the test server performing a fault test on the server cluster may refer to the above steps S401 - S407 .
[0187] S604: The test server determines whether the number of failure tests is met.
[0188] The test server monitors the number of fault tests. If the current number of fault tests reaches 20 times, step S605 is continued to be executed; if the current number of fault tests is less than 20 times, step S603 is returned to be executed until the number of fault tests reaches 20 times.
[0189] By increasing the number of fault tests, the scenarios and situations of fault tests can be enriched, and the accuracy of fault tests can be improved.
[0190] S605: The test server collects second performance data of the server cluster.
[0191] The test server collects the performance data of the server cluster that has undergone 20 failure tests as the second performance data.
[0192] S606: The test server compares the first performance data and the second performance data, and outputs a test result.
[0193] The test server can determine whether the performance of the server cluster after the fault test meets the expected standard and obtain the test result by comparing the performance data of the server cluster before and after the fault test, that is, comparing the first performance data and the second performance data.
[0194] In the above steps S601-S606, the test server can determine the fault test strategy for the networking environment of the server cluster, and limit the test scope of the fault test by the fault test strategy, and use the random algorithm to perform multiple fault tests on the server cluster to achieve chaos testing of the server cluster. In addition, by increasing the number of fault tests, various possible fault conditions within the constraints of the fault test strategy can be covered without exhaustive enumeration, thereby reducing labor costs and time costs.
[0195] It should be noted that the embodiments of the present application do not specifically limit the random algorithm, and the random algorithm includes, for example, a random selection algorithm, a Monte Carlo algorithm, a random permutation algorithm, and a random search algorithm.
[0196] The above are some specific implementations of the fault testing method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding fault testing device. The device provided in the embodiment of the present application will be introduced below in combination with the above fault testing method.
[0197] like Figure 7 As shown, Figure 7 A schematic diagram of the structure of a server cluster fault testing device provided in an embodiment of the present application. The device includes:
[0198] A testing module 701 is used to perform a fault test on the server cluster based on a random algorithm and a fault test strategy corresponding to the server cluster; the fault test strategy is used to limit the test scope of the fault test;
[0199] The comparison module 702 is used to compare the first performance data and the second performance data to obtain the test result of the server cluster; the first performance data is the performance data of the server cluster before the fault test, and the second performance data is the performance data of the server cluster after the fault test.
[0200] In a possible implementation, the test module 701 is specifically used to determine the fault type of the fault test by using a random algorithm; if the fault type is a cluster fault, a cluster fault is selected from a cluster fault library by using a random algorithm, and the cluster fault is injected into the server cluster for cluster fault testing;
[0201] as well as;
[0202] If the fault type is a non-cluster fault, a non-cluster fault test is performed on the server cluster by a random algorithm within the test range defined by the fault test strategy.
[0203] In a possible implementation, the device further includes a determination module, which is used to determine the fault testing strategy according to the data plane strategy, management plane architecture and total number of servers of the server cluster.
[0204] In a possible implementation, the fault testing strategy includes an allowable number of faults, a number of business nodes, a first number of degraded faults, and a first number of general faults; the allowable number of faults is the maximum number of servers in the server cluster that are allowed to have degraded faults; the number of business nodes is the number of servers in the server cluster that do not participate in non-cluster fault testing; the first number of degraded faults is the maximum number of servers in the server cluster that undergo degraded fault testing; and the first number of general faults is the maximum number of servers in the server cluster that undergo general fault testing.
[0205] In a possible implementation, the determination module is specifically used to determine the allowable number of failures based on the data plane policy and the management plane architecture; determine the value range of the number of business nodes based on the absolute value of the difference between the allowable number of failures and the total number of servers, and use the absolute value of the difference between the total number of servers and the number of business nodes as the number of test nodes; the number of business nodes is less than or equal to the absolute value of the difference between the allowable number of failures and the total number of servers; the number of test nodes is the number of servers in the server cluster participating in the fault test; use the allowable number of failures as the first degraded failure number, and use the difference between the number of test nodes and the first degraded failure number as the first general failure number.
[0206] In a possible implementation, the test module 701 is specifically used to determine a second degradation fault number and a second general fault number through a random algorithm; the second degradation fault number is the number of servers in the server cluster that undergo a degradation fault test, the second degradation fault number is less than or equal to the first degradation fault number, and the second degradation fault number is greater than or equal to 0; the second general fault number is the number of servers in the server cluster that undergo a general fault test, the second general fault number is less than or equal to the first general fault number, and the second general fault number is greater than or equal to 0; determine the server cluster to be non-clustered through a random algorithm A node to be tested for a fault test, wherein the number of the nodes to be tested for a non-cluster fault test is equal to the sum of the second general fault number and the second degraded fault number; a degraded fault is determined from a degraded fault library by a random algorithm, and a general fault is determined from a general fault library, the number of the degraded faults is the second degraded fault number, and the number of the general faults is the second general fault number; a test list is established by a random algorithm, and the test list is used to describe the corresponding relationship between the node to be tested and the degraded fault and the general fault; based on the test list, the degraded fault and the general fault are injected into the corresponding node to be tested to perform a non-cluster fault test.
[0207] In a possible implementation, the test module 701 is specifically used to determine the multiple downgraded faults by a random algorithm according to the fault weights corresponding to each downgraded fault in the downgraded fault library; and to determine the multiple general faults by a random algorithm according to the fault weights corresponding to each general fault in the general fault library; the fault weights are used to indicate the possibility of occurrence of the corresponding faults.
[0208] In a possible implementation, the fault test strategy includes the number of fault tests, and the second performance data is performance data of the server cluster after the server cluster has undergone the fault tests for the number of fault tests.
[0209] In one possible implementation, the test module 701 is specifically used to control the server cluster to execute basic tasks after the server cluster status is restored, and to suspend fault testing when the server cluster fails to execute the basic tasks, wherein the basic tasks are tasks executed when the server cluster implements basic functions; and, after the status of the node to be tested in the server cluster is restored, to control the node to be tested to execute the basic tasks, and to suspend fault testing when the node to be tested fails to execute the basic tasks.
[0210] The present application also provides a corresponding server and computer storage medium, such as Figure 8 As shown, the server 800 includes: a processor 801 and a memory 802;
[0211] The server 800 includes a processor 801 and a memory 802, wherein the memory 802 is used to store instructions or codes, and the processor 801 is used to execute the instructions or codes so that the device executes the fault testing method described in any embodiment of the present application.
[0212] The computer storage medium stores instructions. When the instructions are executed, the device executing the instructions implements the fault testing method described in any embodiment of the present application.
[0213] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0214] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0215] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0216] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for fault testing of a server cluster, characterized in that: include: Performing a fault test on the server cluster based on a random algorithm and a fault test strategy corresponding to the server cluster; The fault test strategy is used to limit the test scope of the fault test; Comparing the first performance data with the second performance data to obtain a test result of the server cluster; The first performance data is the performance data of the server cluster before the fault test is performed, and the second performance data is the performance data of the server cluster after the fault test is performed.
2. The method according to claim 1, characterized in that The performing a fault test on the server cluster based on a random algorithm and a fault test strategy corresponding to the server cluster includes: Determine the fault type of the fault test using a random algorithm; If the fault type is a cluster fault, a cluster fault is selected from a cluster fault library by a random algorithm, and the cluster fault is injected into the server cluster for cluster fault testing; as well as; If the fault type is a non-cluster fault, a non-cluster fault test is performed on the server cluster by a random algorithm within the test range defined by the fault test strategy.
3. The method according to claim 2, characterized in that The method further comprises: The fault testing strategy is determined according to the data plane strategy, management plane architecture and total number of servers of the server cluster.
4. The method according to claim 3, characterized in that The fault test strategy includes the allowed number of faults, the number of service nodes, the first number of downgraded faults and the first number of general faults; the allowed number of faults is the maximum number of servers in the server cluster that are allowed to have downgraded faults; The number of service nodes is the number of servers in the server cluster that do not participate in the non-cluster fault test; The first degradation failure number is the maximum number of servers in the server cluster that are subjected to degradation failure testing; The first general fault number is the maximum number of servers in the server cluster that are subjected to a general fault test.
5. The method according to claim 4, characterized in that Determining the fault testing strategy according to the data plane strategy, management plane architecture and total number of servers of the server cluster includes: Determining the allowed number of failures according to the data plane policy and the management plane architecture; According to the absolute value of the difference between the allowed number of failures and the total number of servers, the value range of the number of business nodes is determined, and the absolute value of the difference between the total number of servers and the number of business nodes is used as the number of test nodes; the number of business nodes is less than or equal to the absolute value of the difference between the allowed number of failures and the total number of servers; the number of test nodes is the number of servers in the server cluster that participate in the fault test; The allowed number of faults is used as the first number of degraded faults, and the difference between the number of test nodes and the first number of degraded faults is used as the first number of general faults.
6. The method according to claim 4, characterized in that The non-cluster fault test is performed on the server cluster by a random algorithm within the test range defined by the fault test strategy, including: The second degradation failure number and the second general failure number are determined by a random algorithm; the second degradation failure number is the number of servers in the server cluster that undergo a degradation failure test, the second degradation failure number is less than or equal to the first degradation failure number, and the second degradation failure number is greater than or equal to 0; the second general failure number is the number of servers in the server cluster that undergo a general failure test, the second general failure number is less than or equal to the first general failure number, and the second general failure number is greater than or equal to 0; Determine nodes to be tested for non-cluster fault testing from the server cluster by a random algorithm, wherein the number of nodes to be tested for non-cluster fault testing is equal to the sum of the second general fault number and the second degraded fault number; Determine the degraded faults from the degraded fault library by a random algorithm, and determine the general faults from the general fault library, the number of the degraded faults being the second degraded fault number, and the number of the general faults being the second general fault number; Establishing a test list by a random algorithm, wherein the test list is used to describe the corresponding relationship between the node to be tested and the degradation fault and the general fault; Based on the test list, the degradation fault and the general fault are injected into the corresponding node to be tested to perform a non-cluster fault test.
7. The method according to claim 6, characterized in that The step of determining the degradation fault from the degradation fault library by using a random algorithm and determining the general fault from the general fault library comprises: Determining the multiple degradation faults by a random algorithm according to the fault weight corresponding to each degradation fault in the degradation fault library; And, according to the fault weight corresponding to each general fault in the general fault library, the plurality of general faults are determined by a random algorithm; the fault weight is used to indicate the possibility of occurrence of the corresponding fault.
8. The method according to claim 1, characterized in that The fault test strategy includes the number of fault tests, and the second performance data is the performance data of the server cluster after the server cluster has undergone the fault tests for the number of fault tests.
9. The method according to claim 2, characterized in that: The step of injecting the cluster fault into the server cluster to perform cluster fault testing includes: After the server cluster status is restored, the server cluster is controlled to execute basic tasks, and fault testing is suspended when the server cluster fails to execute the basic tasks, wherein the basic tasks are tasks executed when the server cluster implements basic functions; The performing a non-cluster fault test on the server cluster by using a random algorithm includes: After the state of the node to be tested in the server cluster is restored, the node to be tested is controlled to execute the basic task, and the fault test is suspended when the node to be tested fails to execute the basic task.
10. A server, characterized in that: The server includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions; the at least one processor executes the computer program instructions so that the server executes the method according to any one of claims 1 to 9.
Citation Information
Cited By
Agricultural product traceability data acquisition method and system based on Internet of Things
CN119295100A
