Cluster node network available area automatic detection method and cluster

In the Kubernetes environment, the current worker node communicates with other nodes and sets tags, the master node updates resources, automatically detects and divides network availability zones, solving the problem of low efficiency in manual division, achieving efficient and accurate network availability zone deployment, and improving application performance.

CN120378299APending Publication Date: 2025-07-25TRANSWARP TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510631565.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In Kubernetes environment, manually dividing cluster node network availability zones is inefficient and error-prone, resulting in poor performance when deploying Pod applications across network segments.

Method used

Through the current work node, the communication request operation is performed to other work nodes, the communication feedback information is obtained, the node whose communication is normal and the data packet survival period is set is the same network availability zone node, and the node label is set to create or update the network availability zone resources through the master node.

Benefits of technology

It realizes automatic, efficient and accurate detection of the cluster node network availability zone without manual participation, ensuring that Pod applications are deployed in the same network availability zone and improving performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378299A_ABST
    Figure CN120378299A_ABST
Patent Text Reader

Abstract

The invention discloses a cluster node network available area automatic detection method and a cluster. The method is applied to a cluster, and comprises the following steps: executing a communication request operation on other working nodes except a current working node in a cluster deployment scene through the current working node, and obtaining communication feedback information; through the current working node, other working nodes corresponding to communication feedback information which indicates normal communication and has a data packet life cycle as a set value are determined as target working nodes which belong to the same target network available area as the current working node; all nodes in the available area of the target network are summarized through the current working node, and a current node label is set; network available area resources corresponding to the current node label are created or updated through the main node so as to assist application deployment, and the network available area resources corresponding to the current node label comprise the name and the node list of the target network available area. According to the scheme, automatic, efficient and accurate detection of the available area of the cluster node network can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communication technologies, and in particular, to a method and a cluster for automatically detecting network availability zones of cluster nodes. Background Art

[0002] Kubernetes can be understood as a container orchestration and management platform. In a Kubernetes environment, when the cluster scale is large, the nodes in the cluster may be distributed in different networks. For example, some nodes are distributed in network segment one, and some nodes are distributed in network segment two. When the container group units (also known as Pods) in Kubernetes are deployed across network segments, network latency or bandwidth bottlenecks may occur due to cross-network communication, resulting in a decrease in the performance provided by the Pod application. Therefore, it is recommended to deploy the Pod application in the same network segment to achieve the best performance.

[0003] Generally, it is the user who manually divides the network availability zones of the nodes in the cluster, and then lets the Pod application match and deploy according to these divided network availability zones. However, the efficiency of manually dividing the network availability zones is low, and there may be cases of incorrect division. Summary of the Invention

[0004] The present invention provides a method and a cluster for automatically detecting network availability zones of cluster nodes, which can achieve automatic, efficient, and accurate detection of network availability zones of cluster nodes.

[0005] In a first aspect, an embodiment of the present invention provides a method for automatically detecting network availability zones of cluster nodes, which is applied to a cluster. The cluster includes a master node and multiple worker nodes. The method includes:

[0006] Through the current worker node, perform a communication request operation on other worker nodes except the current worker node in the cluster deployment scenario, and obtain communication feedback information;

[0007] Through the current worker node, determine the other worker nodes corresponding to the communication feedback information indicating normal communication and with a packet survival period of a set value as the target worker nodes belonging to the same target network availability zone as the current worker node;

[0008] Through the current worker node, summarize all the nodes in the target network availability zone and set the current node label;

[0009] Through the master node, create or update the network availability zone resources corresponding to the current node label to assist application deployment. The network availability zone resources corresponding to the current node label include the name of the target network availability zone and the node list.

[0010] In a second aspect, an embodiment of the present invention provides a cluster, including a master node and a plurality of worker nodes;

[0011] A current worker node is configured to perform a communication request operation on other worker nodes except the current worker node in a cluster deployment scenario and obtain communication feedback information;

[0012] The current worker node is configured to determine, as target worker nodes belonging to the same target network availability zone as the current worker node, other worker nodes corresponding to the communication feedback information indicating normal communication and having a packet survival period set to a set value;

[0013] The current worker node is configured to aggregate all nodes in the target network availability zone and set a current node label;

