Network target range target machine concurrent starting resource downloading method, system and program

By deploying the resource synchronization module and nginx on each computing node, creating network namespaces and veth devices, the physical network congestion problem caused by concurrent startup of target drones in large-scale shooting ranges is solved, and efficient resource downloading and cluster stability are improved. .

CN118869714APending Publication Date: 2024-10-29SAINING WANGAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410801057.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

In large-scale network shooting ranges, downloading resources when target drones are started concurrently causes physical network congestion and download timeouts, affecting cluster stability.

Method used

Deploy the resource synchronization module and nginx on each computing node, create a network namespace and veth device, set up a flow table to prevent traffic from entering the physical network card, and connect haproxy and nginx through socat forwarding to enable the target machine to download directly from the local computing node resources to avoid transmission through the physical network card.

Benefits of technology

It improves the target machine download speed, reduces the load pressure on the physical network, enhances the stability and fault tolerance of the cluster, and supports large-scale concurrent startup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869714A_ABST
    Figure CN118869714A_ABST
Patent Text Reader

Abstract

The invention discloses a network target range target machine concurrent starting resource downloading method, system and program, and the method comprises the steps: deploying a resource synchronization module on all computing nodes in a network target range cluster, and enabling the resource to be downloaded by a target machine to be synchronized to each computing node local; deploying nginx at each computing node, binding unix socket for starting, and providing a resource downloading service for the target drone started by the current node; creating a target machine network, and creating a network namespace netns and a pair of veth devices at each computing node; the br-vlan on each computing node sets a flow table for respective veth equipment; the method comprises the following steps of: starting a haploxy in the netns by each computing node, monitoring veth2 connected to the netns, and binding a unix socket file and a port; soat forwarding is created on each computing node, so that two unix sockets bound with the haploxy and the nginx are communicated, and the target drone can download resources through netns; according to the method, the target drone downloads the traffic without passing through a physical network card, network traffic load pressure is not caused to the cluster, and the physical network load of the cluster is not influenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method, system and program for concurrently starting resource downloading of a target machine, and in particular to a method, system and program for concurrently starting resource downloading of a target machine in a network target range. Background Art

[0002] In a network range environment built on a cloud platform, a large number of target machines in a large-scale range generally need to download various tools or data and other resources when they are started. The current solution is to forward download requests to the control node through the metadata service of Neutron to obtain resources. When the range is large, the cluster is large, and the target machines are started quickly and concurrently, for the target machines started on each computing node, the download traffic will enter the control node card through the cluster physical switch. When the number of target machines is large and the download is started concurrently, it will cause network congestion and download timeout problems, thereby affecting the stability of the entire range cluster. Existing technical solutions such as Figure 1 shown.

[0003] br-vlan is a virtual switch (bridge) used to manage traffic forwarding between multiple virtual local area networks (VLANs). In Open vSwitch (OVS), br-vlan is a concept similar to a physical switch, used to connect different virtual ports and virtual networks to achieve communication and data transmission between virtual networks.

[0004] br-int is a virtual switch (bridge) used to handle internal communications. br-int is usually used to connect virtual machine instances (VM instances) or to communicate with OVS internal components. This virtual switch is usually used for communication and management within OpenvSwitch, and does not communicate directly with the physical network.

[0005] Veth is a virtual Ethernet device, commonly used to connect two network namespaces. Veth devices usually appear in pairs, with one port in one network namespace and the other port in another network namespace. This pair of virtual devices can be used to achieve data transmission between the two network namespaces.

[0006] Currently, the target machine downloads resources through cloud-init's 169.254.169.254. 169.254 is in the network namespace where the target machine network DHCP is located. The target machines on each computing node in the cluster will download resources through the control node.

[0007] The target network starts haproxy in the dhcp namespace of the control node to forward to the neutron metadata service. The neutron metadata service directly forwards the download request to the nova medata service through http request. The control node forwards the download resource request to the resource download service through nginx proxy_pass. The above multiple services are all on the cluster control node. When the large-scale target machines on the large-scale cluster start to download resources concurrently, the download traffic passes through the cluster physical network to the control node physical network card, causing congestion on the cluster physical network and affecting the stability of the cluster.

