TWI803027B - Connecting state detection method and related equipment - Google Patents

Connecting state detection method and related equipment Download PDF

Info

Publication number
TWI803027B
TWI803027B TW110139489A TW110139489A TWI803027B TW I803027 B TWI803027 B TW I803027B TW 110139489 A TW110139489 A TW 110139489A TW 110139489 A TW110139489 A TW 110139489A TW I803027 B TWI803027 B TW I803027B
Authority
TW
Taiwan
Prior art keywords
source node
detected
detection
node
source
Prior art date
Application number
TW110139489A
Other languages
Chinese (zh)
Other versions
TW202318908A (en
Inventor
朱祐昇
解明舉
Original Assignee
新加坡商鴻運科股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新加坡商鴻運科股份有限公司 filed Critical 新加坡商鴻運科股份有限公司
Priority to TW110139489A priority Critical patent/TWI803027B/en
Publication of TW202318908A publication Critical patent/TW202318908A/en
Application granted granted Critical
Publication of TWI803027B publication Critical patent/TWI803027B/en

Links

Images

Landscapes

  • Steering Control In Accordance With Driving Conditions (AREA)
  • Telephone Function (AREA)
  • Selective Calling Equipment (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application provides a connection state detection method and related equipment. The method includes: collecting source node information and generating a detection list, which includes a source node of each host, a plurality of network interfaces and a plurality of target nodes of each source node, each of the network interfaces corresponding to one target node; selecting 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 detect a connection state between the source node and the target node, and obtaining a detection result; determining a cause of a failed connection based on the detection result and the detection list. The present application can modify the detection list automatically without human interaction, and can quickly converge the cause of the failed connection.

Description

連線狀態檢測方法及相關設備 Connection state detection method and related equipment

本申請涉及電腦技術領域、尤指一種連接狀態檢測方法及相關設備。 The present application relates to the field of computer technology, in particular to a connection state detection method and related equipment.

在管理網路集群節點時,需確保各節點間的連線狀態正常以便節點的應用服務能正常運作。當需要對節點的連線狀態進行檢測時,負責監控的主機往往需要下達大量的檢測指令至多個節點,而大量程式的加載與運行,必然導致主機的資源被大量佔用而影響主機對其它工作的正常執行。現有對於節點的連線狀態檢測,通常需要手動建立節點的檢測清單,當源節點數量繁多時,手動建立檢測清單極為費時且效率低下。進一步而言,當主機下達檢測指令後,各個節點直接獲得連接狀態,若連接狀態為連線失敗時,難以快速確定出現問題的故障節點。 When managing network cluster nodes, it is necessary to ensure that the connection status between each node is normal so that the application services of the nodes can operate normally. When it is necessary to detect the connection status of the nodes, the host responsible for monitoring often needs to issue a large number of detection instructions to multiple nodes, and the loading and running of a large number of programs will inevitably lead to a large amount of host resources being occupied and affect the host's ability to perform other tasks. Execute normally. In the existing connection state detection of nodes, it is usually necessary to manually establish a detection list of nodes. When there are a large number of source nodes, manually establishing a detection list is extremely time-consuming and inefficient. Furthermore, after the host issues a detection command, each node directly obtains the connection status. If the connection status is connection failure, it is difficult to quickly determine the faulty node with the problem.

鑒於以上內容,有必要提供一種連線狀態檢測方法及相關設備,能夠減少主機下達的檢測指令,減少主機資源的佔用,並且能夠自動化編成節點網路檢測清單並部署清單到各節點,改善節點網路清單的管理問題,根據檢測結果快速確定問題發生的原因。 In view of the above, it is necessary to provide a connection state detection method and related equipment, which can reduce the detection instructions issued by the host, reduce the occupancy of host resources, and can automatically compile a node network detection list and deploy the list to each node to improve the node network. The management problem of the road list, and the cause of the problem can be quickly determined according to the detection result.

本申請的第一方面提供一種連線狀態檢測方法,應用於監控主機,所述監控主機與多個主機連接,每個主機包括一個源節點。所述連線狀態檢測 方法包括:收集每個主機的源節點信息並生成檢測清單,所述檢測清單包括:每個主機的源節點、每個源節點的多個網路介面以及多個目標節點,其中每個網路介面對應目標節點;從所述源節點中選取源節點作為待檢測源節點;發送網路檢測請求至所述待檢測源節點,控制所述待檢測源節點根據所述檢測清單確定與所述待檢測源節點對應的目標節點;檢測所述待檢測源節點與所述目標節點之間的連線狀態並得到檢測結果;接收所述待檢測源節點發送的所述檢測結果,若所述檢測結果中包括了表示連線失敗的檢測結果,基於所述檢測結果和所述檢測清單確定所述連線失敗的原因。 The first aspect of the present application provides a connection state detection method, which is applied to a monitoring host, and the monitoring host is connected to a plurality of hosts, and each host includes a source node. The online state detection The method includes: collecting source node information of each host and generating a detection list, the detection list including: a source node of each host, multiple network interfaces of each source node, and multiple target nodes, wherein each network The interface corresponds to the target node; select the source node from the source node as the source node to be detected; send a network detection request to the source node to be detected, and control the source node to be detected to determine the source node to be detected according to the detection list Detecting the target node corresponding to the source node; 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, if the detection result includes a detection result indicating a connection failure, and the cause of the connection failure is determined based on the detection result and the detection list.

在一種可選的實施方式中,所述方法還包括:根據所述檢測清單的所有源節點,設置多個源節點群組;從所述多個源節點群組中確定待檢測源節點群組;確定所述待檢測源節點群組中的每個源節點的待檢測網路介面,確定與所述待檢測網路介面相連接的目標節點;從所述檢測清單中剔除處於維護中或者關閉中的目標節點,以對所述檢測清單進行更新;將所述檢測清單存儲在所述待檢測源節點上。 In an optional implementation manner, 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 ; Determine the network interface to be detected of each source node in the source node group to be detected, and determine the target node connected to the network interface to be detected; remove from the detection list that is under maintenance or closed to update the detection list; and store the detection list on the source node to be detected.

在一種可選的實施方式中,所述收集每個主機的源節點信息並生成檢測清單包括:收集每個所述源節點的主機的IP位址;根據所述IP位址,收集每個所述源節點的網路信息,所述網路信息包括:每個所述源節點的網路介面、與每個所述網路介面相連接的目標節點的IP位址;根據所述網路信息生成所述檢測清單。 In an optional implementation manner, the collecting the source node information of each host and generating the detection list includes: collecting the IP address of each host of the source node; The network information of the source node, the network information includes: the network interface of each of the source nodes, the IP address of the target node connected to each of the network interfaces; according to the network information Generate the checklist.

在一種可選的實施方式中,所述根據所述IP位址,收集所有源節點的網路信息包括:所述監控主機採用異步的方式,透過安全外殼協議(Secure Shell)發送採集指令至每個所述源節點,其中每個所述源節點透過CollectVlanIPTable Shell脚本收集所述網路信息,並檢查所述網路信息格式是否正確;若所述網路信息格式正確,控制每個所述源節點從所述網路信息中獲取 解析信息,所述解析信息包括:每個所述源節點的網路介面、與每個所述源節點的網路介面相連接的目標節點的IP位址;控制每個所述源節點將所述解析信息轉換為JSON格式文件,並控制每個所述源節點將所述JSON格式文件序列化為字符串類型文件;接收每個所述源節點發送的所述字符串類型文件;對接收符合格式要求的字符串類型的文件按照所述JSON格式進行合併,並生成所述檢測清單。 In an optional implementation manner, the collecting the network information of all source nodes according to the IP address includes: the monitoring host sends a collection command to each source node in an asynchronous manner through a secure shell protocol (Secure Shell) Each of the source nodes, wherein each of the source nodes collects the network information through the 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 sources The node obtains from the network information Analysis information, the analysis information includes: the network interface of each of the source nodes, the IP address of the target node connected to the network interface of each of the source nodes; The analysis information is converted into a JSON format file, and each of the source nodes is controlled to serialize the JSON format file into a string type file; receive the string type file sent by each of the source nodes; The string-type files required by the format are merged according to the JSON format, and the detection list is generated.

在一種可選的實施方式中,所述將所述檢測清單存儲在所述待檢測源節點上包括:使用rsync同步工具將所述檢測清單存儲在所述待檢測源節點上。 In an optional implementation manner, the storing the detection list on the source node to be detected includes: using rsync synchronization tool to store the detection list on the source node to be detected.

在一種可選的實施方式中,所述將所述檢測清單存儲在所述待檢測源節點上還包括:採用非同步的方式將所述檢測清單存儲在所述待檢測源節點上。 In an optional implementation manner, the storing the detection list on the source node to be detected further includes: storing the detection list on the source node to be detected in an asynchronous manner.

在一種可選的實施方式中,所述檢測所述待檢測源節點與所述目標節點之間的連線狀態並得到檢測結果包括:控制所述待檢測源節點根據所述網路檢測請求讀取所述檢測清單中的內容,並以異步的方式檢測待檢測源節點與目標節點之間的連接狀態,得到檢測結果,其中所述待檢測源節點將所述檢測結果存儲為JSON格式;接收所述待檢測源節點發送的JSON格式的檢測結果。 In an optional implementation manner, the detecting the connection state 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 Get the content in the detection list, and detect the connection state between the source node to be detected and the target node in an asynchronous manner, and obtain the detection result, wherein the source node to be detected stores the detection result as JSON format; The detection result in JSON format sent by the source node to be detected.

在一種可選的實施方式中,所述基於所述檢測結果和所述檢測清單確定所述連線失敗的原因包括:若檢測到所述待檢測源節點透過第一網路介面與所述目標節點連線失敗,及檢測到所述待檢測源節點透過第二網路介面與所述目標節點連線成功,確定所述待檢測源節點的第一網路介面存在問題。 In an optional implementation manner, the determining 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 communicates with the target through the first network interface The node connection fails, and it is detected that the source node to be detected is successfully connected to the target node through the second network interface, and it is determined that there is a problem with the first network interface of the source node to be detected.

本申請的第二方面提供一種電子設備,所述電子設備包括伺服器和記憶體,所述伺服器用於執行所述記憶體中存儲的計算機程式時實現所述的連線狀態檢測方法。 A second aspect of the present application provides an electronic device, the electronic device includes a server and a memory, and the server is configured to implement the connection state detection method when executing a computer program stored in the memory.

本申請的協力廠商面提供一種計算機可讀存儲媒體,所述計算機可讀存儲媒體上存儲有計算機程式,所述計算機程式被伺服器執行時實現所述的連線狀態檢測方法。 The third party of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a server, the connection state detection method is implemented.

本申請利用所述連線狀態檢測方法及相關設備能夠減少主機下達的檢測指令、減少主機資源的佔用、能夠自動化編成節點網路檢測清單並部署清單到各節點,改善管理節點網路清單的問題、根據檢測結果快速收斂問題發生的原因。 This application uses the connection state detection method and related equipment to reduce the detection instructions issued by the host, reduce the occupancy of host resources, automatically compile a node network detection list and deploy the list to each node, and improve the problem of managing the node network list , The cause of the rapid convergence problem based on the test results.

101:監控主機 101: Monitor host

102:主機 102: Host

103:源節點 103: source node

502:伺服器 502: server

504:通訊介面 504: communication interface

506:記憶體 506: Memory

508:通訊匯流排 508: communication bus

510:程式 510: program

201-204:步驟 201-204: Steps

301-304:步驟 301-304: Steps

401-402:步驟 401-402: Steps

圖1為本申請實施例提供的監控主機與多個主機的連接示意圖。 FIG. 1 is a schematic diagram of a connection between a monitoring host and multiple hosts provided by an embodiment of the present application.

圖2為本申請實施例提供的一種連接狀態檢測方法流程圖。 FIG. 2 is a flow chart of a method for detecting a connection state provided by an embodiment of the present application.

圖3為本申請實施例提供的收集每個所述源節點網路信息的流程圖。 Fig. 3 is a flow chart of collecting network information of each source node provided by the embodiment of the present application.

圖4為本申請實施例提供的連線狀態檢測流程圖。 FIG. 4 is a flow chart of connection state detection provided by the embodiment of the present application.

圖5為本申請實施例提供的一種電子設備的結構示意圖。 FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

為了能夠更清楚地理解本申請的上述目的、特徵和優點,下面結合附圖和具體實施例對本申請進行詳細描述。需要說明的是,此處所描述的具體實施例僅用以解釋本申請,並不用於限定本申請。 In order to more clearly understand the above objects, features and advantages of the present application, the present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.

在下面的描述中闡述了很多具體細節以便於充分理解本申請,所描述的實施例僅僅是本申請一部分實施例,而不是全部的實施例。基於本申請 中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,均屬本申請保護的範圍。 A lot of specific details are set forth in the following description to facilitate a full understanding of the application, and the described embodiments are only a part of the embodiments of the application, rather than all the embodiments. Based on this application All other embodiments obtained by persons of ordinary skill in the art without creative work, all belong to the scope of protection of the present application.

除非另有定義,本文所使用的所有的技術和科學術語與屬本申請的技術領域的技術人員通常理解的含義相同。本文中在本申請的說明書中所使用的術語只是為了描述具體的實施例的目的,不是旨在於限制本申請。 Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of the application. The terms used herein in the specification of the application are only for the purpose of describing specific embodiments, and are not intended to limit the application.

本申請提供的連線狀態檢測方法,可用於節點間的連線狀態檢測,所述方法運行於監控主機。 The connection state detection method provided in this application can be used for connection state detection between nodes, and the method runs on a monitoring host.

參見圖1所示,為本申請實施例提供的監控主機與多個主機的連接示意圖。監控主機101與多個主機102通訊連接,每個主機102包括一個源節點103。監控主機101用於控制每一個主機102,主機102為源節點103提供IP位址。在一實施例中,主機102的IP位址為源節點103的IP位址。在一實施例中,一個主機102包括一個源節點103,每一個源節點103對應一個主機102。 Referring to FIG. 1 , it is a schematic diagram of connection between a monitoring host and multiple hosts provided by the embodiment of the present application. The monitoring host 101 communicates with multiple hosts 102 , and each host 102 includes a source node 103 . 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 . In one embodiment, one host 102 includes one source node 103 , and each source node 103 corresponds to one host 102 .

參見圖2所示,為本申請實施例提供的一種連接狀態檢測方法流程圖。所述方法具體包括如下流程。 Referring to FIG. 2 , it is a flowchart of a method for detecting a connection state provided by an embodiment of the present application. The method specifically includes the following procedures.

201、監控主機101收集主機102的源節點103的信息並生成檢測清單。在本申請的至少一個實施例中,監控主機101收集每個主機102的IP位址,即每個所述源節點103的IP位址。所述每個主機102為監控主機101管理的主機。根據監控主機101收集的每個主機102的IP位址去收集每個源節點103的網路信息,生成檢測清單,所述檢測清單包括:每個主機102的源節點103、每個源節點103的多個網路介面以及多個目標節點,其中每個網路介面對應至少一個目標節點。例如,監控主機101管理的第一主機的IP位址為:127.132.128.64,監控主機101收集第一主機的IP位址,並根據第一主機的IP位址尋址,對第一主機上的源節點103的網路信息進行收集。所述網路 信息包括:每個所述源節點103的網路介面、與每個所述源節點103的網路介面相連接的目標節點的IP位址。 201. The monitoring host 101 collects information about the source node 103 of the host 102 and generates a detection list. 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 . Collect the network information of each source node 103 according to the IP address of each host 102 collected by the monitoring host 101, and generate a detection list, which includes: the source node 103 of each host 102, each source node 103 Multiple network interfaces 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 according to the IP address of the first host, the IP address of the first host is The network information of the source node 103 is collected. the network The 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 .

在本申請的又一個實施例中,根據所述檢測清單中的所有源節點103,設置多個源節點群組,每個源節點群組包括至少一個源節點103且一個源節點103只能存在於一個群組中。源節點群組代表著相同角色或功能的源節點。例如:Compute群組、Control群組、Network群組、Storage群組,每個群組又包括多個子群組,例如,Compute1群組到Compute n、Controll群組到Control n群組、Network1到Network n群組。在所有源節點群組中,用戶透過監控主機101從多個源節點群組中確定待檢測的源節點群組。 In yet 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 only one source node 103 can exist in a group. Source node groups represent source nodes of the same role or function. For example: Compute group, Control group, Network group, Storage group, each group includes multiple subgroups, for example, Compute1 group to Compute n, Controll group to Control n group, Network1 to Network n group. Among all the source node groups, the user determines the source node group to be detected from multiple source node groups through the monitoring host 101 .

在本申請的至少一個實施例中,確定所述待檢測源節點群組中的每個源節點103的待檢測網路介面包括:在本實施例中,網路介面存在於源節點103上,一個源節點103有多個網路介面,例如:Interface1、Interface2。用戶透過監控主機101確定待檢測的網路介面。 In at least one embodiment of the present application, determining the network interface to be detected of each source node 103 in the source node group to be detected includes: in this embodiment, the network interface exists on the source node 103, A source node 103 has multiple network interfaces, for example: Interface1, Interface2. The user determines the network interface to be detected through the monitoring host 101 .

在本申請的至少一個實施例中,從檢測清單中每個主機102的源節點103中選取至少一個作為待檢測源節點,例如,用戶透過監控主機101選取20個源節點103作為待檢測源節點,檢測清單中只包括所選取的20個源節點的待檢測網路介面和與待檢測網路介面相連接的目標節點。進一步可剔除檢測清單中處於關閉狀態或者維護狀態的目標節點以對檢測清單進行更新。檢測清單中被剔除的目標節點可能會在某一時候再次上線,當被剔除的目標節點重新上線時,該等目標節點可重新加入到檢測清單中。其中,可以透過選取所述待檢測源節點群組中的源節點作為所述待檢測源節點,或者根據所述源節點的IP位址選取所述待檢測源節點。 In at least one embodiment of the present application, at least one of the source nodes 103 of each host 102 in the detection list is selected as the source node to be detected, for example, the user selects 20 source nodes 103 as the source node to be detected through the monitoring host 101 , the detection list only includes the selected network interfaces of the 20 source nodes to be detected and the target nodes connected to the network interfaces to be detected. Further, target nodes in the shutdown state or maintenance state can be eliminated from the detection list to update the detection list. The eliminated target nodes in the detection list may go online again at a certain time. When the eliminated target nodes come online again, the target nodes can be added to the detection list again. Wherein, the source node to be detected can be selected as the source node to be detected by selecting the source node from the group of source nodes to be detected, or the source node to be detected can be selected according to the IP address of the source node.

202、將所述檢測清單存儲在所述待檢測源節點上。在本申請的至少一個實施例中,監控主機101採用異步的方式並透過rsync同步工具將所 述檢測清單存儲在所述待檢測源節點上。rsync同步工具能同步更新兩處計算機(例如,本申請實施例中監控主機101與主機102)的文件與目錄,並適當利用差分編碼以減少數據傳輸量。因為源節點103存在於主機102上,使用rsync同步工具可以將存在於監控主機101的所述檢測清單同步更新至主機102的待檢測源節點上。 202. Store the detection list on the source node to be detected. In at least one embodiment of the present application, the monitoring host 101 adopts an asynchronous manner and uses the rsync synchronization tool to The detection list is stored on the source node to be detected. The rsync synchronization tool can synchronously update the files and directories of two computers (for example, the monitoring host 101 and the host 102 in the embodiment of the present application), and properly use differential encoding to reduce the amount of data transmission. Because the source node 103 exists on the host 102, the detection list existing on the monitoring host 101 can be synchronously updated to the source node to be detected on the host 102 by using the rsync synchronization tool.

203、發送網路檢測指令至所述待檢測源節點,檢測所述待檢測源節點與所述待檢測源節點對應的目標節點之間的連線狀態,並得到檢測結果。在本申請的至少一個實施例中,監控主機101控制所述待檢測源節點根據所述檢測清單確定與所述待檢測源節點對應的至少一個目標節點,並根據網路檢測請求去讀取檢測清單的內容,以異步的方式檢測所述待檢測源節點與所述待檢測源節點對應的至少一個目標節點之間的連線狀態,得到檢測結果。例如,如下為JSON格式的檢測結果示例:{“名稱1[\<目標節點1 IP>\”],\“<網路介面1>”\:“<檢測結果>”,“名稱2[\<目標節點2 IP>\”],\“<網路介面1>”\:“<檢測結果>”,……“名稱n[\<目標節點n IP>\”],\“<網路介面n>”\:“<檢測結果>”,}。 203. Send a network detection instruction to the source node to be detected, detect a connection status between the source node to be detected and a target node corresponding to the source node to be detected, and obtain a detection result. 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 detected The content of the list is used to detect 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, and obtain a detection result. For example, the following is an example of detection results in JSON format: {"name 1[\<target node 1 IP>\"], \"<network interface 1>"\: "<detection result>", "name 2[\ <target node 2 IP>\"], \"<network interface 1>"\: "<detection result>", ... "name n[\<target node n IP>\"], \"<network interface n>"\:"<test_result>",}.

204、將所述檢測結果和所述檢測清單進行分析,確定所述檢測結果為連線失敗的原因。若檢測到所述待檢測源節點透過第一網路介面與至少一個所述目標節點連線失敗,及檢測到所述待檢測源節點透過第二網路介面與所述目標節點連線成功,確定所述待檢測源節點的第一網路介面存在問題。 204. Analyze the detection result and the detection list, and determine that the detection result is the cause of the connection failure. 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 is successfully connected 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.

舉例說明,如下為所述待檢測源節點和目標節點的連線狀態檢測結果: For example, the following is the detection result of the connection status of the source node and the target node to be detected:

表1

Figure 110139489-A0305-02-0010-1
Table 1
Figure 110139489-A0305-02-0010-1

Figure 110139489-A0305-02-0010-2
Figure 110139489-A0305-02-0010-2

Figure 110139489-A0305-02-0010-3
Figure 110139489-A0305-02-0010-3

Figure 110139489-A0305-02-0010-4
Figure 110139489-A0305-02-0010-4

Figure 110139489-A0305-02-0011-5
Figure 110139489-A0305-02-0011-5

Figure 110139489-A0305-02-0011-6
Figure 110139489-A0305-02-0011-6

在上述多個表中,N表示所述待檢測源節點群組中待檢測源節點與目標節點連線狀態為失敗。Y表示所述待檢測源節點群組中待檢測源節點與目標節點連線狀態為成功。 In the above tables, 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 failure. 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.

從上表1可知,在Interface1中,所有Compute群組對所有目標節點均為連線失敗,從表2可知,在Interface2中,所有Compute群組對所有目標節點均為連線成功,由此確定所有Compute群組中的待檢測源節點在Interface1中出現問題。 As can be seen from Table 1 above, in Interface1, all Compute groups failed to connect to all target nodes. From Table 2, it can be seen that in Interface2, all Compute groups connected to all target nodes successfully, thus determining All source nodes to be detected in the Compute group have problems on Interface1.

從上表3可知,在Interface1中,Compute群組中的Compute1群組對所有目標節點均為連線失敗,導致Compute1的目標節點對其他群組也為連線失敗,從表4可知,在Interface2中Compute群組中的Compute1群組對所有目標節點均為連接成功,由此確定Compute群組中的Compute1群組中 的待檢測源節點在interface1中出現問題。 It can be seen from Table 3 that in Interface1, the Compute1 group in the Compute group fails to connect to all target nodes, causing the target node of Compute1 to also fail to connect to other groups. From Table 4, it can be seen that in Interface2 The Compute1 group in the Compute group in the Compute group is successfully connected to all target nodes, so it is determined that the Compute1 group in the Compute group The source node to be detected has a problem in interface1.

從上表5中可知,在Interface1中,Compute群組、Control群組、Network群組、Storage群組對所有目標節點均為連接失敗,從表6可知,在Interface2中,Compute群組、Control群組、Network群組、Storage群組對所有目標節點均為連接成功,由此確定Compute群組、Control群組、Network群組、Storage群組在Interface1中出現問題。 As can be seen from Table 5 above, in Interface1, the Compute group, Control group, Network group, and Storage group fail to connect to all target nodes. From Table 6, it can be seen that in Interface2, the Compute group, Control group Group, Network group, and Storage group are successfully connected to all target nodes, so it is determined that the Compute group, Control group, Network group, and Storage group have problems in Interface1.

參見圖3所示,為本申請實施例提供的收集每一所述源節點103網路信息的流程圖。 Referring to FIG. 3 , it is a flow chart of collecting network information of each source node 103 provided by the embodiment of the present application.

在本申請至少一個實施例中,監控主機101透過Secure Shell(SSH)協議發送採集指令至每一所述源節點103,通知每一所述源節點103開始採集自己的網路信息,SSH協議是一種加密的網路傳輸協議,可在不安全的網路中為網路服務提供安全的傳輸環境。SSH透過在網路中建立安全隧道實現SSH客戶端與服務器之間的連接。通常利用SSH來傳輸命令行界面和遠程執行命令,透過SSH協議,監控主機101能安全穩定發送採集指令至所有源節點103。 In at least one embodiment of the present application, the monitoring host 101 sends a collection command to each of the source nodes 103 through the Secure Shell (SSH) protocol, and notifies each of the source nodes 103 to start collecting their own network information. The SSH protocol is An encrypted network transmission protocol that can provide a secure transmission environment for network services in an insecure network. SSH realizes the connection between the SSH client and the server by establishing a secure tunnel in the network. SSH is usually used to transmit the command line interface and remote execution commands. Through the SSH protocol, the monitoring host 101 can safely and stably send collection commands to all source nodes 103 .

301、根據每一所述源節點103的IP位址收集網路信息並檢測網路信息格式是否正確。在本申請的至少一個實施例中,根據收集每一所述源節點103所在的主機102的IP位址,收集所有源節點103的網路信息。透過CollectVlanIPTable脚本實現網路信息的收集。所述CollectVlanIPTable脚本除了用於收集與整理源節點103網路信息外,也會檢測所收集到的網路信息的格式並產生JSON格式文件。例如,如下為收集到正確格式的源節點103網路信息:127.xxx.xxx.x/xx dev<interface name>proto kernel scope link src<ip>。其中,127.xxx.xxx.x/xx表示為目標節點的IP位址、interface name表示為網路介面。 301. Collect network information according to the IP address of each source node 103 and check whether the format of the network information is correct. In at least one embodiment of the present application, the network information of all source nodes 103 is collected according to the IP address of the host 102 where each source node 103 is located. The collection of network information is realized through the CollectVlanIPTable script. The CollectVlanIPTable script is not only used to collect and organize the network information of the source node 103, but also detects the format of the collected network information and generates a JSON format file. For example, the source node 103 network information in the correct format is collected as follows: 127.xxx.xxx.x/xx dev<interface name>proto kernel scope link src<ip>. Among them, 127.xxx.xxx.x/xx represents the IP address of the target node, and interface name represents the network interface.

302、監控主機101控制每一所述源節點103從格式正確的網路 信息中獲取解析信息並將所述解析信息轉換成JSON格式文件。在本申請的至少一個實施例中,若所述網路信息格式不正確,監控主機101控制每一所述源節點103確定所述網路信息無效。若所述網路信息格式正確,監控主機101控制每一所述源節點103從所述網路信息中獲得解析信息,所述解析信息包括每一所述源節點103的網路介面、與每一所述源節點103的網路介面相連接的目標節點的IP位址,控制每一所述源節點103將所述解析信息轉換為JSON格式文件。舉例說明,以下為將解析信息轉換成JSON格式文件的例子:{“interface”:“<interface1>”,“ip”:”<172.168.64.32>”}。 302. The monitoring host 101 controls each of the source nodes 103 from the correct network Obtain the parsing information from the information and convert the parsing information into a JSON format file. 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 analysis information from the network information, and the analysis information includes the network interface of each source node 103, and each An IP address of a target node connected to the network interface of the source node 103 controls each source node 103 to convert the analysis information into a JSON format file. For example, the following is an example of converting the parsed information into a JSON format file: {"interface": "<interface1>", "ip": "<172.168.64.32>"}.

303、控制每一所述源節點103將所述JSON格式文件序列化為字符串類型文件包括:監控主機101接收每一所述源節點103的字符串類型文件。 303 . Controlling each source node 103 to serialize the JSON format file into a string type file includes: the monitoring host 101 receiving the string type file of each source node 103 .

304、監控主機101將字符串類型文件按照JSON格式進行合併。參見圖4所示,為本申請實施例提供的連線狀態檢測流程圖,具體包括如下:監控主機101向待檢測源節點發起網路檢測請求。 304. The monitoring host 101 merges the character string type files according to the JSON format. Referring to FIG. 4 , the flow chart of connection state detection provided by the embodiment of the present application specifically includes the following: the monitoring host 101 initiates a network detection request to the source node to be detected.

401、控制待測源節點根據所述網路請求讀取檢測清單內容進行網路檢測並得到檢測結果。在本實施例中,控制所述待檢測源節點根據所述網路檢測請求讀取所述檢測清單中的內容,並以異步的方式檢測待檢測源節點與至少一個目標節點之間的連接狀態,得到檢測結果。 401. Control the source node to be tested to read the content of the detection list according to the network request to perform network detection and obtain a detection result. 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 , get the detection result.

402、控制所述待檢測源節點將檢測結果存儲為JSON格式。其中,監控主機101接收所述待檢測源節點回傳的JSON格式。 402. Control the source node to be detected to store the detection result in JSON format. Wherein, the monitoring host 101 receives the JSON format returned by the source node to be detected.

參見圖5所示,為本申請實施例提供的一種電子設備的結構示意圖,本申請具體實施例並不對電子設備的具體實現做限定。 Referring to FIG. 5 , it is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.

如圖5所示,該電子設備可以包括:伺服器(processor)502、通訊介面(Communications Interface)504、記憶體(memory)506、以及通訊匯流排508。 其中伺服器502、通訊介面504、以及記憶體506透過通訊匯流排508完成相互間的通信。通訊介面504,用於與其它設備比如客戶端或其它服務器等的網元通信。伺服器502,用於執行程式510,具體可以執行上述連接狀態檢測方法實施例中的相關步驟。具體地,程式510可以包括程式代碼,該程式代碼包括計算機網頁操作指令。伺服器502可能是中央伺服器CPU,或者是特定集成電路ASIC(Applica tioSpecific Integrated Circuit),或者是被配置成實施本申請實施例的一個或多個集成電路。電子設備包括的一個或多個伺服器,可以是同一類型的伺服器,如一個或多個CPU;也可以是不同類型的伺服器,如一個或多個CPU以及一個或多個ASIC。記憶體506,用於存放程式510。記憶體506可能包含高速RAM記憶體,也可能還包括非易失性記憶體(non-volatile memory),例如至少一個磁盤記憶體。程式510具體可以用於使得伺服器502執行上述方法實施例中的某些操作。 As shown in FIG. 5 , the electronic device may include: a server (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 . The server 502 , the communication interface 504 , and the memory 506 communicate with each other through the communication bus 508 . The communication interface 504 is used for communicating with network elements of other devices such as clients or other servers. The server 502 is configured to execute the program 510, specifically, the relevant steps in the above embodiment of the connection state detection method may be executed. Specifically, the program 510 may include program codes, and the program codes include computer web page operation instructions. The server 502 may be a central server CPU, or an ASIC (Applicatio Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more servers included in the electronic device may be of the same type, such as one or more CPUs, or different types of servers, such as one or more CPUs and one or more ASICs. 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. The program 510 can be specifically used to make the server 502 perform certain operations in the above method embodiments.

在此提供的算法和顯示不與任何特定計算機、虛擬系統或者其它設備固有相關。各種通用系統也可以與基於在此的示教一起使用。根據上面的描述,構造這類系統所要求的結構是顯而易見的。此外,本申請也不針對任何特定編程語言。應當明白,可以利用各種編程語言實現在此描述的本申請的內容,並且上面對特定語言所做的描述是為了披露本申請的最佳實施方式。 The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that various programming languages can be used to implement the content of the application described here, and the description of specific languages above is to disclose the best implementation mode of the application.

在此處所提供的說明書中,說明了大量具體細節。然而,能夠理解,本申請的實施例可以在沒有該等具體細節的情况下實踐。在一些實例中,並未詳細示出公知的方法、結構和技術,以便不模糊對本說明書的理解。 In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

此外,本領域的技術人員能夠理解,儘管在此所述的一些實施例包括其它實施例中所包括的某些特徵而不是其它特徵,但是不同實施例的特徵的組合意味著處於本申請的範圍之內並且形成不同的實施例。 In addition, those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the present application. and form different embodiments.

應該注意的是上述實施例對本申請進行說明而不是對本申請進行限制,並且本領域技術人員在不脫離所附請求項的範圍的情况下可設計出替換實施例。上述實施例中的單詞“包含”不排除存在未列在請求項中的元件或步驟。單詞Compute、Control等的使用不表示任何特定意思。可將該等單詞解釋為名稱。 It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. The word "comprising" in the above embodiments does not exclude the existence of elements or steps not listed in the claims. The use of the words Compute, Control, etc. does not imply any particular meaning. These words may be interpreted as names.

綜上所述,本發明符合發明專利要件,爰依法提出專利申請。惟,以上所述僅為本發明之較佳實施方式,舉凡熟悉本案技藝之人士,在援依本案創作精神所作之等效修飾或變化,皆應包含於以下之申請專利範圍內。 In summary, the present invention meets the requirements of an invention patent, and a patent application is filed according to law. However, the above description is only a preferred implementation mode of the present invention. For those who are familiar with the technology of this case, the equivalent modifications or changes made in accordance with the creative spirit of this case should be included in the scope of the following patent application.

201-204:步驟 201-204: Steps

Claims (8)

一種連線狀態檢測方法,應用於監控主機,所述監控主機與多個主機連接,其中,每個主機包括一個源節點,所述連線狀態檢測方法包括:收集每個主機的源節點信息並生成檢測清單,所述檢測清單包括:每個主機的源節點、每個源節點的多個網路介面以及多個目標節點,其中每個網路介面對應目標節點;從所述源節點中選取源節點作為待檢測源節點;使用rsync同步工具對所述檢測清單進行差分編碼並減少所述檢測清單的數據傳輸量,使用所述rsync同步工具將差分編碼後的所述檢測清單同步更新至所述待檢測源節點上;發送網路檢測請求至所述待檢測源節點,控制所述待檢測源節點根據所述檢測清單確定與所述待檢測源節點對應的目標節點;檢測所述待檢測源節點與所述目標節點之間的連線狀態並得到檢測結果;接收所述待檢測源節點發送的所述檢測結果,若所述檢測結果中包括了表示連線失敗的檢測結果,基於所述檢測結果和所述檢測清單確定所述連線失敗的原因。 A connection state detection method, applied to a monitoring host, the monitoring host is connected to a plurality of hosts, wherein each host includes a source node, the connection state detection method includes: collecting source node information of each host and Generate a detection list, the detection list includes: a source node of each host, a plurality of network interfaces of each source node, and a plurality of target nodes, wherein each network interface corresponds to a target node; select from the source node The source node is used as the source node to be detected; the rsync synchronization tool is used to differentially encode the detection list and reduce the data transmission amount of the detection list, and the rsync synchronization tool is used to update the differentially encoded detection list to the on the source node to be detected; send a network detection request to the source node to be detected, control the source node to be detected to determine the target node corresponding to the source node to be detected according to the detection list; detect the source node to be detected The connection state between the source node and the target node and obtain the detection result; receive the detection result sent by the source node to be detected, if the detection result includes a detection result indicating that the connection fails, based on the detection result Determine the cause of the connection failure based on the detection result and the detection list. 如請求項1所述的連線狀態檢測方法,其中,所述方法還包括:根據所述檢測清單的所有源節點,設置多個源節點群組;從所述多個源節點群組中確定待檢測源節點群組;確定所述待檢測源節點群組中的每個源節點的待檢測網路介面,確定與所述待檢測網路介面相連接的目標節點;從所述檢測清單中剔除處於維護中或者關閉中的目標節點,以對所述檢測清單進行更新;將所述檢測清單存儲在所述待檢測源節點上。 The connection state detection method according to claim 1, wherein the method further includes: setting multiple source node groups according to all source nodes in the detection list; determining from the multiple source node groups a group of source nodes to be detected; determining a network interface to be detected of each source node in the group of source nodes to be detected, and determining a target node connected to the network interface to be detected; from the detection list Removing target nodes under maintenance or shutting down to update the detection list; storing the detection list on the source node to be detected. 如請求項1所述的連線狀態檢測方法,其中,所述收集每個主機的源節點信息並生成檢測清單包括:收集每個所述源節點的主機的IP位址;根據所述IP位址,收集每個所述源節點的網路信息,所述網路信息包括:每個所述源節點的網路介面、與每個所述網路介面相連接的目標節點的IP位址;根據所述網路信息生成所述檢測清單。 The connection state detection method according to claim 1, wherein said collecting the source node information of each host and generating the detection list includes: collecting the IP address of each host of the source node; according to the IP address Address, collecting the network information of each source node, the network information including: the network interface of each source node, the IP address of the target node connected to each network interface; The detection list is generated according to the network information. 如請求項3所述的連線狀態檢測方法,其中,所述根據所述IP位址,收集所有源節點的網路信息包括:所述監控主機採用異步的方式,透過安全外殼協議(Secure Shell)發送採集指令至每個所述源節點,其中每個所述源節點透過CollectVlanIPTable Shell脚本收集所述網路信息,並檢查所述網路信息格式是否正確;若所述網路信息格式正確,控制每個所述源節點從所述網路信息中獲取解析信息,所述解析信息包括:每個所述源節點的網路介面、與每個所述源節點的網路介面相連接的目標節點的IP位址;控制每個所述源節點將所述解析信息轉換為JSON格式文件,並控制每個所述源節點將所述JSON格式文件序列化為字符串類型文件;接收每個所述源節點發送的所述字符串類型文件;對接收符合格式要求的字符串類型的文件按照所述JSON格式進行合併,並生成所述檢測清單。 The connection state detection method as described in claim item 3, wherein said collecting network information of all source nodes according to said IP address includes: said monitoring host adopts an asynchronous manner, through a secure shell protocol (Secure Shell ) sending a collection command to each of the source nodes, wherein each of the source nodes collects the network information through the CollectVlanIPTable Shell script, and checks whether the format of the network information is correct; if the format of the network information is correct, controlling each of the source nodes to obtain analysis information from the network information, the analysis information including: the network interface of each of the source nodes, and the target connected to the network interface of each of the source nodes The IP address of the node; 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 each of the The string type file sent by the source node; the received string type file that meets the format requirements is merged according to the JSON format, and the detection list is generated. 如請求項1所述的連線狀態檢測方法,其中,所述檢測所述待檢測源節點與所述目標節點之間的連線狀態並得到檢測結果包括:控制所述待檢測源節點根據所述網路檢測請求讀取所述檢測清單中的內容,並以異步的方式檢測待檢測源節點與目標節點之間的連接狀態,得到檢測結果,其中所述待檢測源節點將所述檢測結果存儲為JSON格式; 接收所述待檢測源節點發送的JSON格式的檢測結果。 The connection state detection method according to claim 1, wherein the detecting the connection state between the source node to be detected and the target node and obtaining the detection result includes: controlling the source node to be detected according to the The network detection request reads the content in the detection list, and detects 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 uses the detection result Stored in JSON format; Receive the detection result in JSON format sent by the source node to be detected. 如請求項1所述的連線狀態檢測方法,其中,所述基於所述檢測結果和所述檢測清單確定所述連線失敗的原因包括:若檢測到所述待檢測源節點透過第一網路介面與所述目標節點連線失敗,及檢測到所述待檢測源節點透過第二網路介面與所述目標節點連線成功,確定所述待檢測源節點的第一網路介面存在問題。 The connection state detection method according to claim 1, wherein said determining 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 passes through the first network The connection between the road interface and the target node fails, and it is detected that the source node to be detected is successfully connected to the target node through the second network interface, and it is determined that there is a problem with the first network interface of the source node to be detected . 一種電子設備,其中,所述電子設備包括伺服器和記憶體,所述伺服器用於執行記憶體中存儲的計算機程式以實現如請求項1至6中任意一項所述的連線狀態檢測方法。 An electronic device, wherein the electronic device includes a server and a memory, and the server is used to execute a computer program stored in the memory to realize the connection status detection as described in any one of claims 1 to 6 method. 一種計算機可讀存儲媒體,其中,所述計算機可讀存儲媒體存儲有至少一個指令,所述至少一個指令被伺服器執行時實現如請求項1至6任意一項所述的連線狀態檢測方法。 A computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by the server, the connection state detection method as described in any one of claims 1 to 6 is implemented .
TW110139489A 2021-10-25 2021-10-25 Connecting state detection method and related equipment TWI803027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110139489A TWI803027B (en) 2021-10-25 2021-10-25 Connecting state detection method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110139489A TWI803027B (en) 2021-10-25 2021-10-25 Connecting state detection method and related equipment

Publications (2)

Publication Number Publication Date
TW202318908A TW202318908A (en) 2023-05-01
TWI803027B true TWI803027B (en) 2023-05-21

Family

ID=87378959

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110139489A TWI803027B (en) 2021-10-25 2021-10-25 Connecting state detection method and related equipment

Country Status (1)

Country Link
TW (1) TWI803027B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180367371A1 (en) * 2017-06-16 2018-12-20 Cisco Technology, Inc. Handling controller and node failure scenarios during data collection
US10338993B1 (en) * 2018-04-22 2019-07-02 Sas Institute Inc. Analysis of failures in combinatorial test suite
US20200073768A1 (en) * 2014-11-12 2020-03-05 Netapp Inc. Storage cluster failure detection

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200073768A1 (en) * 2014-11-12 2020-03-05 Netapp Inc. Storage cluster failure detection
US20180367371A1 (en) * 2017-06-16 2018-12-20 Cisco Technology, Inc. Handling controller and node failure scenarios during data collection
US10338993B1 (en) * 2018-04-22 2019-07-02 Sas Institute Inc. Analysis of failures in combinatorial test suite

Also Published As

Publication number Publication date
TW202318908A (en) 2023-05-01

Similar Documents

Publication Publication Date Title
CN112637346B (en) Proxy method, proxy device, proxy server and storage medium
CN112165532B (en) Node access method, device, equipment and computer readable storage medium
JP5872731B2 (en) Computer implemented method, non-transitory computer readable medium and computer system for communicating detection of link failure to each of a plurality of nodes of a cluster
TWI458314B (en) Server system and management method thereof for transferring remote packet to host
US20080222628A1 (en) Method and Apparatus for a Browser with Offline Web-Application Architecture
US20030051010A1 (en) Method and system for dynamic addition and removal of multiple network names on a single server
US10140121B2 (en) Sending a command with client information to allow any remote server to communicate directly with client
JP2005539298A (en) Method and system for remotely and dynamically configuring a server
JP2003046569A (en) Load test execution device and system, and method and program thereof
TWI441478B (en) Management of external hardware appliances in a distributed operating system
US6442685B1 (en) Method and system for multiple network names of a single server
JP2015197874A (en) virtual communication path construction system, virtual communication path construction method, and virtual communication path construction program
US9350629B2 (en) System and method for ensuring internet protocol (IP) address and node name consistency in a middleware machine environment
CN111338893A (en) Process log processing method and device, computer equipment and storage medium
JP2017187883A (en) Information processing device, information processing system, and configuration change verification program
CN111104336A (en) Online service interface testing method and device based on container and VNC
CN112035062B (en) Migration method of local storage of cloud computing, computer equipment and storage medium
US20210250235A1 (en) Diagram generation method and storage medium
TWI803027B (en) Connecting state detection method and related equipment
JP5609527B2 (en) Network virtualization system, node, network virtualization method, and network virtualization program
CN116032796A (en) Connection state detection method and related equipment
US6968390B1 (en) Method and system for enabling a network function in a context of one or all server names in a multiple server name environment
CN112261114A (en) Data backup system and method
CN116455869A (en) Method and system for efficiently configuring public network domain name based on Kubernetes
JP2005258632A (en) Conduction confirmation method of network storage device, and host computer