[0014] The master node is configured to create or update network availability zone resources corresponding to the current node label to assist in application deployment, and the network availability zone resources corresponding to the current node label include the name and node list of the target network availability zone.

[0015] The technical solution of the embodiment of the present invention performs a communication request operation on other worker nodes through the current worker node to obtain communication feedback information, determines, as target worker nodes belonging to the same target network availability zone as the current worker node, other worker nodes corresponding to the communication feedback information indicating normal communication and having a packet survival period set to a set value, and aggregates all nodes in the target network availability zone to set a current node label; creates or updates network availability zone resources corresponding to the current node label through the master node to assist in application deployment, and the network availability zone resources corresponding to the current node label include the name and node list of the target network availability zone. This solution can correctly perceive target worker nodes belonging to the same target network availability zone as the current worker node without manual participation, and through setting the current node label of the current worker node and creating or updating the network availability zone resources corresponding to the current node label, enables the application to be deployed in the target network availability zone through the network availability zone resources during application deployment, realizing automatic, efficient, and accurate detection of the network availability zone of cluster nodes.

[0016] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0018] Figure 1 is a flowchart of a method for automatically detecting available zones of a cluster node network according to Embodiment 1 of the present invention;

[0019] Figure 2 is a flowchart of a method for automatically detecting available zones of a cluster node network according to Embodiment 2 of the present invention;

[0020] Figure 3 is a schematic structural diagram of a cluster according to Embodiment 3 of the present invention. Detailed implementation manners

[0021] In order to enable those skilled in the art of the present technology to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0022] It should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0023] Embodiment 1

[0024] Figure 1 is a flowchart of a method for automatically detecting available zones of a cluster node network according to Embodiment 1 of the present invention. This embodiment is applicable to the situation of automatically detecting available zones of a cluster node network. The method is applied to a cluster, and the cluster includes a master node and multiple worker nodes.

[0025] The cluster in the embodiments of the present invention may be a container cluster. The container cluster may be a cluster deployed in a Kubernetes environment. Kubernetes, abbreviated as K8s, is an open-source container orchestration platform used for automating the deployment, scaling, and management of containerized applications. The main goal of Kubernetes is to help developers and system administrators more easily deploy applications, scale services, and manage containers across host clusters.

[0026] The container cluster may include a master node and multiple worker nodes. Among them, the master node may be the node in the container cluster responsible for managing the state and configuration of the cluster. The worker node may be the node in the container cluster responsible for running the actual instances of the application. A container group unit, i.e., a Pod, may be deployed in the worker node. A Pod may be the smallest deployable unit in Kubernetes, and a Pod may contain one or more containers.

[0027] As Figure 1 shown, the method includes:

[0028] S110. Through the current worker node, in the cluster deployment scenario, perform a communication request operation on other worker nodes except the current worker node, and obtain communication feedback information.

[0029] The current worker node may be any one of the multiple worker nodes in the cluster, and the other worker nodes may be the worker nodes in the multiple worker nodes in the cluster except the current worker node, which is not limited here.

[0030] The communication request operation may be an operation in which the current worker node requests communication with other worker nodes. For example, it may be a ping operation. The ping operation is a commonly used tool for testing network connectivity and performance. Ping is the abbreviation of Internet Packet Explorer (also known as Packet Internet Groper). The ping operation sends an ICMP echo request packet to other worker nodes based on the Internet Control Message Protocol (ICMP) and waits for the corresponding ICMP echo reply packet to be returned by other worker nodes to determine the network connectivity status. The communication feedback information may be the information returned by other worker nodes to the current worker node for the communication request operation. For example, it may be an ICMP echo reply packet.

[0031] In this step, through the current working node, in the cluster deployment scenario, based on the node communication addresses of each other working node, a communication request operation, that is, a ping operation, is performed on each other working node, an ICMP echo request data packet is sent to each other working node, and the communication feedback information of each other working node, that is, an ICMP echo reply data packet, is obtained. Among them, the node communication address can be the Internet Protocol (IP) address of the working node.