[0008] Due to the limitation of physical network bandwidth, when large-scale target machines in large-scale clusters start to download large resource files, there are problems such as slow download speed and timeout disconnection, which leads to errors in the target machine downloading resources and affects the target machine and scene functions. Summary of the invention

[0009] Purpose of the invention: In view of the problems existing in the above-mentioned prior art, the purpose of the present invention is to provide a method, system and program for concurrently starting resource downloads of a network target range target machine that can solve the problem of increased physical network load.

[0010] Technical solution: To achieve the above-mentioned invention object, the present invention adopts the following technical solution:

[0011] The method for concurrently starting resource downloading of a network target range target machine of the present invention comprises the following steps:

[0012] Step 1: Deploy the resource synchronization module on all computing nodes in the network target range cluster to synchronize the target machine's required downloaded resources to each computing node locally;

[0013] Step 2: Deploy nginx on each computing node, bind it to the unix socket and start it, to provide download resource services for the target machine started by the current node;

[0014] Step 3: Create a target network, and create a network namespace netns and a pair of veth devices on each computing node;

[0015] Step 4: The br-vlan on each computing node sets the flow table for its own veth device;

[0016] Step 5: Each computing node starts haproxy in netns, listens to veth connected to netns, and binds the unix socket file and port;

[0017] Step 6: Create socat forwarding on each computing node to connect the two unixsockets bound to haproxy and nginx, so that the target machine can download resources through netns.

[0018] Furthermore, at both ends of the veth device described in step 3, one end is connected to the br-vlan bridge and marked with the actual vlanid of the network where the target machine is located, and the other end is connected to netns and configured with the same network segment ip as the target machine.

[0019] Furthermore, the flow table in step 4 is used to control the flow of veth and the connection with br-int, and prohibit the flow from entering the physical network card on br-vlan.

[0020] Furthermore, the virtual network of each computing node uses the same IP.

[0021] Preferably, in step 6, the target machine downloads resources via netns, specifically, the target machine downloads resources via http: / / veth2_ip:port in netns.

[0022] Based on the same inventive concept, the present invention also provides a network range target machine concurrent startup resource download system, comprising:

[0023] The resource synchronization module is deployed on all computing nodes in the network range cluster and is used to synchronize the resources needed by the target machine to the local computing nodes.

[0024] Nginx module, deployed on each computing node, bound to the unix socket to start, used to provide download resource services for the target machine started by the current node;

[0025] Create a module to create a target network, and create a network namespace netns and a pair of veth devices on each computing node;

[0026] The setting module is used for br-vlan on each computing node to set the flow table for its own veth device;

[0027] The binding module is used for each computing node to start haproxy in netns, listen to veth connected to netns, and bind unix socket files and ports;

[0028] The download module is used to create socat forwarding on each computing node, so that the two unix sockets bound to haproxy and nginx can be connected, allowing the target machine to download resources through netns.

[0029] Furthermore, in the creation module, one end of the veth device is connected to the br-vlan bridge and marked with the actual vlanid of the network where the target machine is located, and the other end is connected to netns and configured with the same network segment ip as the target machine.

[0030] Furthermore, the flow table in the setting module is used to control the flow of veth and the connection with br-int, and prohibit the flow from entering the physical network card on br-vlan.

[0031] Based on the same inventive concept, the present invention also provides a computer system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the steps of the method for concurrently starting resource downloading of a network target range target machine according to any one of the above items are implemented.

[0032] Based on the same inventive concept, the present invention also provides a computer program product, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the steps of the method for concurrently starting resource downloading of a network target range target machine according to any of the above items are implemented.

[0033] Beneficial effects: Compared with the prior art, the target machine download resources on each computing node of a large-scale cluster of a target range of the present invention are directly downloaded from the computing node, and the download speed can reach 10 Gigabit, which improves the target machine download resource speed and supports a large number of target machines in large-scale clusters and large-scale target ranges to concurrently start downloading resources; the target machine download traffic of the present invention does not pass through the physical network card, does not cause network traffic load pressure on the cluster, and has no effect on the cluster physical network load; each computing node in the cluster of the present invention provides download services, which are synchronized and cached with the download services of the control node, and a service abnormality of a cluster node has no effect on the cluster, thereby improving the stability and fault tolerance of the cluster; all computing nodes of the present invention only need the same download IP for each virtual network, saving IP resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of a method for implementing the prior art;

