Connection status detection method and related equipment
By automatically generating and deploying node network detection lists, and using asynchronous network detection requests, the problem of manual establishment of detection lists in the existing technology is solved, and fast and efficient node connection status detection is achieved.
Patent Information
- Application Number
- CN202111239680.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-10-25
AI Technical Summary
When managing network cluster nodes, the existing technology requires manually establishing a node's detection list, which is time-consuming and inefficient. The host issues too many detection instructions, occupying resources, and it is difficult to quickly determine the failed nodes that fail to connect.
It provides a connection status detection method, which generates a detection list by collecting source node information of each host, automatically compiling a node network detection list, and sends network detection requests through asynchronous means to reduce the host resource usage and quickly determine the reason for connection failure.
It reduces the detection instructions issued by the host, reduces the occupation of host resources, realizes automated node network detection list management, and quickly identifys the causes of problems.
Smart Images

Figure CN116032796B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a connection status detection method and related equipment. Background Art
[0002] When managing network cluster nodes, it is necessary to ensure that the connection status between each node is normal so that the node's application services can operate normally. When it is necessary to detect the connection status of the node, the host responsible for monitoring often needs to issue a large number of detection instructions to multiple nodes. The loading and running of a large number of programs will inevitably cause the host's resources to be occupied in large quantities and affect the host's normal execution of other tasks. Existing detection of the connection status of nodes usually requires manual establishment of a node detection list. When the number of source nodes is large, manually establishing a detection list is extremely time-consuming and inefficient. Furthermore, after the host issues a detection instruction, each node directly obtains the connection status. If the connection status is a connection failure, it is difficult to quickly determine the faulty node with the problem. Summary of the invention
[0003] In view of the above, it is necessary to provide a connection status detection method and related equipment, which can reduce the detection instructions issued by the host, reduce the occupation of host resources, and automatically compile a node network detection list and deploy the list to each node, improve the management of the node network list, and quickly determine the cause of the problem based on the detection results.
[0004] The first aspect of the present application provides a connection status detection method, which is applied to a monitoring host, wherein the monitoring host is connected to multiple hosts, each of which includes a source node. The connection status detection method includes: collecting source node information of each host and generating a detection list, wherein the detection list includes: source nodes of each host, multiple network interfaces of each source node, and multiple target nodes, wherein each network interface corresponds to a target node; selecting a source node from the source nodes as a source node to be detected; sending a network detection request to the source node to be detected, controlling the source node to be detected to determine the target node corresponding to the source node to be detected according to the detection list; detecting the connection status between the source node to be detected and the target node and obtaining a detection result; receiving the detection result sent by the source node to be detected, and if the detection result includes a detection result indicating a connection failure, determining the cause of the connection failure based on the detection result and the detection list.
[0005] In an optional embodiment, the method further includes: setting a plurality of source node groups according to all source nodes in the detection list; determining a source node group to be detected from the plurality of source node groups; determining a network interface to be detected of each source node in the source node group to be detected, and determining a target node connected to the network interface to be detected; removing target nodes that are under maintenance or shut down from the detection list to update the detection list; and storing the detection list on the source node to be detected.
[0006] In an optional embodiment, the collecting of source node information of each host and generating a detection list includes: collecting the IP address of the host of each source node; based on the IP address, collecting network information of each source node, the network information includes: the network interface of each source node and the IP address of the target node connected to each network interface; generating the detection list based on the network information.
[0007] In an optional embodiment, the collecting of network information of all source nodes according to the IP address includes: the monitoring host uses an asynchronous method to send a collection instruction to each of the source nodes through a secure shell protocol (Secure Shell), wherein each of the source nodes collects the network information through a CollectVlanIPTable Shell script, and checks whether the format of the network information is correct; if the format of the network information is correct, control each of the source nodes to obtain parsing information from the network information, and the parsing information includes: the network interface of each of the source nodes, and the IP address of the target node connected to the network interface of each of the source nodes; control each of the source nodes to convert the parsing information into a JSON format file, and control each of the source nodes to serialize the JSON format file into a string type file; receive the string type file sent by each of the source nodes; merge the received string type files that meet the format requirements according to the JSON format, and generate the detection list.
[0008] In an optional implementation, storing the detection list on the source node to be detected includes: using an rsync synchronization tool to store the detection list on the source node to be detected.
[0009] In an optional implementation, storing the detection list on the source node to be detected further comprises: storing the detection list on the source node to be detected in an asynchronous manner.
[0010] In an optional embodiment, detecting the connection status between the source node to be detected and the target node and obtaining the detection result includes: controlling the source node to be detected to read the content in the detection list according to the network detection request, and detecting the connection status between the source node to be detected and the target node in an asynchronous manner to obtain the detection result, wherein the source node to be detected stores the detection result in JSON format; receiving the detection result in JSON format sent by the source node to be detected.
[0011] In an optional embodiment, the determination of the cause of the connection failure based on the detection result and the detection list includes: if it is detected that the source node to be detected fails to connect with the target node through the first network interface, and it is detected that the source node to be detected successfully connects with the target node through the second network interface, it is determined that there is a problem with the first network interface of the source node to be detected.
[0012] A second aspect of the present application provides an electronic device, the electronic device comprising a processor and a memory, the processor being configured to implement the connection status detection method when executing a computer program stored in the memory.
[0013] A third aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the connection status detection method is implemented.
[0014] The present application utilizes the connection status detection method and related equipment to reduce the detection instructions issued by the host, reduce the host resource usage, automatically compile a node network detection list and deploy the list to each node, improve the problem of managing the node network list, and quickly converge the cause of the problem based on the detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 Schematic diagram of the connection between the monitoring host and multiple hosts provided in the embodiment of the present application
[0016] Figure 2 A flow chart of a connection status detection method provided in an embodiment of the present application
[0017] Figure 3 Flow chart for collecting network information of each source node provided in the embodiment of the present application
[0018] Figure 4 Connection status detection flow chart provided for the embodiment of the present application
[0019] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application DETAILED DESCRIPTION
[0020] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The embodiments described are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0023] The connection status detection method provided in the present application can be used for connection status detection between nodes, and the method runs on a monitoring host.
[0024] See also Figure 1 1 is a schematic diagram of a connection between a monitoring host and multiple hosts provided in an embodiment of the present application. A monitoring host 101 is in communication connection with multiple hosts 102 , and each host 102 includes a source node 103 .
[0025] The monitoring host 101 is used to control each host 102, and the host 102 provides an IP address for the source node 103. In one embodiment, the IP address of the host 102 is the IP address of the source node 103.
[0026] In one embodiment, a host 102 includes a source node 103 , and each source node 103 corresponds to a host 102 .
[0027] See also Figure 2 FIG. 1 is a flow chart of a connection status detection method provided in an embodiment of the present application. The method specifically includes the following process.
[0028] 201. The monitoring host 101 collects information of the source node 103 of the host 102 and generates a detection list.
[0029] In at least one embodiment of the present application, the monitoring host 101 collects the IP address of each host 102, that is, the IP address of each source node 103. Each host 102 is a host managed by the monitoring host 101. According to the IP address of each host 102 collected by the monitoring host 101, the network information of each source node 103 is collected, and a detection list is generated, wherein the detection list includes: the source node 103 of each host 102, multiple network interfaces of each source node 103, and multiple target nodes, wherein each network interface corresponds to at least one target node. For example, the IP address of the first host managed by the monitoring host 101 is: 127.132.128.64, the monitoring host 101 collects the IP address of the first host, and addresses according to the IP address of the first host, and collects the network information of the source node 103 on the first host. The network information includes: the network interface of each source node 103, and the IP address of the target node connected to the network interface of each source node 103.
[0030] In another embodiment of the present application, multiple source node groups are set according to all source nodes 103 in the detection list, each source node group includes at least one source node 103 and a source node 103 can only exist in one group. Source node groups represent source nodes with the same role or function. For example: Compute group, Control group, Network group, Storage group, each group includes multiple sub-groups, for example, Compute1 group to Computen, Control1 group to Control n group, Network1 to Network n group. Among all source node groups, the user determines the source node group to be detected from multiple source node groups by monitoring the host 101.
[0031] In at least one embodiment of the present application, determining the network interface to be detected of each source node 103 in the group of source nodes to be detected includes:
[0032] In this embodiment, the network interface exists on the source node 103 , and one source node 103 has multiple network interfaces, for example, Interface 1 and Interface 2 . The user determines the network interface to be detected through the monitoring host 101 .
[0033] In at least one embodiment of the present application, at least one is selected from the source nodes 103 of each host 102 in the detection list as the source node to be detected. For example, the user selects 20 source nodes 103 as the source nodes to be detected by monitoring the host 101, and the detection list only includes the network interfaces to be detected of the selected 20 source nodes and the target nodes connected to the network interfaces to be detected. Further, the target nodes in the closed state or maintenance state in the detection list can be eliminated to update the detection list. The target nodes eliminated in the detection list may come online again at some time, and when the eliminated target nodes come online again, these target nodes can be rejoined in the detection list. Among them, the source nodes in the source node group to be detected can be selected as the source nodes to be detected, or the source nodes to be detected can be selected according to the IP addresses of the source nodes.
[0034] 202. Store the detection list on the source node to be detected.
[0035] In at least one embodiment of the present application, the monitoring host 101 uses an asynchronous method and stores the detection list on the source node to be detected through the rsync synchronization tool. The rsync synchronization tool can synchronously update files and directories of two computers (for example, the monitoring host 101 and the host 102 in the embodiment of the present application), and appropriately use differential encoding to reduce the amount of data transmission. Because the source node 103 exists on the host 102, the detection list existing in the monitoring host 101 can be synchronously updated to the source node to be detected on the host 102 using the rsync synchronization tool.
[0036] 203. Send a network detection instruction to the source node to be detected, detect the connection status between the source node to be detected and the target node corresponding to the source node to be detected, and obtain a detection result.
[0037] In at least one embodiment of the present application, the monitoring host 101 controls the source node to be detected to determine at least one target node corresponding to the source node to be detected according to the detection list, and reads the content of the detection list according to the network detection request, and detects the connection status between the source node to be detected and at least one target node corresponding to the source node to be detected in an asynchronous manner to obtain a detection result. For example, the following is an example of a detection result in JSON format:
[0038] {"Name 1[\<target node 1 IP>\"],\"<network interface 1>"\:"<detection result>",
[0039] "Name 2 [\<target node 2 IP>\"], \"<network interface 1>"\: "<detection result>",
[0040] …
[0041] "Name n [\<target node n IP>\"], \"<network interface n>"\: "<detection result>",
[0042] }.
[0043] 204. Analyze the detection result and the detection list to determine that the detection result is the cause of the connection failure.
[0044] If it is detected that the source node to be detected fails to connect to at least one of the target nodes through the first network interface, and it is detected that the source node to be detected successfully connects to the target node through the second network interface, it is determined that there is a problem with the first network interface of the source node to be detected.
[0045] For example, the following is the connection status detection result of the source node and the target node to be detected:
[0046] Table 1
[0047]
[0048] Table 2
[0049]
[0050] Table 3
[0051]
[0052] Table 4
[0053]
[0054]
[0055] Table 5
[0056]
[0057] Table 6
[0058]
[0059] Note: N indicates that the connection status between the source node to be detected and the target node in the source node group to be detected is failed.
[0060] Y indicates that the connection status between the source node to be detected and the target node in the source node group to be detected is successful.
[0061] From Table 1 above, it can be seen that in Interface 1, all Compute groups failed to connect to all target nodes. From Table 2, it can be seen that in Interface 2, all Compute groups successfully connected to all target nodes. Therefore, it is determined that the source nodes to be detected in all Compute groups have problems in Interface 1.
[0062] From Table 3 above, it can be seen that in Interface1, the Compute1 group in the Compute group fails to connect to all target nodes, resulting in the target nodes of Compute1 also failing to connect to other groups. From Table 4, it can be seen that in Interface2, the Compute1 group in the Compute group successfully connects to all target nodes, thus determining that the source node to be detected in the Compute1 group in the Compute group has a problem in interface1.
[0063] It can be seen from Table 5 above that in Interface 1, the Compute group, Control group, Network group, and Storage group failed to connect to all target nodes. It can be seen from Table 6 that in Interface 2, the Compute group, Control group, Network group, and Storage group successfully connected to all target nodes. Therefore, it is determined that there are problems with the Compute group, Control group, Network group, and Storage group in Interface 1.
[0064] See also Figure 3 As shown, it is a flowchart of collecting network information of each source node 103 provided in an embodiment of the present application.
[0065] In at least one embodiment of the present application, the monitoring host 101 sends a collection instruction to each of the source nodes 103 through the Secure Shell (SSH) protocol, notifying each of the source nodes 103 to start collecting its own network information. The SSH protocol is an encrypted network transmission protocol that can provide a secure transmission environment for network services in an unsafe network. SSH establishes a secure tunnel in the network to achieve a connection between the SSH client and the server. SSH is usually used to transmit a command line interface and remotely execute commands. Through the SSH protocol, the monitoring host 101 can safely and stably send collection instructions to all source nodes 103.
[0066] 301. Collect network information according to the IP address of each source node 103 and detect whether the format of the network information is correct.
[0067] In at least one embodiment of the present application, the network information of all source nodes 103 is collected by collecting the IP address of the host 102 where each source node 103 is located. The collection of network information is achieved through the CollectVlanIPTable script. In addition to collecting and collating the network information of the source node 103, the CollectVlanIPTable script also detects the format of the collected network information and generates a JSON format file. For example, the following is the network information of the source node 103 collected in the correct format:
[0068] 127.xxx.xxx.x / xx dev<interface name> proto kernel scope link src <ip>.
[0069] Among them, 127.xxx.xxx.x / xx represents the IP address of the target node, and interface name represents the network interface.
[0070] 302. The monitoring host 101 controls each of the source nodes 103 to obtain parsed information from the network information in the correct format and convert the parsed information into a JSON format file.
[0071] In at least one embodiment of the present application, if the format of the network information is incorrect, the monitoring host 101 controls each of the source nodes 103 to determine that the network information is invalid. If the format of the network information is correct, the monitoring host 101 controls each of the source nodes 103 to obtain parsing information from the network information, the parsing information including the network interface of each of the source nodes 103 and the IP address of the target node connected to the network interface of each of the source nodes 103, and controls each of the source nodes 103 to convert the parsing information into a JSON format file.
[0072] To illustrate, the following is an example of converting parsed information into a JSON format file:
[0073] {"interface":"<interface 1> ","ip":"<172.168.64.32>"}.
[0074] 303 . Controlling each of the source nodes 103 to serialize the JSON format file into a string type file includes: the monitoring host 101 receives the string type file of each of the source nodes 103 .
[0075] 304. The monitoring host 101 merges the string type files according to the JSON format.
[0076] See also Figure 4 As shown, it is a connection status detection flow chart provided in an embodiment of the present application, which specifically includes the following:
[0077] The monitoring host 101 initiates a network detection request to the source node to be detected.
[0078] 401. Control the source node to be tested to read the content of the detection list according to the network request, perform network detection and obtain the detection result.
[0079] In this embodiment, the source node to be detected is controlled to read the content in the detection list according to the network detection request, and the connection status between the source node to be detected and at least one target node is detected in an asynchronous manner to obtain a detection result.
[0080] 402. Control the source node to be detected to store the detection result in JSON format.
[0081] The monitoring host 101 receives the JSON format returned by the source node to be detected.
[0082] See also Figure 5 As shown, it is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0083] like Figure 5 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .
[0084] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .
[0085] The communication interface 504 is used to communicate with other devices such as clients or other servers.
[0086] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned connection status detection method embodiment.
[0087] Specifically, the program 510 may include program code, and the program code includes computer web page operation instructions.
[0088] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0089] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0090] The program 510 may be specifically used to enable the processor 502 to perform certain operations in the above method embodiment.
[0091] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the application described herein, and the description of the specific language above is for the purpose of disclosing the best mode of implementation of the application.
[0092] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0093] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present application and to form different embodiments.
[0094] It should be noted that the above embodiments illustrate rather than limit the present application, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. The word "comprising" in the above embodiments does not exclude the presence of elements or steps not listed in the claims. The use of the words Compute, Control, etc. does not indicate any particular meaning. These words may be interpreted as names.< / ip>
Claims
1. A connection status detection method, applied to a monitoring host, wherein the monitoring host is connected to multiple hosts, characterized in that: Each host includes a source node, and the connection status detection method includes: The source node information of each host is collected and a detection list is generated, wherein the detection list includes: the source node of each host, multiple network interfaces of each source node and multiple target nodes, wherein each network interface corresponds to a target node, wherein the collecting of the source node information of each host and the generating of the detection list includes: collecting the IP address of the host of each source node; according to the IP address, collecting the network information of each source node, wherein the network information includes: the network interface of each source node and the IP address of the target node connected to each network interface; generating the detection list according to the network information, wherein the collecting of the network information of all source nodes according to the IP address includes: the monitoring host adopts an asynchronous method to send a collection instruction to each source node through a secure shell protocol (Secure Shell), wherein each source node is connected to each source node through CollectVlanIPTable The Shell script collects the network information and checks whether the format of the network information is correct; if the format of the network information is correct, controls each of the source nodes to obtain parsing information from the network information, wherein the parsing information includes: the network interface of each of the source nodes and the IP address of the target node connected to the network interface of each of the source nodes; controls each of the source nodes to convert the parsing information into a JSON format file, and controls each of the source nodes to serialize the JSON format file into a string type file; receives the string type file sent by each of the source nodes; merges the received string type files that meet the format requirements according to the JSON format, and generates the detection list; Selecting a source node from the source nodes as a source node to be detected; Sending a network detection request to the source node to be detected, and controlling the source node to be detected to determine a target node corresponding to the source node to be detected according to the detection list; Detecting the connection status between the source node to be detected and the target node and obtaining a detection result; The detection result sent by the source node to be detected is received, and if the detection result includes a detection result indicating a connection failure, a cause of the connection failure is determined based on the detection result and the detection list.
2. The connection status detection method according to claim 1, characterized in that: The method further comprises: According to all source nodes in the detection list, a plurality of source node groups are set; Determine a source node group to be detected from the multiple source node groups; Determine a network interface to be detected of each source node in the group of source nodes to be detected, and determine a target node connected to the network interface to be detected; Eliminate target nodes that are under maintenance or shut down from the detection list to update the detection list; The detection list is stored on the source node to be detected.
3. The connection status detection method according to claim 2, characterized in that: The storing the detection list on the source node to be detected comprises: The detection list is stored on the source node to be detected using the rsync synchronization tool.
4. The connection status detection method according to claim 2, characterized in that: The storing the detection list on the source node to be detected further comprises: The detection list is stored on the source node to be detected in an asynchronous manner.
5. The connection status detection method according to claim 1, characterized in that: The detecting the connection state between the source node to be detected and the target node and obtaining the detection result comprises: Control the source node to be detected to read the content in the detection list according to the network detection request, and detect the connection status between the source node to be detected and the target node in an asynchronous manner to obtain a detection result, wherein the source node to be detected stores the detection result in JSON format; Receive the detection result in JSON format sent by the source node to be detected.
6. The connection status detection method according to claim 1, characterized in that: The determining the reason for the connection failure based on the detection result and the detection list includes: If it is detected that the source node to be detected fails to connect to the target node through the first network interface, and it is detected that the source node to be detected successfully connects to the target node through the second network interface, it is determined that there is a problem with the first network interface of the source node to be detected.
7. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the connection status detection method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the connection status detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
System for configurable reporting of network data and related method
US20120084264A1
Information processing system
US20120215876A1
Updating local database and central database
US9043274B1
Information processing device, information processing method, and recording medium
WO2016117302A1