[0032] S120. Through the current working node, determine, as the target working nodes that belong to the same target network availability zone as the current working node, the other working nodes corresponding to the communication feedback information indicating normal communication and having a packet lifetime of a set value.

[0033] The ping operation is based on the ICMP protocol. The Time To Live (TTL) value of the ICMP data packet will decrease by 1 every time it passes through a router. When the TTL in the result returned by the ping operation is less than the set value, it means that the other working node and the current working node belong to different network segments. Therefore, it is possible to judge whether the other working node and the current working node are in the same network availability zone based on the TTL. There is no limit to the set value, for example, it can be 64.

[0034] In this step, through the current working node, when it is determined that the ICMP echo reply data packet in the communication feedback information returned by a certain other working node indicates normal communication and the TTL is the set value, determine that this other working node is the target working node that belongs to the same target network availability zone as the current working node. Among them, the target working node can be the working node that belongs to the same network availability zone as the current working node, and this same network availability zone is the target network availability zone.

[0035] S130. Through the current working node, aggregate all the nodes in the target network availability zone and set the current node label.

[0036] In this step, through the current working node, aggregate all the nodes in the target network availability zone, that is, aggregate the node names of the current working node and the target working nodes; determine a hash value based on these node names, and use the determined hash value as the marker value (also called mark) representing the target network availability zone; form a key-value pair with a set key (such as networkaz) and this marker value, networkaz = <mark>, the key-value pair networkaz = <mark>Set as the current node label. Among them, the current node label can be the label (also known as label) set for the current working node.

[0037] Based on the above operations, if multiple working nodes in the same network availability zone, such as the target network availability zone, have the same node name for determining the marker value, then the corresponding marker values are the same, and the set labels are all networkaz= <mark>Since the node names used by multiple worker nodes in different network availability zones to determine the tag values are different, the corresponding tag values are different, and the set labels will also be different.

[0038] S140. Through the master node, create or update the network availability zone resources corresponding to the current node label to assist in application deployment. The network availability zone resources corresponding to the current node label include the name of the target network availability zone and the node list.

[0039] In Kubernetes, network availability zone resources can be introduced through Custom Resource Definition (CRD). Network Availability Zone (naz) resources can be abbreviated as naz resources and are used to manage information related to network availability zones in the cluster.

[0040] In practical applications, a network availability zone resource can manage information about a network availability zone, including the name of the network availability zone (i.e., the name field) and the node list of worker nodes belonging to the network availability zone (i.e., the nodes field). Among them, the name of the network availability zone can be the tag value representing the network availability zone. Then, the network availability zone resources corresponding to the current node label can manage the information of the target network availability zone to which the current worker node belongs, including the name of the target network availability zone and the node list of worker nodes belonging to the target network availability zone.

[0041] In this step, through the master node, when it is detected that the current worker node has set the current node label, obtain the tag value mark representing the target network availability zone in the current node label; query whether there is a network availability zone resource with the name of this mark in the cluster; if so, update the queried network availability zone resource, that is, add the node name of the current worker node to the node list of the queried network availability zone resource; if not, create the network availability zone resource corresponding to the current node label, that is, create the network availability zone resource of the target network availability zone. The name of the created network availability zone resource is this mark, and the node list includes the node name of the current worker node and the node name of the target worker node.

[0042] It should be noted that when all worker nodes in the cluster have set the corresponding node labels, and the master node adds the node names of each worker node to the node list of the corresponding naz resource based on the node labels, the automatic detection of the network availability zones of the entire cluster ends.

[0043] When the automatic detection of network availability zones across the entire cluster is completed, all network availability zone resources of the cluster can be obtained through a query operation, and thus all network availability zones of the cluster and the nodes included in each network availability zone can be determined. When deploying subsequent Pod applications, it is possible to ensure that the Pod applications are deployed within the same network availability zone according to the specified operation. Among them, the query operation can be implemented through the kubectl get command, and the kubectl get command can be a command used to obtain information about various resources in the Kubernetes cluster. The specified operation can be achieved through nodeSelector: networkaz= <mark>Implementation, nodeSelector allows specifying one or more key-value pairs to select nodes with specific labels for scheduling Pods.