[0035] Figure 2 is a flow chart of a method according to an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of an implementation method of an embodiment of the present invention;

[0037] Figure 4 Schematic diagram of a computing node according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments.

[0039] As attached Figure 2 As shown, a method for concurrently starting resource downloading of a network target range target machine disclosed in an embodiment of the present invention includes the following steps:

[0040] Step 1: Deploy the resource synchronization module on all computing nodes in the network target range cluster to synchronize the target machine's required downloaded resources to each computing node locally;

[0041] Step 2: Deploy nginx on each computing node, bind it to the unix socket and start it, to provide download resource services for the target machine started by the current node;

[0042] Step 3: Create a target network, and create a network namespace netns and a pair of veth devices on each computing node; the two ends of the veth device are connected to netns and br-vlan, and the veth on br-vlan is marked with the actual vlanid of the network where the target machine is located, and the veth in netns is configured with ip;

[0043] Step 4: The br-vlan on each computing node sets a flow table for its own veth device, prohibiting veth traffic from leaving the physical network card on the br-vlan and only connecting to the br-int;

[0044] The specific implementation method is as follows:

[0045] Transfer the traffic from br-int to br-vlan, matching the vlanid and the destination ip address, to virtual veth1

[0046] ovs-ofctl add-flow br-vlan

[0047] table=0,dl_vlan={vlan_id},nw_dst={veth2_ip}, in_port=int_br_vlan, actio ns=output:veth1

[0048] Transfer the traffic from veth1 to br-int

[0049] ovs-ofctl add-flow br-vlan

[0050] table=0,in_port=veth1,actions=output:int_br_vlan

[0051] Step 5: Each computing node starts haproxy in netns, listens to veth2 connected to netns, and binds the unix socket file / var / run / network_id.sock and port 80, so that the target machine can download resources through http: / / veth2_ip:80 in netns;

[0052] Step 6: Create socat forwarding on each computing node to connect the two unixsockets bound to haproxy and nginx, so that the target machine can download resources through netns.

[0053] This embodiment aims at the scenario where the target machine needs to download resources after startup. It does not go through the physical network, but is directly implemented through the resource download service of the node where the virtual machine is located. There is no need to worry about the increase in network load on the physical network caused by large-scale concurrent startup of target machines to download resources, and the download speed is fast and stable.

[0054] Based on the same inventive concept, this embodiment also provides a network range target machine concurrent startup resource download system, including:

[0055] The resource synchronization module is deployed on all computing nodes in the network range cluster and is used to synchronize the resources needed by the target machine to the local computing nodes.

[0056] Nginx module, deployed on each computing node, bound to the unix socket to start, used to provide download resource services for the target machine started by the current node;

[0057] Create a module to create a target network, and create a network namespace netns and a pair of veth devices on each computing node;

[0058] The setting module is used for br-vlan on each computing node to set the flow table for its own veth device;

[0059] The binding module is used for each computing node to start haproxy in netns, listen to veth connected to netns, and bind unix socket files and ports;

[0060] The download module is used to create socat forwarding on each computing node, so that the two unix sockets bound to haproxy and nginx can be connected, allowing the target machine to download resources through netns.

[0061] Based on the same inventive concept, this embodiment also provides a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the steps of the method for concurrently starting resource downloading of a network target range target machine according to any one of the above items are implemented.

[0062] Based on the same inventive concept, this embodiment also provides a computer program product, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the steps of the method for concurrently starting resource downloading of a network target range target machine according to any of the above items are implemented.

[0063] The present invention proposes to start the target machine on each computing node of the target range cluster to download resource traffic without passing through the server physical network card to enter the cluster switch, and does not cause network traffic load pressure on cluster management; the solution is designed to allow the target machine to download directly on the local server node, and the download traffic does not transmit data through the physical network card.

