A node security registration method, device, equipment and readable storage medium
By obtaining and analyzing the node's online and offline information and resource information, it can determine the high-load fault status and activate circuit breaker protection, which solves the problem of abnormal node status caused by resource congestion in the big data retrieval cluster and ensures the stable operation of the cluster.
Patent Information
- Application Number
- CN202210764537.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-06-30
AI Technical Summary
Under high load conditions, the existing big data retrieval cluster causes abnormal status of service nodes due to resource congestion, which cannot be effectively monitored and processed, resulting in unstable node and cluster operation.
By obtaining the node's online and offline information and resource information, it is determined whether the node is in a high-load fault state. If so, the circuit breaker protection mechanism is activated to prevent abnormal online and offline actions, and the resource information is continuously monitored, and the node is brought back online when the preset conditions are met.
It effectively avoids resource congestion and data processing abnormalities caused by abnormal conditions, protects the stable operation of nodes and clusters, and ensures dynamic health and operational stability.
Smart Images

Figure CN115150460B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data, and in particular to a node security registration method, device, equipment and computer-readable storage medium. Background Art
[0002] There are currently a variety of fast retrieval systems in the big data field. Most retrieval systems are distributed systems with multiple nodes providing services in parallel. Daily operations involve concurrent operation and retrieval calculations of multiple service nodes on multiple servers. The original architecture usually has a complete election mechanism and rules for controlling the online and offline operations of each service node. The general process is that ordinary data node services are online and request to join the cluster. After receiving the request from the online node, the main service master node performs node verification and allows it to join. This ensures that the service node can go online and join the cluster normally, and starts to rebalance and migrate data shards. When the node is offline, there are also corresponding offline removal rules, and the mechanism of restoring offline data shards on the surviving nodes is started to ensure high data availability. Therefore, it is very important to maintain the stable operation of the service node. In the prior art, in the retrieval cluster, the node's online and offline operation depends on the Zen discovery service, which uses the host node list configured by the node as the seed nodes, and performs node communication inspection and verification (Goss IP protocol) through multiple rounds of point-to-point ping requests. This process controls the detection interval frequency, timeout, and retry operations through multiple configurations such as ping_interval, ping_timeout, and ping_retries. The status of all nodes in the cluster can be quickly confirmed through the results of multiple rounds of inspections. Since discovery is a lightweight architecture, the role and status of the overall cluster node can be quickly controlled through this mechanism, and the information synchronization, information response, and role task execution of each node can be finally determined, providing a basis for elections and node online and offline operation.
[0003] When a ping request is sent to the retrieval cluster and an abnormal node is detected or a newly added node is detected, the node will be triggered to go online and offline. At this time, the cluster will respond according to the node role configuration, such as automatically starting data migration between cluster nodes according to the data balance. Although the existing discovery node mechanism can ensure cluster node status detection and cluster response under normal circumstances, it lacks a flexible verification mechanism in the processing of some abnormal scenarios. When some high-load large-scale clusters are running under high load, resources are shared by multiple applications or multiple instances of retrieval service nodes on the same machine. Due to resource crowding, the service node status is easily abnormal, and the node goes online and offline abnormally, consuming more unnecessary cluster performance, causing node and cluster operation instability, and the retrieval cluster cannot monitor and handle the situation in abnormal scenarios well. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a node security registration method, device, equipment and computer-readable storage medium to solve the problem of service node abnormality caused by resource crowding.
[0005] In order to solve the above technical problems, the present invention provides a node security registration method, comprising:
[0006] Get the node's online and offline information and resource information;
[0007] Determining whether the node is in a high load fault state according to the online and offline information and the resource information;
[0008] If the node is in a high load fault state, fuse protection is started for the node.
[0009] Optionally, determining whether the node is in a high-load fault state according to the online and offline information and the resource information includes:
[0010] Determine whether the node has online and offline abnormalities according to the online and offline information;
[0011] If the node has an online and offline abnormality, determine whether the node has a resource abnormality according to the resource information;
[0012] If a resource anomaly exists in the node, it is determined that the node is in a high load fault state.
[0013] Optionally, judging whether the node has online and offline abnormalities according to the online and offline information includes:
[0014] Counting the number of times the node goes online and offline in the current cycle, and judging whether the node has an online and offline risk according to whether the number of times the node goes online and offline in the current cycle exceeds a first threshold;
[0015] If the node has an online and offline risk, the number of online and offline risks of the node in the first historical time period is counted, and whether the node has online and offline abnormalities is determined according to whether the number of online and offline risks exceeds a second threshold. If the number of online and offline risks exceeds the second threshold, it is determined that the node has online and offline abnormalities;
[0016] If the node does not have the risk of going online or offline, the number of times the node goes online or offline in the second historical time period is counted, and whether the node has online or offline abnormalities is determined according to whether the number of times the node goes online or offline in the second historical time period exceeds a third threshold. If the number of times the node goes online or offline in the second historical time period exceeds the third threshold, it is determined that the node has online or offline abnormalities.
[0017] The second historical time period is greater than the first historical time period, and the first historical time period is greater than the current cycle.
[0018] Optionally, if the node has an online and offline abnormality, judging whether the node has a resource abnormality according to the resource information includes:
[0019] Determine whether the node has resource anomalies in the current cycle according to the resource information of the node in the current cycle;
[0020] If the node has resource anomalies in the current cycle, determining whether the node has resource anomalies in the third historical time period according to resource information of the node in the third historical time period;
[0021] If the node has resource anomalies in the third historical time period, determining that the node has resource anomalies;
[0022] If the node has no resource anomaly in the third historical time period, obtaining resource information of the node in the next cycle, and judging whether the node has resource anomaly in the next cycle according to the resource information of the node in the next cycle;
[0023] If the node has resource anomaly in the next cycle, it is determined that the node has resource anomaly.
[0024] Optionally, judging whether the node has resource anomaly in the current period according to the resource information of the node in the current period includes:
[0025] Determining whether the first resource of the node in the current period is abnormal according to the first resource information of the node in the current period;
[0026] If the first resource information of the node in the current period is abnormal, determining that the node has resource abnormality in the current period;
[0027] If the first resource of the node in the current cycle is not abnormal, then determine whether the second resource of the node in the current cycle is abnormal based on the second resource of the node in the current cycle; if the second resource of the node in the current cycle is abnormal, determine that the node has resource abnormality in the current cycle.
[0028] Optionally, judging whether the first resource of the node in the current period is abnormal according to the first resource information of the node in the current period includes:
[0029] If any one of the first resource information of the node in the current period is abnormal, it is determined that the first resource of the node in the current period is abnormal;
[0030] The first resource information includes memory information, disk information, and CPU information.
[0031] Optionally, after the step of starting fuse protection for the node, the method further includes:
[0032] The node is set to a silent state, and resource information of the node is continuously monitored. When a preset condition is met, the node is controlled to go back online.
[0033] The present invention also provides a node security registration device, comprising:
[0034] The acquisition module is used to obtain the online and offline information and resource information of the node;
[0035] A judgment module, used for determining whether the node is in a high load fault state according to the online and offline information and the resource information;
[0036] The protection module is used to start fuse protection for the node if the node is in a high load fault state.
[0037] The present invention also provides a node security registration device, comprising:
[0038] Memory for storing computer programs;
[0039] The processor is used to execute the computer program to implement the above-mentioned node security registration method.
[0040] The present invention also provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the above-mentioned node security registration method when executed by a processor.
[0041] It can be seen that this method obtains the node's online and offline information and resource information, and determines whether the node is in a high-load fault state based on the online and offline information and resource information. If the node is in a high-load fault state, the fuse protection is activated for the node. This method comprehensively evaluates whether the node is in a high-load fault state through online and offline information and resource information. If the node is in a high-load fault state, the fuse mechanism will be activated to prevent the node from performing abnormal online and offline actions. The node status registration and evaluation mechanism has been improved, effectively avoiding resource runs and data processing anomalies caused by abnormal conditions, and protecting the stable operation of nodes and clusters.
[0042] In addition, the present invention also provides a node security registration device, equipment and computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0044] Figure 1 A flowchart of a node security registration method provided by an embodiment of the present invention;
[0045] Figure 2 A flowchart of another node security registration method provided by an embodiment of the present invention;
[0046] Figure 3 A flowchart of another node security registration method provided by an embodiment of the present invention;
[0047] Figure 4 A flowchart of another node security registration method provided by an embodiment of the present invention;
[0048] Figure 5 A flowchart of another node security registration method provided by an embodiment of the present invention;
[0049] Figure 6 A flowchart of another node security registration method provided by an embodiment of the present invention;
[0050] Figure 7 A schematic diagram of the structure of a node security registration device provided by an embodiment of the present invention;
[0051] Figure 8 A schematic diagram of the structure of a node security registration device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] In some abnormal scenarios, such as high-load large-scale clusters, due to the high-load operation of the cluster, resources are shared by multiple applications or multiple instances of the same machine to retrieve service nodes. Once a resource run occurs, it is easy to cause abnormal service node status, which in turn causes the node to be disconnected and identified as an abnormal node, causing it to go offline. When the resources are released briefly, the node will be re-identified by the cluster and then go online, which repeatedly causes a vicious cycle of abnormal node up and down, not only causing abnormal node up and down, but also frequent node up and down operations, resulting in frequent startup and disconnection of data shards, causing the increase and decrease of associated shards, consuming more unnecessary cluster performance, and making nodes and clusters unstable. The present invention adds a new security registration process to the existing Discovery mechanism, and then adds a complete node status registration evaluation mechanism when collecting, monitoring and processing the node status through Discovery to protect the stable operation of nodes and clusters.
[0054] Embodiment 1:
[0055] Please refer to Figure 1 , Figure 1 A flowchart of a node security registration method provided by an embodiment of the present invention.
[0056] The method includes:
[0057] S101: Obtaining node online and offline information and resource information.
[0058] The processing object of this embodiment is the Discovery mechanism. This embodiment does not limit the frequency of obtaining online and offline information and resource information. For example, it can be obtained in real time, that is, after each acquisition operation is performed, the next acquisition operation is performed immediately; or it can also perform an acquisition operation at a preset time, such as performing an acquisition operation every 2 minutes; or it can also pre-set the acquisition frequency according to the cluster size and status to ensure the rationality of the detection operation; it can also set a set of default acquisition parameters first, including the list of information to be obtained and the frequency, and obtain it according to the default parameters. It can also add a custom parameter control window based on the default, and the user can customize the acquisition indicators and frequency, and adjust it on the basic default frequency. In order to ensure that the node status is judged in a timely manner based on the node information, this embodiment can use real-time acquisition to obtain the node's online and offline information and resource information. This embodiment does not limit the method for setting the frequency of node online and offline information and the frequency of resource information. The frequency of obtaining node online and offline information and the frequency of obtaining resource information can be set to be the same; or the frequency of obtaining online and offline information and the frequency of obtaining resource information can be set to be inconsistent, that is, the acquisition frequency of each information is set separately. Further, this embodiment does not limit the size of each acquisition frequency. For example, the frequency of obtaining node online and offline information can be greater than the frequency of obtaining resource information; or the frequency of obtaining resources can be greater than the frequency of obtaining online and offline; or a preset condition can be set, and when the preset condition is met, the corresponding information acquisition frequency is increased.
[0059] This embodiment does not limit the node online and offline information, for example, it can be the time point of each online and offline of the node; or it can be the time interval of each online and offline; or it can be the number of times the node goes online and offline within a certain period of time, that is, the frequency; or it can be the node online and offline success status; or it can be the data shard recovery status. Further, this embodiment does not limit the number of node online and offline information to be obtained, and the user can set it according to the actual situation, for example, one node online and offline information can be obtained; or multiple node online and offline information can be obtained.
[0060] This embodiment does not limit the resource information, for example, it can be CPU (Central Processing Unit) information; or it can also be RAM (Ramdom Access Memor) memory information; or it can also be hard disk information; or it can also be disk performance monitoring information, that is, disk space capacity; or it can also be network monitoring information, monitoring the health status of the network; or it can also be read-write status. The CPU information, RAM memory information, hard disk information, and disk space capacity can be resource usage, or it can also be the remaining status of resources. Further, this embodiment does not limit the number of resource information obtained, and the user sets it according to the actual situation. For example, one resource information of a node can be obtained; or multiple resource information of a node can be obtained. This embodiment does not limit the order of acquisition, for example, the online and offline information and resource information of the node can be obtained at the same time; it can also obtain the online and offline information first, and then obtain the resource information; it can also obtain the resource information first, and then obtain the online and offline information.
[0061] S102: Determine whether the node is in a high-load fault state according to the online and offline information and resource information.
[0062] This step does not limit the specific determination process. For example, the online and offline information and resource information can be analyzed first. This embodiment does not limit the frequency of analysis. For example, the online and offline information and resource information can be analyzed periodically; or real-time analysis can be performed. Further, this embodiment can analyze the online and offline information and resource information at the same time; or the online and offline information can be analyzed first and then the resource information; or the resource information can be analyzed first and then the online and offline information; wherein when the analysis has a sequence, a certain preset condition can be set, and then it is determined whether to perform subsequent analysis, for example, the preset condition can be set to analyze abnormalities, and when the online and offline information is analyzed and abnormalities are found, the resource information is analyzed. Among them, since the number and content of the online and offline information and resource information are not limited in step S101, this embodiment does not limit the analysis content of the online and offline information and the analysis content of the resource information. For example, all the acquired information can be analyzed, and if there is an abnormality, it is determined to be abnormal; or it can also select important acquired information, and when the important acquired information has an abnormality, it is abnormal. This embodiment does not limit the number and content of important acquired information, and the user sets it according to the actual situation. This embodiment does not limit the specific judgment conditions for information anomaly, for example, it can be exceeding a threshold; or it can also be success or failure; the threshold and success condition are set by the user according to actual conditions.
[0063] S103: If the node is in a high load fault state, fuse protection is started for the node.
[0064] After determining that a node is in a high-load fault state, the embodiment of the present invention starts fuse protection for the abnormal node according to the fuse instruction, immediately forces the node service to go offline, shuts down the node's ping request communication service, stops replying to the cluster's response actions and data shard recovery actions, and only keeps the necessary command-accepting services running.
[0065] In order to maintain the dynamic health of cluster nodes and make their operation more stable, after the fuse protection is started for the node, the node of this embodiment can be in a silent state and continuously monitor the resource information of the node. When the preset conditions are met, the control node is put back online, the ping request communication service of the node is started, the response action of the cluster is started, the node service is restored, and the data sharding is restored. Among them, this embodiment does not limit the preset conditions. For example, the preset condition can be that the resource information is restored to safety; for example, it can also be that the silent time is reached. Among them, this embodiment does not limit the silent time, and the user sets it according to the actual situation. Continuously detect abnormal nodes, and when certain conditions are met, restore the node's online action, and the node is put back online to maintain the dynamic health of cluster nodes and make their operation more stable, ensuring that the node is always in a dynamic and secure registration process.
[0066] The node security registration method provided by the embodiment of the present invention is applied to obtain the node's online and offline information and resource information; determine whether the node is in a high-load fault state based on the online and offline information and resource information; if the node is in a high-load fault state, start the fuse protection for the node. This method comprehensively evaluates whether the node is in a high-load fault state through the online and offline information and resource information. If the node is in a high-load fault state, the fuse mechanism will be started to prevent the node from performing abnormal online and offline actions. The node status registration evaluation mechanism is further improved, effectively avoiding resource runs and data processing anomalies caused by abnormal conditions, and protecting the stable operation of nodes and clusters. The node's resource information is continuously monitored after the fuse is blown, and when the preset conditions are met, it is put back online, which can maintain the dynamic health of the cluster nodes, make the operation more stable, and ensure that the nodes are always in a dynamic security registration process.
[0067] Based on the above embodiment, the online and offline information can be analyzed first, and after the online and offline anomalies are obtained by analyzing the online and offline information, the resource information can be analyzed. If the resource is abnormal, it is determined that the node is in a high-load fault state. The online and offline information is analyzed first, and the subsequent analysis process is started after the conditions are met. If the conditions are not met, the subsequent analysis process is not performed, which saves the time for subsequent information analysis and improves the analysis efficiency.
[0068] Embodiment 2:
[0069] Please refer to Figure 2 , Figure 2Another node security registration method flow chart provided by an embodiment of the present invention includes:
[0070] S201, obtaining online and offline information and resource information of the node.
[0071] Step S201 in this embodiment is consistent with step S101 in embodiment 1. Please refer to step S101 in embodiment 1 for details.
[0072] S202: Determine whether there is an online / offline abnormality based on the online / offline information of the node.
[0073] The embodiment of the present invention determines whether there is an abnormal online and offline situation by judging the online and offline information of the node. This embodiment does not limit the specific online and offline information of the node to be judged, and the unrestricted content is consistent with the unrestricted online and offline information of the node in Embodiment 1. Please refer to step S101 in Embodiment 1 for details.
[0074] This embodiment does not limit the time period when the online and offline abnormalities occur. For example, it is possible to directly determine whether the online and offline abnormalities occur based on the online and offline information of the current period; it is also possible to determine whether the online and offline abnormalities occur based on the online and offline information of the historical time period; it is also possible to determine whether the online and offline abnormalities occur based on the online and offline information of the current period and the historical time period. This embodiment does not limit the order of determining whether the online and offline abnormalities occur in the current period and the historical time period. For example, it is possible to first determine whether the online and offline information of the current period is abnormal. If it is abnormal, that is, there is an online and offline risk, then the online and offline information of the historical time period is obtained, and then it is determined whether the online and offline information of the historical period is abnormal; it is also possible to combine the information of the current period and the online and offline information of the historical time period to determine whether the online and offline abnormalities occur. The present embodiment does not limit the specific judgment conditions for online and offline risks, and the unrestricted content is consistent with the unrestricted content for analyzing the online and offline information of the node in step S102 of embodiment 1. While ensuring efficiency and accuracy, the judgment conditions for online and offline risks in the present embodiment can be that when the number of online and offline times in the current cycle reaches a certain threshold, it is confirmed that there is an online and offline risk. Because the number of online and offline times is an important indicator for judging whether there is an abnormality in online and offline times, it can be determined whether there is a risk of the node going online and offline in the current cycle by judging the number of online and offline times, which improves efficiency and ensures accuracy. The present embodiment does not limit the threshold, and the user sets it according to the actual situation.
[0075] In order to make the judgment conditions more sufficient, reduce the omissions of judgments on abnormal node online and offline operations, and improve the accuracy, when it is confirmed that there is no online and offline risk, it is also possible to determine whether the online and offline operations are abnormal by obtaining the number of online and offline operations in a longer historical period.
[0076] In summary, the specific contents of judging whether there are abnormalities in online and offline information of nodes are as follows: Figure 3 As shown, Figure 3 This is a flow chart of another secure registration method according to an embodiment of the invention.
[0077] S301, counting the number of times a node goes online and offline in the current cycle.
[0078] This embodiment does not limit the current period. For example, the period may be 1 minute or 2 minutes, and the user can set it according to actual conditions.
[0079] S302, determine whether the number of times the node goes online and offline in the current cycle exceeds a first threshold. If so, there is an online and offline risk, and step S303 is executed. If not, there is no online and offline risk, and step S305 is executed.
[0080] This embodiment does not limit the current cycle and the first threshold, for example, it can be once a minute. If the counted number of online and offline times exceeds once within a minute, there is a risk of abnormal online and offline times, and step 303 is executed. If the counted number of online and offline times does not exceed once within a minute, step 305 is executed.
[0081] S303, counting the number of times the node goes online or offline in the first historical time period.
[0082] This embodiment does not limit the first historical time period, as long as it is greater than the current period. For example, if the current period is set to 1 minute, the first historical time period can be 2 minutes or 3 minutes.
[0083] S304, determining whether the number of online and offline risks exceeds a second threshold, if so, executing S307.
[0084] This embodiment does not limit the second threshold value, and the user can set it according to actual conditions.
[0085] S305, counting the number of times the node goes online and offline in the second historical time period.
[0086] This embodiment does not make any specific limitation on the second historical time period, as long as it is greater than the first historical time period. For example, if the first historical time period is set to 5 minutes, the second historical time period can be 10 minutes or 15 minutes.
[0087] S306, determining whether the number of times the node goes online and offline in the second time period exceeds a third threshold, and if so, executing S307.
[0088] This embodiment does not limit the third threshold value, and the user can set it according to actual conditions.
[0089] S307: Determine that there is an online and offline abnormality in the node.
[0090] Through the above steps, it is determined that there is an online and offline anomaly in the node. In order to better analyze and respond more quickly and save time, the abnormal information and the time when the abnormal information occurs can be recorded and archived in the node where the service is located. Each abnormal record forms an event, forming a timeline of node online and offline events.
[0091] The following is a specific example to explain the above judgment of whether online and offline information is abnormal:
[0092] Set the current cycle to 1 minute, the first threshold to 1, the first historical time period to 3 minutes, the second threshold to 3, the second historical time period to 20 minutes, and the third threshold to 5. If there is one online and offline action within 1 minute of the current cycle, it is determined that there is an abnormal risk, and the online and offline information in the 3-minute time period before the current cycle is obtained. When there are more than 3 online and offline actions, it is determined that the online and offline are abnormal; if there is no online and offline action within 1 minute of the current cycle, the number of online and offline actions in the 20-minute time period before the current cycle is counted. If the number of online and offline actions in the 20-minute time period before the current cycle is more than 5 times, it is determined that the online and offline are abnormal.
[0093] S203: Determine whether there is a resource anomaly in the node according to the resource information of the node.
[0094] The embodiment of the present invention determines whether there is a resource anomaly by judging the resource information of the node. This embodiment does not limit the resource information of the specific node to be judged, and the unrestricted content is consistent with the resource information of the unrestricted node in Example 1. Please refer to step S101 in Example 1 for details. This embodiment can also divide the resource information to be analyzed into first resource information (fixed resource information) and (customized resource information). This embodiment does not limit the fixed resource information and the custom information, and it is set according to the actual situation of the user.
[0095] In order to better analyze the resource status of the node in the future, based on experience, this embodiment can analyze the node's CPU usage information, RAM memory information, hard disk information, disk performance monitoring information, and network monitoring information, among which CPU usage information, RAM memory information, and hard disk information are used as the first resource information. This setting can improve the judgment speed and ensure the accuracy of the judgment.
[0096] This embodiment does not limit the time period of resource anomalies. For example, it is possible to directly determine whether a resource is abnormal based on the resource information in the current period; it is also possible to determine whether a resource is abnormal based on the resource information in the historical time period; it is also possible to determine whether a resource is abnormal based on the resource information in the current period and the historical time period. This embodiment does not limit the order of determining whether a resource is abnormal in the current period and the historical time period. For example, it is possible to first determine whether the resource information in the current period is abnormal. If it is abnormal, the resource information in the historical time period is obtained, and then determine whether the resource information in the historical period is abnormal; it is also possible to combine the resource information in the current period and the resource information in the historical time period to determine whether a resource is abnormal. Among them, this embodiment does not limit the specific judgment conditions of resource anomalies in the current cycle, and the unrestricted content is the same as the analysis of resource information content in step S102 of embodiment 1. While ensuring efficiency and accuracy, the judgment conditions of resource anomalies in the current cycle in this embodiment can be to judge the first resource information and the second resource information in the current cycle. This embodiment does not limit the judgment order, for example, it can be judged at the same time, or the first resource information in the current cycle can be judged first, and then the second resource information can be judged; wherein when there is a judgment order, it can also be a second judgment when the preset conditions are met, for example, when the first resource information in the current cycle is not abnormal, the second resource information can be judged again, and if the first resource information in the current cycle is abnormal, it is directly determined that the resource is abnormal in the current cycle. This embodiment does not limit the judgment conditions of the first resource anomaly, for example, it can be CPU usage information abnormality; it can also be RAM memory information abnormality, and it can also be hard disk information abnormality; further, in order to respond more quickly, when there is an abnormality in the first resource information, it is determined that the first resource information in the current cycle of the node is abnormal. The unrestricted content of the judgment conditions of the second resource anomaly in this embodiment is similar to the unrestricted content of the judgment conditions of the first resource anomaly, and will not be repeated here.
[0097] In order to analyze resources more comprehensively, when a node has resource anomalies in the current cycle, but no anomalies in the historical period, it is necessary to obtain resource information in the next cycle. If the resource information in the next cycle is abnormal, the resource information of the node is abnormal.
[0098] In summary, the specific content of judging whether there is resource anomaly based on the resource information of the node is as follows: Figure 4 As shown, Figure 4 Another flow chart of a secure registration method according to an embodiment of the invention includes:
[0099] S401, judging whether there is a resource anomaly in the current cycle according to the resource information of the node in the current cycle, if yes, executing step S402.
[0100] This embodiment first determines whether the first resource information in the current period is abnormal. If it is not abnormal, it then determines whether the second resource information in the current period is abnormal. Figure 5 , Figure 5 Another flow chart of a secure registration method according to an embodiment of the invention includes:
[0101] S501, judging whether the first resource information in the current cycle is abnormal according to the first resource information of the node in the current cycle, if so, executing step S502, if not, executing step S503.
[0102] This embodiment does not limit the cycle. In this embodiment, the first resource information can be CPU usage information, RAM memory information, and hard disk information. If one of them is abnormal, the first resource is abnormal in the current cycle. This embodiment does not limit the CPU abnormality judgment condition, for example, it can be that the usage rate exceeds a certain value (self-set), or it can also be that the maximum number of CPU queues exceeds a certain value (self-set); further, this embodiment does not limit the number of conditions for judging the CPU situation, for example, it can be one or more. This embodiment can determine the RAM memory situation by judging that the RAM memory usage rate exceeds a certain value (self-set); this embodiment does not limit the judgment condition of the hard disk abnormality, for example, it can be that the data disk exceeds a certain value (self-set), or it can also be that the data disk exceeds a certain value (self-set), and further, this embodiment does not limit the number of conditions for judging the hard disk situation, for example, it can be one or more. When the above information is abnormal, a corresponding early warning action needs to be generated, and the resource information is recorded. The abnormal information and the time when the abnormal information appears can be recorded and archived in the node where the service is located. Each abnormal record forms an event, forming the node first resource event timeline.
[0103] S502: Determine whether a node has resource anomalies in the current cycle.
[0104] It is determined that a resource anomaly exists in the node within the current cycle. This embodiment does not limit the cycle.
[0105] S503, judging whether the second resource in the current cycle is abnormal according to the second resource of the node in the current cycle, and if so, executing step S502.
[0106] The second resource is a custom resource. If there is an abnormality in the second resource, it is determined that the second resource is abnormal in the current cycle. This embodiment does not limit the second resource information, for example, it can be network monitoring information; it can also be disk performance monitoring information. This embodiment does not limit the network abnormality judgment condition, for example, it can be network transmission delay; or it can also be that the network packet loss rate exceeds the packet loss rate threshold. Further, this embodiment does not limit the number of conditions for judging the network, for example, it can be one or more. This embodiment does not limit the judgment condition for disk abnormality, for example, it can be when the disk usage rate exceeds the disk usage threshold; or it can also be when the queue delay parameter reaches the parameter threshold. Further, this embodiment does not limit the number of conditions for judging the disk, for example, it can be one or more; wherein the disk usage threshold, parameter threshold, packet loss rate threshold, and network delay time are all set by the user according to actual conditions. When the above information is abnormal, a corresponding early warning action needs to be generated, and the corresponding resource information is recorded. The abnormal information and the time when the abnormal information appears can be recorded and archived in the node where the service is located. Each abnormal record forms an event, forming a node second resource event timeline.
[0107] S402, judging whether the node has resource anomalies in the third historical time period according to the resource information of the node in the third historical time period, if yes, executing step S403, if no, executing step S404.
[0108] This embodiment does not limit the third historical time period, and the user can set it according to the actual situation. The resource anomaly in this embodiment may include that the first resource anomaly or the second resource anomaly is a resource anomaly condition.
[0109] S403, determining that resources are abnormal.
[0110] Determine if the node's resources are in an abnormal state.
[0111] S404, obtaining resource information for the next cycle.
[0112] If resource information anomalies exist only in the current cycle, but there are no resource anomalies in the third historical period, it is necessary to obtain resource information in the next cycle.
[0113] S405, judging whether there is a resource anomaly in the next cycle according to the resource information in the next cycle, and if so, executing step S403.
[0114] The unlimited content of judging whether there is a resource anomaly in the next cycle based on the resource information in the next cycle is consistent with the unlimited content of judging whether there is a resource anomaly in the current cycle based on the resource information in the current cycle of the node in step S501 in Example 2. For specific content, please refer to step S501 in Example 2.
[0115] The following is a specific example to explain the above judgment of whether a resource is abnormal based on resource information:
[0116] Set CPU usage information, memory usage information, and disk performance monitoring information as the first resource information; set network monitoring information and disk performance monitoring information as the second resource information; then the default CPU can exceed 100%, and the default CPU queue number does not exceed 10; the default RAM memory usage cannot exceed 85%; the default disk usage exceeds 100%, and the queue delay parameter cannot exceed 500ms. Set network threshold parameters, network delay cannot be greater than 200ms and packet loss rate cannot be greater than 0.5%; set disk information parameters, disk usage cannot exceed 100% and queue delay parameters cannot exceed 500ms. The cycle is set to 1 minute, and the historical third time is set to 10 minutes. Then, analyze whether there is any abnormality in the first resource information within the current 1 minute. If one of them is abnormal, such as abnormal CPU usage, it is determined that the resource information in the current cycle is abnormal; if the first resource information in the current 1 minute is not abnormal, analyze whether there is any abnormality in the second resource information in the current 1 minute. If one of them is abnormal, such as abnormal disk usage information, it is determined that the resource information in the current cycle is abnormal; when the resource information in the current cycle is abnormal, analyze whether there is abnormal resource information in the previous ten minutes. If so, it is determined that the resource information of the node is abnormal. If not, wait for the resource information obtained in the next 1 minute. If the abnormal resource information in the next minute is still abnormal, it is determined that the resource information of the node is abnormal. If the abnormal resource information is restored in the next minute, it is determined that the resource information of the node is normal.
[0117] In order to better analyze and apply the data, this embodiment can record the node monitoring information obtained in each cycle, encapsulate the data, and merge the node first resource event timeline, the node second resource event timeline, and the node online and offline event timeline to form an event timeline, so as to facilitate the analysis of the node status through the event timeline. In order to respond to abnormal nodes more promptly and improve the overall work efficiency, this embodiment can increase the priority of analyzing events and increase the monitoring frequency and judgment frequency of nodes when it is determined that an abnormal event occurs in the event timeline of the node. For example, when it is determined that the current node has an online and offline risk, the online and offline information in the first time period of history is immediately obtained, the number of online and offline times in the first time period of history is counted, and the priority of this action is set to the highest level; for example, when it is determined that the current resource information is abnormal, the resource information in the third time period of history is immediately obtained, and the priority of this action is set to the highest level.
[0118] S204, determining that the node is in a high-load fault state, starting fuse protection for the node, and continuously monitoring resource information. When the preset conditions are met, the control node is put back online.
[0119] The content of this step is consistent with the content of step S103 in Example 1. Please refer to step S103 in Example 1 for details.
[0120] Based on Example 1, this embodiment first determines whether there is an online and offline risk based on the number of online and offline times of the node in the current cycle. If there is a risk, then determine whether there is an online and offline anomaly based on the number of risks in the first historical time period. If there is no risk, then determine whether there is an online and offline anomaly based on the number of online and offline times in the second historical time period. This method can increase the accuracy of judgment, not only to determine the current online and offline status of the node, but also to analyze the online and offline status over a longer period of time, to avoid easily generating a fuse and reduce the burden on the processor.
[0121] This embodiment divides resource information into first resource information and second resource information, wherein the first resource information includes memory information, disk information, and CPU information, and if any one of the first resource information is abnormal, the first resource information is abnormal, and in the current cycle, the first resource information is first judged, and if the first resource information is not abnormal, the second resource information is judged, which reduces the judgment content and saves certain resources. If the resource information in the current cycle is abnormal, the resource information in the third historical time period is analyzed. If the resource information in the current cycle is not abnormal, wait for the resource information of the next cycle to be obtained and analyzed, and the overall comprehensive analysis of the resource situation is more accurate, avoids misjudgment, and improves accuracy. The specific content of the second resource information and the threshold value of whether the specific information is abnormal are set by the user, and the application scenario is more extensive.
[0122] This embodiment records the abnormal information to form an event timeline, which is more conducive to the overall analysis of current data and historical data, improves efficiency, and when there is abnormal information in the event timeline, the corresponding processing priority is quickly raised to the highest priority, abnormal risks are handled in a timely manner, and corresponding judgments and responses are made to avoid wasting resources. For details, please refer to Figure 6 , Figure 6 A flow chart of another node security registration method provided by an embodiment of the present invention.
[0123] The node security registration device provided in an embodiment of the present invention is introduced below. The node security registration device described below and the node security registration method described above can be referenced to each other.
[0124] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of a node security registration device provided by an embodiment of the present invention may include:
[0125] The acquisition module 100 is used to acquire the online and offline information and resource information of the node;
[0126] The judgment module 200 is used to determine whether the node is in a high load fault state according to the online and offline information and resource information;
[0127] The protection module 300 is used to start fuse protection for the node if the node is in a high load fault state.
[0128] The node security registration device provided by the embodiment of the present invention is applied to obtain the node's online and offline information and resource information; based on the online and offline information and resource information, determine whether the node is in a high-load fault state; if the node is in a high-load fault state, start the fuse protection for the node. This device comprehensively evaluates whether the node is in a high-load fault state through the online and offline information and resource information. If the node is in a high-load fault state, it will start the fuse mechanism to prevent the node from performing abnormal online and offline actions. The node status registration evaluation mechanism is further improved, effectively avoiding resource runs and data processing anomalies caused by abnormal conditions, and protecting the stable operation of nodes and clusters.
[0129] Based on the above embodiment, the acquisition module 100 may include:
[0130] A first acquisition unit, used to acquire online and offline information;
[0131] The second acquisition unit is used to acquire resource information.
[0132] Based on the above embodiment, the determination module 200 may include:
[0133] The first judgment unit is used to judge whether there is an online and offline abnormality of the node according to the online and offline information;
[0134] The second judgment unit is used to judge whether there is a resource abnormality in the node according to the resource information if there is an online and offline abnormality in the node;
[0135] The first determining unit is used to determine that the node is in a high load fault state if there is a resource abnormality in the node.
[0136] Based on the above embodiment, after the protection module 300, the following may also be included:
[0137] The control unit is used to set the node to a silent state and continuously monitor the resource information of the node. When the preset conditions are met, the control node is put back online.
[0138] Based on the above embodiment, the first judgment unit may include:
[0139] The first statistical subunit is used to count the number of times a node goes online and offline in the current cycle;
[0140] A first judgment subunit is used to judge whether the node has an online and offline risk according to whether the number of online and offline times of the node in the current cycle exceeds a first threshold;
[0141] The second statistical sub-unit is used to count the number of times the node has the risk of going online or offline in the first historical time period if the node has the risk of going online or offline;
[0142] The second judgment subunit is used to judge whether there is an online and offline abnormality of the node according to whether the number of online and offline risks exceeds a second threshold;
[0143] A first determination subunit is used to determine that there is an online and offline anomaly of the node if the number of online and offline risks exceeds the second threshold;
[0144] The third statistical sub-unit is used to count the number of times the node goes online and offline in the second historical time period if there is no risk of the node going online and offline;
[0145] The third judgment subunit is used to judge whether there is an online and offline abnormality of the node according to whether the number of online and offline times of the node in the second historical time period exceeds a third threshold;
[0146] A second determination subunit is used to determine that there is an online and offline anomaly of the node if the number of online and offline times of the node in the second historical time period exceeds a third threshold;
[0147] The first conditional subunit is used when the second historical time period is greater than the first historical time period, and the first historical time period is greater than the current cycle.
[0148] Based on the above embodiment, the second judgment unit may include:
[0149] A fourth judgment subunit is used to judge whether a node has resource anomalies in the current cycle according to the resource information of the node in the current cycle;
[0150] A fifth judgment subunit is used to judge whether the node has resource anomalies in the third historical time period according to resource information of the node in the third historical time period if the node has resource anomalies in the current cycle;
[0151] A third determining subunit is used to determine that the node resource is abnormal if the node has resource abnormality within a third historical time period;
[0152] A first acquisition subunit is used to acquire resource information of the node in the next cycle if there is no resource anomaly of the node in the third historical time period;
[0153] A sixth judgment subunit, used to judge whether the node has resource anomaly in the next cycle according to the resource information of the node in the next cycle;
[0154] The fourth determining subunit is used to determine that the node resource is abnormal if the node has resource abnormality in the next cycle.
[0155] The node security registration device provided in an embodiment of the present invention is introduced below. The node security registration device described below and the node security registration method described above can be referenced to each other.
[0156] Please refer to Figure 8 , Figure 8 A schematic diagram of the structure of a node security registration device provided by an embodiment of the present invention, the node security registration device includes a memory and a processor, wherein:
[0157] A memory 10, used for storing computer programs;
[0158] The processor 11 is used to execute a computer program to implement the above-mentioned node security registration method.
[0159] like Figure 7 As shown in FIG. 1 , it is a schematic diagram of the structure of the node security registration device, which may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 communicate with each other through the communication bus 13. Of course, it should be noted that Figure 7 The structure shown does not constitute a limitation on the node security registration device in the embodiment of the present application. In actual applications, the node security registration device may include Figure 7 More or fewer components than shown, or combinations of certain components.
[0160] The computer-readable storage medium provided in an embodiment of the present invention is introduced below. The computer-readable storage medium described below and the node security registration method described above can be referenced to each other.
[0161] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned node security registration method are implemented.
[0162] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0163] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0164] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0165] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0166] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0167] The node security registration method, device, equipment and computer-readable storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A node security registration method, characterized in that: include: Get the node's online and offline information and resource information; Determining whether the node is in a high-load fault state according to the online and offline information and the resource information; If the node is in a high load fault state, fuse protection is started for the node; Wherein, determining whether the node is in a high load fault state according to the online and offline information and the resource information includes: Determine whether the node has online and offline abnormalities according to the online and offline information; If the node has an online and offline abnormality, determine whether the node has a resource abnormality according to the resource information; If there is a resource anomaly in the node, determining that the node is in a high load fault state; Wherein, judging whether the node has online and offline abnormalities according to the online and offline information includes: Counting the number of times the node goes online and offline in the current cycle, and judging whether the node has an online and offline risk according to whether the number of times the node goes online and offline in the current cycle exceeds a first threshold; If the node has an online and offline risk, the number of online and offline risks of the node in the first historical time period is counted, and whether the node has online and offline abnormalities is determined according to whether the number of online and offline risks exceeds a second threshold. If the number of online and offline risks exceeds the second threshold, it is determined that the node has online and offline abnormalities; If the node does not have the risk of going online or offline, the number of times the node goes online or offline in the second historical time period is counted, and whether the node has online or offline abnormalities is determined according to whether the number of times the node goes online or offline in the second historical time period exceeds a third threshold. If the number of times the node goes online or offline in the second historical time period exceeds the third threshold, it is determined that the node has online or offline abnormalities. The second historical time period is greater than the first historical time period, and the first historical time period is greater than the current cycle.
2. The node security registration method according to claim 1, characterized in that: If the node is online or offline abnormal, judging whether the node has resource abnormality according to the resource information includes: Determine whether the node has resource anomalies in the current cycle according to the resource information of the node in the current cycle; If the node has resource anomalies in the current cycle, determining whether the node has resource anomalies in the third historical time period according to resource information of the node in the third historical time period; If the node has resource anomalies in the third historical time period, determining that the node has resource anomalies; If the node has no resource anomaly in the third historical time period, obtaining resource information of the node in the next cycle, and judging whether the node has resource anomaly in the next cycle according to the resource information of the node in the next cycle; If the node has resource anomaly in the next cycle, it is determined that the node has resource anomaly.
3. The node security registration method according to claim 2, characterized in that: The determining, according to the resource information of the node in the current period, whether the node has resource anomaly in the current period includes: Determining whether the first resource of the node in the current period is abnormal according to the first resource information of the node in the current period; If the first resource information of the node in the current period is abnormal, determining that the node has resource abnormality in the current period; If the first resource of the node in the current cycle is not abnormal, then determine whether the second resource of the node in the current cycle is abnormal based on the second resource of the node in the current cycle; if the second resource of the node in the current cycle is abnormal, determine that the node has resource abnormality in the current cycle.
4. The node security registration method according to claim 3, characterized in that: The determining whether the first resource of the node in the current period is abnormal according to the first resource information of the node in the current period includes: If any one of the first resource information of the node in the current period is abnormal, it is determined that the first resource of the node in the current period is abnormal; The first resource information includes memory information, disk information, and CPU information.
5. The node security registration method according to any one of claims 1 to 4, characterized in that: After the fusing protection is started for the node, the method further includes: The node is set to a silent state, and resource information of the node is continuously monitored. When a preset condition is met, the node is controlled to go back online.
6. A device for node security registration, characterized in that: include: The acquisition module is used to obtain the online and offline information and resource information of the node; A judgment module, used for determining whether the node is in a high load fault state according to the online and offline information and the resource information; A protection module, configured to start fuse protection for the node if the node is in a high load fault state; Wherein, the judgment module includes: The first judgment unit is used to judge whether there is an online and offline abnormality of the node according to the online and offline information; The second judgment unit is used to judge whether there is a resource abnormality in the node according to the resource information if there is an online and offline abnormality in the node; A first determining unit, configured to determine that the node is in a high load fault state if a resource abnormality exists in the node; Wherein, the first judgment unit includes: The first statistical subunit is used to count the number of times a node goes online and offline in the current cycle; A first judgment subunit is used to judge whether the node has an online and offline risk according to whether the number of online and offline times of the node in the current cycle exceeds a first threshold; The second statistical sub-unit is used to count the number of times the node has the risk of going online or offline in the first historical time period if the node has the risk of going online or offline; The second judgment subunit is used to judge whether there is an online and offline abnormality of the node according to whether the number of online and offline risks exceeds a second threshold; A first determination subunit is used to determine that there is an online and offline anomaly of the node if the number of online and offline risks exceeds the second threshold; The third statistical sub-unit is used to count the number of times the node goes online and offline in the second historical time period if there is no risk of the node going online and offline; The third judgment subunit is used to judge whether there is an online and offline abnormality of the node according to whether the number of online and offline times of the node in the second historical time period exceeds a third threshold; A second determination subunit is used to determine that there is an online and offline anomaly of the node if the number of online and offline times of the node in the second historical time period exceeds a third threshold; The first conditional subunit is used when the second historical time period is greater than the first historical time period, and the first historical time period is greater than the current cycle.
7. A device for node security registration, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the node security registration method as described in any one of claims 1 to 5 when executing the computer program.
8. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the node security registration method according to any one of claims 1 to 5 are implemented.