[0044] In the technical solution of the embodiment of the present invention, a communication request operation is performed by the current working node to other working nodes to obtain communication feedback information. The other working nodes corresponding to the communication feedback information indicating normal communication and the packet survival period being a set value are determined as target working nodes belonging to the same target network availability zone as the current working node, and all nodes in the target network availability zone are summarized to set the current node label; the main node creates or updates the network availability zone resources corresponding to the current node label to assist in application deployment. The network availability zone resources corresponding to the current node label include the name of the target network availability zone and the node list. This solution can correctly perceive the target working nodes belonging to the same target network availability zone as the current working node without manual participation, and through setting the current node label of the current working node and creating or updating the network availability zone resources corresponding to the current node label, when deploying an application, the application can be deployed in the target network availability zone through the network availability zone resources, realizing automatic, efficient, and accurate detection of the network availability zone of cluster nodes.

[0045] Embodiment 2

[0046] Figure 2 It is a flowchart of a method for automatically detecting the network availability zone of cluster nodes provided according to Embodiment 2 of the present invention. This embodiment is a further refinement based on the above Embodiment 1 and an explanation of the content further included in this method. As Figure 2 shown, the method includes:

[0047] S111. Through the current working node, in the cluster deployment scenario, use the daemon process component to obtain the node communication addresses of the other working nodes from the interface service component of the master node, and perform a communication request operation on the other working nodes through the node communication addresses, and obtain communication feedback information.

[0048] Among them, the daemon process component, also known as the node-agent component, can be deployed in each working node of the cluster in the form of a DaemonSet. When the cluster is expanded, new working nodes can also automatically deploy this component. DaemonSet is an application programming interface (API) object in the Kubernetes cluster to ensure that a specific Pod replica runs on the working nodes. DaemonSet is usually used for services that need to run on all nodes, such as log collection, monitoring, or network services.

[0049] After the current working node is powered on, it will first determine the scenario it is in. Specifically, the node-agent can obtain all naz resources in the cluster through the kube-apiserver. If there are no naz resources in the cluster, it is determined that the current is in the cluster deployment scenario. Optionally, this method further includes: through the current working node, when the daemon process component determines that there is no network available zone resource in the cluster from the interface service component of the master node, it is determined that the current is in the cluster deployment scenario. Among them, the interface service component of the master node, namely the kube-apiserver component, is a core component of Kubernetes. As the front-end service of the system, the kube-apiserver exposes the Kubernetes API and is the entry of the cluster. All components in the cluster can interact with the cluster through the kube-apiserver.

[0050] In this step, through the current working node, in the cluster deployment scenario, the node-agent component can obtain the node communication addresses, that is, IP addresses, of each working node in the cluster from the kube-apiserver component of the master node; the node-agent performs communication request operations, that is, ping operations, on the node IPs of each other working node, sends ICMP echo request data packets to each other working node, and obtains the communication feedback information of each other working node, that is, ICMP echo reply data packets.

[0051] S120: Through the current working node, determine the other working nodes corresponding to the communication feedback information indicating normal communication and with the packet survival period being the set value as the target working nodes that belong to the same target network available zone as the current working node.

[0052] S131: Through the current working node, use the daemon process component to add the node names of all nodes in the target network available zone to the to-be-processed list.

[0053] Through the current working node, use the node-agent component to add the node name of the current working node and the node names of the target working nodes to the to-be-processed list, so that the to-be-processed list contains the node names of all working nodes that belong to the same target network available zone.

[0054] S132: Through the current working node, use the daemon process component to sort the elements in the to-be-processed list, merge the sorted results into a string, and use the hash value of the string as the marker value of the target network available zone.

[0055] Through the current working node, use the node-agent component to sort the elements in the to-be-processed list. The sorting method is not limited, such as sorting based on the node name; merge the sorted results into a string, and obtain the hash value of this string. This hash value represents the marking value of the target network availability zone, that is, the mark value.

[0056] S133. Through the current working node, use the daemon process component to set the current node label with the key-value pair formed by the set key and the marking value.

[0057] Through the current working node, use the node-agent component to set the key-value pair networkaz = <mark>As the current node label label.

[0058] S141. Through the master node, when the node control component detects that the current working node has set the current node label, obtain the marking value of the target network availability zone in the current node label.