[0064] The present invention caches all resources that need to be downloaded on all computing nodes in the cluster, such as Figure 4 As shown, each computing node provides download services to the target machine started on this computing node. When a target machine is scheduled to a computing node, before the virtual machine operating system is started, a namespace (netns) corresponding to the network where the virtual machine is located is created on the server computing node of the target machine, and then a pair of veth devices are created, one end of which is inserted into the br-vlan bridge and marked with the tag of the target machine's corresponding network, and the other end is inserted into the namespace and configured with the same network segment IP as the target machine. Then, the haproxy service is started in the namespace to bind the 80 port of the veth IP and forward it to the unix socket listening file of the server system. The unix socket listening file is used to forward the socket service of the connection object to the nginx service of the computing node that caches the download resources to realize the virtual target machine download resources. The target machine download resource traffic is completely realized through the virtual network card, without passing through the physical network card, and does not burden the cluster physical network traffic load. The specific implementation scheme implements the method for realizing the target machine (VM) download resource download for the computing node as follows Figure 3 shown.

Claims

1. A method for concurrently starting resource downloading of a network target range target machine, characterized in that: The following steps are involved: Step 1: Deploy the resource synchronization module on all computing nodes in the network target range cluster to synchronize the target machine's required downloaded resources to each computing node locally; Step 2: Deploy nginx on each computing node, bind it to the unix socket and start it, to provide download resource services for the target machine started by the current node; Step 3: Create a target network, and create a network namespace netns and a pair of veth devices on each computing node; Step 4: The br-vlan on each computing node sets the flow table for its own veth device; Step 5: Each computing node starts haproxy in netns, listens to veth connected to netns, and binds the unixsocket file and port; Step 6: Create socat forwarding on each computing node to connect the two unix sockets bound to haproxy and nginx, so that the target machine can download resources through netns.

2. The method for concurrently starting resource downloading of a network target range target machine according to claim 1, characterized in that: At both ends of the veth device described in step 3, one end is connected to the br-vlan bridge and marked with the actual vlanid of the network where the target machine is located, and the other end is connected to netns and configured with the same network segment ip as the target machine.

3. The method for concurrently starting resource downloading of a network target range target machine according to claim 1, characterized in that: The flow table described in step 4 is used to control the flow of veth and the connection with br-int, and to prohibit the flow from entering the physical network card on br-vlan.

4. The method for concurrently starting resource downloading of a network target range target machine according to claim 1, characterized in that: The virtual network of each computing node uses the same IP.

5. The method for concurrently starting resource downloading of a network target range target machine according to claim 1, characterized in that: In step 6, the target machine downloads resources through netns, specifically, the target machine downloads resources through http: / / veth2_ip:port in netns.

6. A network range target machine concurrently starts resource downloading system, characterized in that: include: The resource synchronization module is deployed on all computing nodes in the network range cluster and is used to synchronize the resources needed by the target machine to the local computing nodes. Nginx module, deployed on each computing node, bound to the unix socket to start, used to provide download resource services for the target machine started by the current node; Create a module to create a target network, and create a network namespace netns and a pair of veth devices on each computing node; The setting module is used for br-vlan on each computing node to set the flow table for its own veth device; The binding module is used for each computing node to start haproxy in netns, listen to veth connected to netns, and bind unix socket files and ports; The download module is used to create socat forwarding on each computing node, so that the two unixsockets bound to haproxy and nginx can be connected, allowing the target machine to download resources through netns.

7. The method for concurrently starting resource downloading of a network target range target machine according to claim 6 is characterized in that: In the creation module, one end of the veth device is connected to the br-vlan bridge and marked with the actual vlanid of the network where the target machine is located, and the other end is connected to netns and configured with the same network segment ip as the target machine.

8. The method for concurrently starting resource downloading of a network target range target machine according to claim 6 is characterized in that: The flow table in the setting module is used to control the flow of veth and the connection with br-int, and prohibit the flow from entering the physical network card on br-vlan.

9. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is loaded into the processor, the steps of the method for concurrently starting resource downloading of a network target range target machine according to any one of claims 1-5 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by the processor, the steps of the method for concurrently starting resource downloading of a network target range target machine according to any one of claims 1-5 are implemented.