[0059] S142. Through the master node, use the node control component to query whether there is a network availability zone resource with the name of the marking value. If so, add the node name of the current working node to the node list of the existing network availability zone resource; if not, create a network availability zone resource with the name of the marking value, and add the node names of all nodes in the target network availability zone to the node list of the created network availability zone resource.

[0060] The following is an explanation of S141 and S142:

[0061] Among them, the node control component, also known as the node-controller component, can be deployed in the master node of the cluster in the form of a Deployment. Deployment is a high-level resource object used to manage and deploy application programs in the Kubernetes cluster.

[0062] Through the master node, when the node-controller component detects an update event of the current working node, that is, the current working node adds networkaz = <mark>In the case of the current node label label, obtain the mark value in label; query whether there is a naz resource with the name of this mark value in the cluster. If there is, directly add the node name of the current working node to the node list of the existing naz resource; if not, create a naz resource with the name of this mark value, and add the node names of all nodes in the target network availability zone to the node list of the created naz resource.

[0063] The above content is for the automatic detection of network availability zones in the cluster deployment scenario. It can also implement the automatic detection of network availability zones in the cluster expansion scenario and the cluster contraction scenario. See the following content for details.

[0064] In one embodiment, when the cluster is expanded by adding expansion nodes in the cluster expansion scenario, the method further includes:

[0065] Through the expansion node, use the daemon process component to obtain all network availability zone resources in the cluster from the interface service component of the master node, perform communication request operations on the working nodes included in all network availability zone resources in a breadth-first traversal manner, and obtain expansion communication feedback information;

[0066] Through the expansion node, use the daemon process component to determine the network availability zone resources corresponding to the expansion communication feedback information indicating normal communication and with the packet survival period being a set value as the network availability zone resources to which the expansion node belongs;

[0067] Through the expansion node, use the daemon process component to use the name of the network availability zone resources to which the expansion node belongs as the expansion mark value, and set the expansion node label with the key-value pair formed by the set key and the expansion mark value.

[0068] That is, when a new node is added to the cluster, namely the expansion node, through the expansion node, the node-agent component can be used to obtain all naz resources in the cluster from the kube-apiserver component of the master node; perform communication request operations on the working nodes included in all naz resources in a breadth-first traversal manner and obtain expansion communication feedback information. That is, first perform a ping operation on the working node node1 in naz1, and obtain the expansion communication feedback information returned by this working node, that is, the ICMP echo reply packet. If it indicates that the network is not connected or the TTL is less than the set value, then continue to ping the next naz, that is, perform a ping operation on node1 in naz2 and obtain the ICMP echo reply packet; when the expansion node can communicate with the node in a certain naz resource and the TTL is equal to the set value, it is determined that the expansion node belongs to this naz resource; use the name of this naz resource as the expansion mark value mark, and set networkaz= for the expansion node <mark>The label of the scaled-out node label.

[0069] In one embodiment, the method further includes: by scaling out a node, when it is determined that there is no available resource in the network availability zone to which the scaled-out node belongs by using a daemon process component, using the hash value of the node name of the scaled-out node as a scaling-out marker value, and setting the scaled-out node label with a key-value pair formed by a set key and the scaling-out marker value.

[0070] That is, if the scaled-out node and any node in the naz are not in the same network availability zone, and it is determined that there is no naz resource to which the scaled-out node belongs in the cluster, then perform a hash process on the node name of the scaled-out node to obtain a new hash value, use the new hash value as the scaling-out marker value of the naz resource to which the scaled-out node belongs, and set the scaled-out node label with a key-value pair formed by networkaz and the scaling-out marker value.

[0071] In one embodiment, the method further includes:

[0072] Through the master node, when it is monitored that the scaled-out node has set the scaled-out node label by using a node control component, obtain the scaling-out marker value in the scaled-out node label;

[0073] Through the master node, use the node control component to query whether there is a network availability zone resource with the name of the scaling-out marker value. If so, add the node name of the scaled-out node to the node list of the existing network availability zone resource; if not, create a network availability zone resource with the name of the scaling-out marker value, and add the node name of the scaled-out node to the node list of the created network availability zone resource.

[0074] That is, through the master node, when it is monitored that there is an update event of the scaled-out node, that is, the scaled-out node has added the scaled-out node label, by using the node-controller component, obtain the scaling-out marker value in the scaled-out node label; query whether there is a naz resource with the name of this scaling-out marker value in the cluster. If there is, directly add the node name of the scaled-out node to the node list of the existing naz resource; if not, create a naz resource with the name of this scaling-out marker value, and add the node name of the scaled-out node to the node list of the existing naz resource. Based on the above operations, the automatic detection of the network availability zone of the scaled-out node is completed, and it can be confirmed that the scaled-out node is added to the corresponding network availability zone by using the kubectl get command.

[0075] In one embodiment, when the cluster performs scaling in by deleting the scaled-in node, the method further includes:

[0076] Through the master node, when the node control component detects a deletion event of the node to be scaled down, it queries whether there is a node label for the node to be scaled down. If so, according to the scaling-down flag value in the node label for the node to be scaled down, it deletes the node name of the node to be scaled down from the node list of the network availability zone resources to which it belongs; if not, it deletes the node name that is the same as the node name of the node to be scaled down from the node lists of all network availability zone resources in the cluster.

[0077] That is, when a node (i.e., the node to be scaled down) is deleted from the cluster, through the master node, the node-controller component can detect the deletion event of the node to be scaled down; query whether there is a node label for the node to be scaled down in the cluster; if so, obtain the scaling-down flag value in the node label for the node to be scaled down, determine the naz resource corresponding to the network availability zone to which the node to be scaled down belongs according to the scaling-down flag value, and delete the node name of the node to be scaled down from the node list of this naz resource; if not (such as the node label for the node to be scaled down is accidentally deleted), directly traverse the node lists of all naz resources. If there is a node name in a certain node list that is the same as the node name of the node to be scaled down, then delete that node name. Based on the above operations, the node to be scaled down will be deleted from the naz, and it can be confirmed through the kubectl get command that the node to be scaled down does not exist in any network availability zone.

[0078] The technical solution of the embodiment of the present invention can automatically detect the network availability zone for the cluster deployment, expansion scenario, and scaling-down scenario without manual participation, and has high efficiency in detecting the network availability zone of cluster nodes.

[0079] Embodiment III

[0080] Figure 3 is a schematic structural diagram of a cluster provided according to Embodiment III of the present invention. As Figure 3 shown, the cluster includes a master node and multiple worker nodes;

[0081] The current worker node is used to perform a communication request operation on other worker nodes except the current worker node in the cluster deployment scenario and obtain communication feedback information;

[0082] The current worker node is used to determine, as the target worker nodes that belong to the same target network availability zone as the current worker node, the other worker nodes corresponding to the communication feedback information indicating normal communication and having a packet survival period of a set value;

[0083] The current worker node is used to summarize all nodes in the target network availability zone and set the current node label;

[0084] The master node is used to create or update the network availability zone resources corresponding to the current node label to assist in application deployment. The network availability zone resources corresponding to the current node label include the name of the target network availability zone and the node list.

[0085] In the cluster provided in this embodiment, the current working node performs a communication request operation on other working nodes except the current working node in the cluster deployment scenario and obtains communication feedback information; the current working node determines the other working nodes corresponding to the communication feedback information indicating normal communication and a packet survival period of a set value as the target working nodes belonging to the same target network availability zone as the current working node; the current working node aggregates all nodes in the target network availability zone and sets the current node label; the master node creates or updates the network availability zone resources corresponding to the current node label to assist in application deployment. The network availability zone resources corresponding to the current node label include the name of the target network availability zone and the node list. This solution can correctly perceive the target working nodes belonging to the same target network availability zone as the current working node without manual participation, and through setting the current node label of the current working node and creating or updating the network availability zone resources corresponding to the current node label, when deploying an application, the application can be deployed in the target network availability zone through the network availability zone resources, realizing automatic, efficient, and accurate detection of the network availability zone of cluster nodes.

[0086] Further, the current working node is specifically used for:

[0087] In the cluster deployment scenario, use the daemon process component to obtain the node communication addresses of the other working nodes from the interface service component of the master node, and perform a communication request operation on the other working nodes through the node communication addresses.

[0088] Further, the current working node is specifically used for:

[0089] Use the daemon process component to add the node names of all nodes in the target network availability zone to the list to be processed;

[0090] Use the daemon process component to sort the elements in the list to be processed, merge the sorted results into a string, and use the hash value of the string as the marker value of the target network availability zone;

[0091] Use the daemon process component to set the current node label with the key-value pair formed by the set key and the marker value.

[0092] Further, the master node is specifically used for:

[0093] When the node control component detects that the current working node has set the current node label, obtain the marking value of the target network availability zone in the current node label;

[0094] Use the node control component to query whether there is a network availability zone resource with the name of the marking value. If so, add the node name of the current working node to the node list of the existing network availability zone resource; otherwise, create a network availability zone resource with the name of the marking value, and add the node names of all nodes in the target network availability zone to the node list of the created network availability zone resource.

[0095] Furthermore, the current working node is also used for:

[0096] Use the daemon process component to determine that the current is in the cluster deployment scenario when it is determined from the interface service component of the master node that there is no network availability zone resource in the cluster.

[0097] Furthermore, when the cluster is expanded in the expansion scenario, expansion nodes are added for expansion. The expansion nodes are used for:

[0098] Use the daemon process component to obtain all network availability zone resources in the cluster from the interface service component of the master node, perform communication request operations on the working nodes included in all network availability zone resources in a breadth-first traversal manner, and obtain expansion communication feedback information;

[0099] Use the daemon process component to determine the network availability zone resource corresponding to the expansion communication feedback information indicating normal communication and with the packet survival period being the set value as the network availability zone resource to which the expansion node belongs;

[0100] Use the daemon process component to use the name of the network availability zone resource to which the expansion node belongs as the expansion marking value, and set the expansion node label with the key-value pair formed by the set key and the expansion marking value.

[0101] Furthermore, the expansion node is also used for:

[0102] Use the daemon process component to use the hash value of the node name of the expansion node as the expansion marking value and set the expansion node label with the key-value pair formed by the set key and the expansion marking value when it is determined that there is no network availability zone resource to which the expansion node belongs.

[0103] Furthermore, the master node is also used for:

[0104] When the node control component detects that the expansion node has set the expansion node label, obtain the expansion marking value in the expansion node label;

[0105] Use the node control component to query whether there is a network available zone resource with the name of the expansion marker value. If so, add the node name of the expansion node to the node list of the existing network available zone resource; if not, create a network available zone resource with the name of the expansion marker value, and add the node name of the expansion node to the node list of the created network available zone resource.

[0106] Further, when the cluster shrinks by deleting the shrink node, the master node is further configured to:

[0107] When the node control component detects the deletion event of the shrink node, query whether there is a shrink node label of the shrink node. If so, according to the shrink marker value in the shrink node label, delete the node name of the shrink node from the node list of the network available zone resource to which it belongs; if not, delete the node name that is the same as the node name of the shrink node from the node lists of all network available zone resources in the cluster.

[0108] The cluster provided by the embodiment of the present invention can execute the automatic detection method for the network available zone of the cluster nodes provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0109] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0110] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.< / mark> < / mark> < / mark> < / mark> < / mark> < / mark> < / mark>

Claims

1. An automatic detection method for available zones of a cluster node network, characterized in that, Applied to a cluster, the cluster includes a master node and multiple worker nodes, and the method includes: Through the current worker node, in the cluster deployment scenario, perform a communication request operation on other worker nodes except the current worker node, and obtain communication feedback information; Through the current worker node, determine, as target worker nodes that belong to the same target network availability zone as the current worker node, other worker nodes corresponding to communication feedback information indicating normal communication and having a packet survival period of a set value; Through the current worker node, aggregate all nodes in the target network availability zone and set the current node label; Through the master node, create or update network availability zone resources corresponding to the current node label to assist application deployment, and the network availability zone resources corresponding to the current node label include the name and node list of the target network availability zone.

2. The method according to claim 1, wherein Through the current worker node, in the cluster deployment scenario, perform a communication request operation on other worker nodes except the current worker node, including: Through the current worker node, in the cluster deployment scenario, use the daemon process component to obtain the node communication addresses of other worker nodes from the interface service component of the master node, and perform a communication request operation on other worker nodes through the node communication addresses.

3. The method according to claim 1, wherein Through the current worker node, aggregate all nodes in the target network availability zone and set the current node label, including: Through the current worker node, use the daemon process component to add the node names of all nodes in the target network availability zone to the list to be processed; Through the current worker node, use the daemon process component to sort the elements in the list to be processed, merge the sorted results into a string, and use the hash value of the string as the marker value of the target network availability zone; Through the current worker node, use the daemon process component to set the current node label with the key-value pair formed by a set key and the marker value.

4. The method according to claim 1, wherein Through the master node, create or update network availability zone resources corresponding to the current node label, including: Through the master node, use the node control component to obtain the marker value of the target network availability zone in the current node label when it is detected that the current worker node has set the current node label; Through the master node, use the node control component to query whether there is a network availability zone resource with the name of the marker value. If so, add the node name of the current worker node to the node list of the existing network availability zone resource; if not, create a network availability zone resource with the name of the marker value, and add the node names of all nodes in the target network availability zone to the node list of the created network availability zone resource.

5. The method according to claim 1, characterized in that It also includes: Through the current worker node, use the daemon process component to determine that the current is in the cluster deployment scenario when it is determined from the interface service component of the master node that there are no network availability zone resources in the cluster.

6. The method according to claim 1, wherein In the expansion scenario of the cluster, expansion nodes are added for expansion, and the method also includes: By expanding nodes, use the daemon process component to obtain all network availability zone resources in the cluster from the interface service component of the master node, perform communication request operations on the worker nodes included in all network availability zone resources in a breadth-first traversal manner, and obtain expansion communication feedback information; By expanding nodes, use the daemon process component to determine the network availability zone resources corresponding to the expansion communication feedback information indicating normal communication and with a packet survival period set to a set value as the network availability zone resources to which the expanded nodes belong; By expanding nodes, use the daemon process component to use the name of the network availability zone resources to which the expanded nodes belong as the expansion marker value, and set the expansion node label with a key-value pair formed by a set key and the expansion marker value.

7. The method according to claim 6, characterized in that, It also includes: By expanding nodes, use the daemon process component to, in the case of determining that there are no network availability zone resources to which the expanded nodes belong, use the hash value of the node name of the expanded nodes as the expansion marker value, and set the expansion node label with a key-value pair formed by a set key and the expansion marker value.

8. The method according to claim 6 or 7, characterized in that It also includes: By the master node, use the node control component to, in the case of detecting that the expansion node label is set for the expanded node, obtain the expansion marker value in the expansion node label; By the master node, use the node control component to query whether there are network availability zone resources with the name of the expansion marker value. If so, add the node name of the expanded node to the node list of the existing network availability zone resources; if not, create network availability zone resources with the name of the expansion marker value, and add the node name of the expanded node to the node list of the created network availability zone resources.

9. The method according to claim 1, characterized in that, The cluster performs scaling down by deleting the scaled-down nodes in the scaling-down scenario, and the method also includes: By the master node, use the node control component to, in the case of detecting the deletion event of the scaled-down node, query whether there is a scaled-down node label for the scaled-down node. If so, delete the node name of the scaled-down node from the node list of the network availability zone resources to which it belongs according to the scaling-down marker value in the scaled-down node label; if not, delete the node name that is the same as the node name of the scaled-down node from the node lists of all network availability zone resources in the cluster.

10. A cluster, characterized in that, It includes a master node and multiple worker nodes; The current worker node is used to perform communication request operations on other worker nodes except the current worker node in the cluster deployment scenario, and obtain communication feedback information; The current worker node is used to determine the other worker nodes corresponding to the communication feedback information indicating normal communication and with a packet survival period set to a set value as the target worker nodes belonging to the same target network availability zone as the current worker node; The current worker node is used to summarize all nodes in the target network availability zone and set the current node label; The master node is used to create or update the network availability zone resources corresponding to the current node label to assist in application deployment, and the network availability zone resources corresponding to the current node label include the name and node list of the target network availability zone.