CN118041919A - Deployment method, load balancing method, system, equipment and medium - Google Patents

Deployment method, load balancing method, system, equipment and medium Download PDF

Info

Publication number
CN118041919A
CN118041919A CN202410168388.XA CN202410168388A CN118041919A CN 118041919 A CN118041919 A CN 118041919A CN 202410168388 A CN202410168388 A CN 202410168388A CN 118041919 A CN118041919 A CN 118041919A
Authority
CN
China
Prior art keywords
node
nodes
service
control
load balancing
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202410168388.XA
Other languages
Chinese (zh)
Inventor
谢英豪
王家文
周磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Suning Electronic Information Technology Co ltd
Original Assignee
Nanjing Suning Electronic Information Technology Co ltd
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 Nanjing Suning Electronic Information Technology Co ltd filed Critical Nanjing Suning Electronic Information Technology Co ltd
Priority to CN202410168388.XA priority Critical patent/CN118041919A/en
Publication of CN118041919A publication Critical patent/CN118041919A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a deployment method, a load balancing method, a system, equipment and a medium. The deployment method comprises the following steps: at least one of a control node, an equalization node and a service node is deployed on each server of the service cluster, so that a composite load balancing system comprising a plurality of control nodes, equalization nodes and service nodes is obtained; and establishing a nano-tube relation between the control node and the balance node, so that the control node performs heartbeat maintenance with the balance node of the nano-tube according to the nano-tube relation and performs lease renewal with a main node, wherein the main node refers to the balance node serving as a flow main inlet of the virtual service. By adopting the deployment method provided by the application, the problems of high resource dependence and poor low resource scene adaptation of the load balancing system in the prior art can be solved.

Description

Deployment method, load balancing method, system, equipment and medium
Technical Field
The present application relates to the field of load balancing technologies, and in particular, to a deployment method, a load balancing method, a system, a device, and a medium.
Background
At present, the load balancing system realizes reasonable distribution of task traffic among a plurality of servers by applying a load balancing technology, so that the situation that one server is overloaded and the other servers do not fully exert processing capacity can be avoided.
From the deployment aspect, the current load balancing system generally needs to be built in an independent server, and has additional requirements on the number of devices and network configuration environment, so that the problems of much resource dependence and poor low-resource scene adaptation exist.
Disclosure of Invention
Based on the above, the application provides a deployment method, a load balancing method, a system, equipment and a medium, which can solve the problems of the prior art that the load balancing system has more resource dependence and poor low resource scene adaptation.
In a first aspect, the present application provides a deployment method of a composite load balancing system, where the deployment method includes: at least one of a control node, an equalization node and a service node is deployed on each server of the service cluster, so that a composite load balancing system comprising a plurality of control nodes, equalization nodes and service nodes is obtained; and establishing a nano-tube relation between the control node and the balance node, so that the control node performs heartbeat maintenance with the balance node of the nano-tube according to the nano-tube relation and performs lease renewal with a main node in the balance node, wherein the main node refers to the balance node serving as a flow main inlet of the virtual service.
With reference to the first aspect, in a first implementation manner of the first aspect, the step of deploying at least one of a control node, an equalization node, and a service node on each server of the service cluster to obtain a composite load balancing system including a plurality of control nodes, equalization nodes, and service nodes includes: at least one of a controller, an equalizing agent component and a back-end agent component is deployed on each server in a service cluster to obtain a plurality of control nodes, equalizing nodes and service nodes; and recording node information of the control node, the balance node and the service node in a key value database, and sequentially connecting a controller of the control node, a balance agent component of the balance node and a rear-end agent component of the service node to obtain the composite load balancing system.
In a second aspect, the present application further provides a load balancing method, where the load balancing method includes: the control node applied to the composite load balancing system is characterized in that the load balancing method comprises the following steps: after receiving the virtual service request, determining a master node from a plurality of balance nodes; setting a main node as a flow main inlet of the virtual service, so that the main node distributes service flow to each service node supporting the virtual service according to the virtual service request; and performing heartbeat maintenance with the balanced node of the nano tube according to the nano tube relation, and performing lease renewal with the main node.
With reference to the second aspect, in a first implementation manner of the second aspect, the foregoing step of determining a master node from a plurality of equalization nodes includes: judging whether all the equalizing nodes are set as traffic main inlets of other virtual services or not; if not, setting the balance node which is not set as the main flow inlet as a main node; if yes, the balancing node with the minimum load is set as the main node.
With reference to the second aspect, in a second implementation manner of the second aspect, the load balancing method further includes: updating the survival number of the control nodes in the key value database; if the survival number of the control nodes is changed, determining the down control nodes; and eliminating the down control nodes, and reallocating the nanotube relation according to the updated survival quantity.
With reference to the second aspect, in a third implementation manner of the second aspect, after performing heartbeat maintenance with an equalizing node of the nanotube according to a nanotube relationship and performing lease renewal with a master node, the load balancing method further includes: if the heartbeat signal of the balanced node is not received within the preset time length, determining that the node is not reachable; if the unreachable node is the master node, the reachable node in the balanced node is taken as the master node, the token is distributed to the reachable node, and the heartbeat signal continued by the unreachable node is not responded.
With reference to the second aspect, in a fourth implementation manner of the second aspect, after determining the master node, the load balancing method further includes: judging whether service nodes are deployed on servers where the control node and the master node are respectively located; if the service nodes are deployed, the back-end service weights of the control nodes and the master nodes are downwards regulated according to the number of the balance nodes and the number of the control nodes respectively so as to reduce the service flow born by the control nodes and the master nodes.
In a third aspect, the present application further provides a composite load balancing system, the composite load balancing system comprising a plurality of control nodes, balancing nodes and service nodes deployed in a service cluster, at least one of the control nodes, balancing nodes and service nodes being deployed on a single server in the service cluster, the controller being configured to perform a deployment method of the composite load balancing system as in the first aspect or any of the embodiments of the first aspect, or a load balancing method as in the second aspect or any of the embodiments of the second aspect.
In a fourth aspect, the present application also provides a computer device, the computer device comprising a processor and a memory, the processor and the memory being connected by a bus; a processor for executing a plurality of instructions; a memory for storing a plurality of instructions adapted to be loaded by a processor and to perform a method of deployment of a composite load balancing system as in the first aspect or any of the embodiments of the first aspect, or a method of load balancing as in the second aspect or any of the embodiments of the second aspect.
In a fifth aspect, the present application also provides a computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor and to perform a deployment method of a composite load balancing system as in the first aspect or any of the embodiments of the first aspect, or a load balancing method as in the second aspect or any of the embodiments of the second aspect.
In summary, the application provides a deployment method, a load balancing method, a system, equipment and a medium, wherein the composite load balancing system is built on a server in an existing service cluster, and is not required to be built on an independent server, and at least one of a control node, a balancing node and a service node is deployed on a single server of the service cluster, so that the server can take three roles into account at the same time, thereby being well integrated with the existing service cluster, and therefore, the problems of high resource dependence and poor low resource scene adaptation of the load balancing system in the prior art can be improved. In addition, the composite load balancing system deploys a plurality of control nodes, and utilizes the plurality of control nodes to respectively nanotube the plurality of balancing nodes, so that the control nodes can perform heartbeat maintenance with the balancing nodes of the nanotubes and perform lease renewal with a main node, therefore, the main node can be timely discovered when the main node is unavailable, and the other available balancing node is timely switched to the main node, and the composite load balancing system provided by the application has high availability.
Drawings
FIG. 1 is a schematic diagram of a node deployed on a server of a traffic cluster in one embodiment of the application;
FIG. 2 is a schematic flow chart of an deployment method in an embodiment of the application;
FIG. 3 is a schematic diagram of the relationship of nanotubes between nodes in an embodiment of the application;
FIG. 4 is a schematic flow chart of an deployment method in an embodiment of the application;
FIG. 5 is a schematic diagram of a handover master node according to an embodiment of the present application;
FIG. 6 is a schematic diagram of redefining a nanotube relationship according to an embodiment of the present application;
FIG. 7 is a block diagram of a computer device in accordance with one embodiment of the application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In the prior art, the load balancing system also has the problems of more resource dependence and poor low resource scene adaptation, and in the deployment method, the deployment equipment deploys at least one of a control node, a balancing node and a service node on each server of the existing service cluster to obtain the composite load balancing system comprising a plurality of control nodes, the balancing node and the service node, and in addition, a nanotube relation is established between the control node and the balancing node, so that the control node can perform heartbeat maintenance with the balancing node and perform lease duration with a master node in the balancing node, the control node can timely find out unreachable nodes and realize rejection and re-uploading of the nodes, and if the unreachable nodes are the master node, the master node is re-output from other reachable nodes, thereby realizing high availability of the system.
It should be noted that, the deployment device provided by the present application refers to a computer device, where the computer device may be a server or a terminal device, and the present application is not limited to this, and the server may be implemented by using an independent server or a server cluster formed by multiple servers.
It should be further noted that, the composite load balancing system deployed in the present application includes a plurality of control nodes, balancing nodes and service nodes deployed in a service cluster, where a single server in the service cluster deploys at least one of the control nodes, balancing nodes and service nodes, that is, a single server in the service cluster may take into account multiple roles at the same time, as shown in fig. 1, the server in the service cluster deploys the control nodes, balancing nodes and service nodes by installing at least one of the controller, balancing agent component and back-end agent component, the server 1 and the server 2 simultaneously have three roles, the control nodes are deployed by installing the controller, the balancing nodes are deployed by installing the balancing agent component, and the service nodes are deployed by installing the back-end agent component, so that the server 1 and the server 2 are both control nodes, balancing nodes and service nodes, the server x is both balancing nodes and service nodes, and the server N is a service node.
When receiving the virtual service request, the control node determines a master node from a plurality of balancing nodes, uses the master node as a traffic master entry of the virtual service, and then uses the service node to perform load balancing. The control node installation controller includes: 1) Starting VIP service configuration, so that a control node selects one equalizing node from a plurality of equalizing nodes as a main node according to a nano-tube relationship, and sets VIP on a network card of the main node, thereby taking the main node as a flow main inlet of virtual service; 2) Starting back-end service configuration to issue a load balancing strategy of a balancing node, such as a multi-layer hash balancing strategy for setting dynamic weights; 3) And starting the keepalive service to perform health check of the balanced node so as to realize keep-alive of the main node. The plurality of balancing nodes are located in the same Virtual Local area network (Virtual Local AreaNetwork, VLAN), and the installation of the balancing agent component at the balancing nodes comprises: 1) Loading a kernel IP virtual server (IP Virtual Server, IPVS) module; 2) Starting an iptable to support FWMARK on an incoming message, so as to avoid the problem of cyclic forwarding; 3) And starting the keepalive service to perform health check of the service nodes, so as to determine rejection and online reconnection of the service nodes. The service node installs the back-end proxy component mainly to complete Virtual network address (Virtual IP ADDRESS, VIP) setting of the lo interface in Direct Route (DR) mode, so that the service node returns data directly to the requester of the Virtual service without passing through the balancing node.
In order to better understand the deployment method of the composite load balancing system of the present application, as shown in fig. 2, an embodiment of the deployment method of the composite load balancing system is provided. Next, the present application will explain a deployment method of the composite load balancing system described in fig. 2 with deployment equipment as an execution body, specifically:
201: and deploying at least one of the control node, the balance node and the service node on each server of the service cluster to obtain the composite load balancing system comprising a plurality of control nodes, balance nodes and service nodes.
The deployment device deploys the control node, the balance node and the service node respectively by installing the controller, the balance agent component and the back-end agent component on the servers of the service cluster, and it is noted that each server of the service cluster can take multiple roles into account at the same time, so that when the node is deployed, the deployment device deploys at least one of the control node, the balance node and the service node on each server, thereby finally obtaining multiple control nodes, balance nodes and service nodes, and then connects the control node, the balance node and the service node in sequence by connecting the controller on the control node with the balance agent component of the balance node and connecting the balance agent component of the balance node with the back-end agent component of the service node. Specific: at least one of a controller, an equalizing agent component and a back-end agent component is deployed on each server in a service cluster to obtain a plurality of control nodes, equalizing nodes and service nodes; and recording node information of the control node, the balance node and the service node in a key value database (Raftkey-value DB), and sequentially connecting a controller of the control node, a balance agent component of the balance node and a rear-end agent component of the service node to obtain the composite load balancing system.
It should be noted that, in order to set the master node as a traffic master entry of the virtual service, the deployment device further allocates a VIP network segment to the control node, creates a corresponding VIP: PORT-form balanced virtual service according to the services respectively provided by the service PORTs, and records the VIP network segment and the balanced virtual service into the virtual service information table, where the service PORTs may be TCP PORTs or UDP PORTs, and different services are distinguished by different service PORTs. When the control node sets the VIP to the network card of the master node, the master node may be set as a traffic master entry of the virtual service, and after the VIP is set to the master node, the binding relationship between the VIP and the balancing node may also be recorded in the key value database. In addition, the deployment device may further group services operated by the service nodes, where the services on one service node are identified by RIP: PORTs, so that each group includes a set of RIP: PORTs that are the same as each other, and record service group information into a back-end group information table, so that the balancing node distributes traffic to the service nodes supporting the corresponding service after being set as a traffic primary entry of the virtual service. In addition, the key value database can record survival information of each node, and the survival information is updated once in real time at intervals to determine whether the node is online or not, so as to determine whether the node is available or not.
202: And establishing a nano-tube relation between the control node and the balance node, so that the control node performs heartbeat maintenance with the balance node of the nano-tube according to the nano-tube relation, and performs lease renewal with a master node in the balance node.
Wherein the master node refers to an equalizing node which is a traffic master portal of the virtual service. The deployment equipment establishes a nanotube relation between the control node and the equalization node, so that the control node performs heartbeat maintenance according to the nanotube relation and the equalization node, and performs lease renewal with the main node. In order to establish a nanotube relation between the control node and the equalization node, the control node may set a serial number LBID for the equalization node after the equalization node is online, start numbering for the equalization node from 1, each master control establishes a keep-alive channel with all equalization nodes, when establishing the nanotube relation, firstly, according to the number onlineNum (at least 1) of the control nodes which survive currently, then, the surviving master control starts numbering from 0 according to the sorting of addresses of internet interconnection protocols (InternetProtocol, IP), and then, calculates LBID% onLineNum to obtain the serial numbers of the control nodes of the home nanotubes of each equalization node, that is, the serial numbers of the master control nodes of each equalization node. For example, as shown in fig. 3, the serial numbers onLineNum of the three control nodes are 0, 1 and 2, the serial numbers LBID of the five equalization nodes are 1, 2, 3,4 and 5, the master control nodes of the equalization nodes are obtained by calculation according to the remainder formula LBID% onLineNum, the master control nodes of the equalization node 1 and the equalization node 4 are the control node 0, the master control nodes of the equalization node 2 and the equalization node 5 are the control node 1, the master control node of the equalization node 3 is the control node 2, the heartbeat maintenance is performed between each equalization node and the corresponding master control node, and the lease renewal is performed between the master node serving as the traffic master portal of the virtual service (i.e., the equalization node 1) and the corresponding master control node.
In general, the compound balanced load system obtained by implementing the deployment method provided by the embodiment does not need to be built on an independent server, reduces resource dependence, supports the on-site expansion balanced service capability of a service cluster, does not need to perform active-standby switching by means of a virtual routing redundancy protocol (Virtual Router Redundancy Protocol, VRRP) protocol, and solves the problems of high resource dependence and poor low resource scene adaptation of the load balancing system in the prior art. In addition, the application adopts a distributed setting method, and reforms the service clusters into the clustered distributed balancing idea on site, thereby bringing the following advantages: compared with the network equivalent path cluster scheme, the method requires the service clusters to be in the same two layers relative to the limitation of physical network configuration, network element hardware conditions and the like, and the requirement is easier to meet in a small-medium-scale data center or a simplified rack scene; aiming at a scene of unification of equalization and service nodes, the method does not occupy independent server resources, is suitable for fusing the scene, adapts to a main stream unitization model, is based on a kernel IPVS iptables, and has no other additional software maintenance and system setting and is convenient and simple to use; from the aspects of deployment and control modes, the deployment of the main control mode and the proxy mode in the deployment model is flexible, and balanced service setting can be carried out through a service application programming interface (Application Programming Interface, API), so that the deployment is simple, convenient and flexible.
As shown in fig. 4, the present application further proposes an embodiment of a load balancing method, where the load balancing method is applied to the above-deployed composite load balancing system. Next, the load balancing method provided by the embodiment of the present application will be described in detail with reference to fig. 4, specifically:
401: after receiving the virtual service request, a master node is determined among the plurality of balancing nodes.
After receiving the virtual service request, the control node selects a virtual service VIP: PORT to be started, the controller designates a flow main inlet for the virtual service, determines a main node from a plurality of balance nodes, for example, any balance node of the plurality of balance nodes can be used as the main node, or balance node with larger weight can be used as the main node, and the weight of the balance node can be determined according to the load size.
It should be noted that, the control node may also poll the current connection of all the equalization nodes, the data Packet Per Second (PPS) and the bandwidth throughput data to configure the weights of the equalization nodes, in addition, the control node may also initiate a multi-layer HASH equalization policy of the state weights to the equalization nodes, so as to determine the weights of the equalization nodes, and the multi-layer HASH HEADER may avoid the traffic from concentrating on a few servers, so that the stability and continuity of the traffic distribution are higher, implement the distribution according to the leader weight, support a richer load balancing scenario, and combine the dynamic weight method and the traffic distribution when guiding the composite deployment, so as to promote the utilization rate of the overall composite good deployment. Specifically, the control node creates a virtual service VIP: PORT, all the equalization nodes are added to be back-end services, default weights are set to be 255, then source IP, source PORT, destination IP and destination PORT are taken as HASH HEADER, repetition factors of 4, 8, 1 and 1 are respectively set, the HASH repetition factors can realize weight configuration based on the HEADER, and the larger the repetition factor is, the larger the weight occupied by the HEADER in final HASH result calculation is, the more tends to distribute traffic to a server corresponding to the HEADER. In addition, in order to support VIP setting on the multi-equalizer instance and avoid that the balanced distribution traffic is not forwarded again in a loop, the balanced node marks fwmark the ingress traffic of different virtual services through the iptable, and fwmark may be calculated and allocated by the control node according to the topology.
In another embodiment, in order to improve the real-time performance, the control node may further determine the master node quickly based on the current VIP distribution situation of the system and the health status of the equalization nodes, and specifically, the step of determining the master node in the plurality of equalization nodes includes: judging whether all the equalizing nodes are set as traffic main inlets of other virtual services or not; if not, setting the balance node which is not set as the main flow inlet as a main node; if yes, the balancing node with the minimum load is set as the main node. For example, the balancing nodes are ordered according to the IP addresses, and it is determined whether all the balancing nodes are set as traffic main entries of other virtual services, that is, it is determined whether the number of allocated VIPs is less than the number of balancing nodes, if yes, an balancing node not allocated VIP is allocated according to the above ordering as a main node of the currently received virtual service, if no, the VIP traffic of each balancing node is counted, or the balancing node with the lowest traffic or the smallest CPU load is selected according to the CPU load condition, and the VIP of the virtual service is set on the main node.
402: The master node is set as a traffic master entry of the virtual service, so that the master node distributes the traffic to each service node supporting the virtual service according to the virtual service request.
The control node can set VIP of the virtual service on the main node, set the main node as a flow main inlet of the virtual service to finish the issuing of the virtual service, then the balance node sends a free ARP to announce online to the outside, the virtual balance service is visible outside, and then the balance node distributes the service flow to each service node supporting the virtual service according to the virtual service request. In addition, the control node can also initiate the evaluation of the weight of the service node in real time, so that the control node can perform down-regulation on the rear-end service weight of the service node with the highest occupancy rate of the central processing unit (Central Processing Unit, CPU) according to a preset proportion (for example, 1/16), and then enter the next observation period to realize better load balancing. It should be noted that, when the primary node is down, the control node may determine a new primary node from the candidate nodes. If the balancing node and the service node are deployed on the server at the same time, before the balancing node is selected as the main node, the server is mainly used as the service node to bear the service flow distributed by the main node.
403: And performing heartbeat maintenance with the balanced node of the nano tube according to the nano tube relation, and performing lease renewal with the main node.
The balancing node sends heartbeat signals to a main control node of the balancing node at intervals, the main control node indicates that the balancing node is normal and in a usable state if the heartbeat signals are received within a set time, but indicates that the balancing node is abnormal and in an unusable state if the heartbeat signals are not received within the set time, and at the moment, the balancing node can be removed from the alternative nodes. In addition, if the main control node of the main node receives the heartbeat signal within the set time, the main control node indicates that the main control node is successful in continuation, and if the main control node of the main node does not receive the heartbeat signal within the set time, the main control node indicates that the main control node is failed in continuation, and at the moment, a new main node is determined from the alternative nodes. It should be noted that, compared with a general equalizing node which is not a main node, because the main node is used as a traffic main inlet, the main node has higher requirement on real-time performance, based on this, the heartbeat period between the main node and the main control node can be set to be shorter, which is helpful for timely finding out the main node which is down, for example, the heartbeat period between the main node and the main control node can be set to be 2 seconds, and the heartbeat period of the general equalizing node can be set to be 10 seconds.
It should be noted that, in order to improve the high availability of the composite equalization system, when the lease duration between the control node and the master node fails, the control node may set other equalization nodes as the master node, and specifically, after performing heartbeat maintenance with the equalization node of the nanotube according to the nanotube relationship and performing lease duration with the master node, the load balancing method further includes: if the heartbeat signal of the balanced node is not received within the preset time length, determining that the node is not reachable; if the unreachable node is the master node, the reachable node in the balanced node is taken as the master node, the token is distributed to the reachable node, and the heartbeat signal continued by the unreachable node is not responded. For example, as shown in fig. 5, if the control node 0 detects that the master node (i.e. the balancing node 1) is not reachable through heartbeat maintenance, the standby machine selects, if the balancing node 2 is selected as a new master node, the control node 1 sends a VIP lease token to the balancing node 2, as shown in fig. 5, after the balancing node 2 confirms that the token is received, the control node is formally switched to the master node, the balancing node 2 performs lease renewal with the control node 1 through heartbeat maintenance, when the balancing node 1 recovers, a heartbeat signal of a contract continues to be sent to the control node 0, but since the token is already occupied by the balancing node 2, no response of the control node 0 is obtained, resulting in a final original lease timeout, the balancing node agent can cancel the VIP and avoid collision with the new master node, i.e. if the heartbeat signal of the balancing node 1 does not get the response of the control node 0, the lease renewal fails, and thus the virtual service can be actively cancelled and accurately configured on the balancing node 2 and avoid collision with the node 2.
It should be noted that, each control node may update its own survival condition to the global table (for example, the survival information of the key value database) at intervals, so that any master node may learn the number of the currently surviving control nodes through the global table, and determine the down control node. For example, as shown in fig. 6, the master control programs on 3 master control nodes run simultaneously with 3 copies, and update their own online status to the global table every 2s, so that the running copy of any master control node can know the current online master control number. It can thus be seen that when any control node fails, the number onlineNum of surviving control nodes found after the next round of heartbeats changes by other control nodes. Based on this, in order to further improve the availability of the system, the present application further provides an implementation manner, in this implementation manner, the control node may further determine whether there is a downtime of the control node according to whether the inventory number of the control node changes, if so, the nanotube relationship with the equalization node is redetermined according to the remaining surviving control nodes, so as to redistribute the keep-alive relationship, and specifically, the control node updates the surviving number of the control node in the key value database; if the survival number of the control nodes is changed, determining the down control nodes; and eliminating the down control nodes, and reallocating the nanotube relation according to the updated survival quantity. For example, after the control node 0 is down, the control nodes 1 and 2 find that the survival number changes after the next round of heartbeat, the number onlineNum of the control nodes becomes 2, so the nanotube relationship is redetermined, the control nodes 1 and 2 perform the nanotube on the equalization nodes, that is, calculate the master control node of each equalization node according to LBID% onLineNum, the master control nodes of the equalization nodes 1, 3 and 5 are the control nodes 1, and the master control nodes of the equalization nodes 2 and 4 are the control nodes 2.
It should be noted that if the control node and the master node of the control node nanotube are abnormal together, and if the control node 0 is down and the equalization node 1 (master node) of the control node 0 nanotube is not reachable, then after the next round of heartbeat, it is found that the control node 0 is down, so that the nanotube relationship is redetermined, and the control node 1 is used for receiving the equalization node 1, but since the equalization node 1 is not reachable, the control node 1 cannot receive the heartbeat signal sent by the equalization node 1, so that the heartbeat maintenance fails, and at this time, the control node will reassign a new master node to the VIP, and the reachable equalization node 3 is used as the master node.
Further, in order to avoid network bottlenecks caused by flow superposition, after determining the control node and the balancing node, the control node downregulates the weight of the control node for bearing the service flow so as to bear less service flow. Specifically, after determining the master node, the control node judges whether service nodes are deployed on servers where the control node and the master node are respectively located; if the service nodes are deployed, the back-end service weights of the control nodes and the master nodes are downwards regulated according to the number of the balance nodes and the number of the control nodes respectively so as to reduce the service flow born by the control nodes and the master nodes. If the service nodes are deployed on the server where the control node and the master node are located, the server is indicated to also serve as the service node to bear the service flow, so that in order to reduce the load superposed on the server, the back-end service weights of the control node and the master node are adjusted to be min {1, 255/N }, wherein N is the number of balanced nodes or the number of the control nodes, the bearing amount of the service flow is reduced by reducing the back-end service weights, and the network bottleneck problem caused by flow superposition is improved.
In general, the load balancing method provided by the embodiment is applied to the deployed composite load balancing system, so that load balancing can be better realized, and high availability is realized.
The application also provides a compound load balancing system, which comprises a plurality of control nodes, balancing nodes and service nodes deployed in the service cluster, wherein at least one of the control nodes, the balancing nodes and the service nodes is deployed on a single server in the service cluster, and the controller is used for executing the load balancing method described in the previous embodiment.
The application also provides a computer device, see fig. 7. The identification generating device in the present embodiment as shown in fig. 7 may include: a processor 710 and a memory 720. The processor 710 and the memory 720 are connected by a bus 730. A processor 710 for executing a plurality of instructions; a memory 720 for storing a plurality of instructions adapted to be loaded by the processor 710 and to perform the deployment method or load balancing method of the composite load balancing system as in the above embodiments.
The processor 710 may be an electronic tuning unit (Electronic Control Unit, ECU), a central processing unit (central processing unit, CPU), a general purpose processor, a co-processor, a digital signal processor (digital signalprocessor, DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (fieldprogrammable GATE ARRAY, FPGA) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. The processor 710 may also be a combination that implements computing functionality, such as a combination comprising one or more microprocessors, a combination of 5SP and microprocessors, and the like. In this embodiment, the processor 710 may employ a single-chip microcomputer, and various control functions may be implemented by programming the single-chip microcomputer, so that the processor has the advantages of strong computing power and fast processing.
In one embodiment, the present application also provides a computer-readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method of any of the preceding embodiments. A processor for executing a plurality of instructions; and a memory for storing a plurality of instructions that are loaded by the processor and that perform the deployment method as in the above embodiments.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A method for deploying a composite load balancing system, comprising:
At least one of a control node, an equalization node and a service node is deployed on each server of the service cluster, so that a composite load balancing system comprising a plurality of control nodes, equalization nodes and service nodes is obtained;
and establishing a nano-tube relation between the control node and the balance node, so that the control node performs heartbeat maintenance with the balance node of the nano-tube according to the nano-tube relation and performs lease renewal with a main node in the balance node, wherein the main node refers to the balance node serving as a flow main inlet of virtual service.
2. The deployment method of claim 1, wherein the step of deploying at least one of the control node, the balancing node, and the service node on each server of the service cluster to obtain the composite load balancing system including the plurality of control nodes, the balancing node, and the service node comprises:
At least one of a controller, an equalizing agent component and a back-end agent component is deployed on each server in a service cluster to obtain a plurality of control nodes, equalizing nodes and service nodes;
And recording the node information of the control node, the balance node and the service node in a key value database, and sequentially connecting a controller of the control node, a balance agent component of the balance node and a rear-end agent component of the service node to obtain the composite load balancing system.
3. The load balancing method is applied to a control node in a composite load balancing system, and is characterized by comprising the following steps of:
after receiving the virtual service request, determining a master node from a plurality of balance nodes;
Setting the master node as a flow master entry of a virtual service, so that the master node distributes service flow to each service node supporting the virtual service according to the virtual service request;
And performing heartbeat maintenance with the balanced node of the nano tube according to the nano tube relation, and performing lease renewal with the main node.
4. The method of claim 3, wherein the step of determining a master node among a plurality of equalization nodes comprises:
Judging whether all the equalizing nodes are set as traffic main inlets of other virtual services or not;
If not, setting the balance node which is not set as the main flow inlet as a main node;
if yes, the balancing node with the minimum load is set as the main node.
5. A method according to claim 3, characterized in that the method further comprises:
Updating the survival number of the control nodes in the key value database;
If the survival number of the control nodes is changed, determining the control nodes which are down;
And eliminating the down control node, and reallocating the nanotube relation according to the updated survival quantity.
6. The method of claim 3, wherein after performing heartbeat maintenance with the equalization node of the nanotube and lease renewal with the master node in accordance with the nanotube relationship, the method further comprises:
if the heartbeat signal of the balanced node is not received within the preset time length, determining that the node is not reachable;
If the unreachable node is the master node, the reachable node in the balance node is used as the master node, the token is distributed to the reachable node, and the heartbeat signal continued by the unreachable node is not responded.
7. A method according to claim 3, further comprising, after determining the master node:
judging whether service nodes are deployed on servers where the control node and the master node are respectively located;
If the service nodes are deployed, the back-end service weights of the control nodes and the master nodes are downwards regulated according to the number of the balance nodes and the number of the control nodes respectively so as to reduce the service flow born by the control nodes and the master nodes.
8. A composite load balancing system comprising a plurality of control nodes, balancing nodes and service nodes deployed in a service cluster, at least one of the control nodes, balancing nodes and service nodes being deployed on a single server in the service cluster, the controller being configured to perform the load balancing method as described in any one of claims 3 to 7.
9. A computer device, comprising a processor and a memory, the processor and the memory being connected by a bus; the processor is used for executing a plurality of instructions; the memory for storing the plurality of instructions adapted to be loaded and executed by the processor for the deployment method of the hybrid load balancing system of claims 1 to 2 or the load balancing method of claims 3 to 7.
10. A computer readable storage medium, characterized in that it has stored therein a plurality of instructions adapted to be loaded by a processor and to perform the deployment method of a composite load balancing system according to claims 1 to 2 or the load balancing method according to claims 3 to 7.
CN202410168388.XA 2024-02-06 2024-02-06 Deployment method, load balancing method, system, equipment and medium Pending CN118041919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410168388.XA CN118041919A (en) 2024-02-06 2024-02-06 Deployment method, load balancing method, system, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410168388.XA CN118041919A (en) 2024-02-06 2024-02-06 Deployment method, load balancing method, system, equipment and medium

Publications (1)

Publication Number Publication Date
CN118041919A true CN118041919A (en) 2024-05-14

Family

ID=91000149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410168388.XA Pending CN118041919A (en) 2024-02-06 2024-02-06 Deployment method, load balancing method, system, equipment and medium

Country Status (1)

Country Link
CN (1) CN118041919A (en)

Similar Documents

Publication Publication Date Title
US10917351B2 (en) Reliable load-balancer using segment routing and real-time application monitoring
EP3854038B1 (en) Segment routing with fast reroute for container networking
US6397260B1 (en) Automatic load sharing for network routers
US8565070B2 (en) System and method for active geographic redundancy
US6496510B1 (en) Scalable cluster-type router device and configuring method thereof
WO2018077238A1 (en) Switch-based load balancing system and method
US8755382B2 (en) Intelligent adjunct network device
US20120069730A1 (en) System and method for supporting management network interface card port failover in a middleware machine environment
JP2002533998A (en) Internet Protocol Handler for Telecommunications Platform with Processor Cluster
JP2016515790A (en) Open connection with distributed load balancer
JP6364106B2 (en) Method, system and computer-readable medium for routing Diameter messages in a Diameter signaling router
JP5107339B2 (en) System and method for active geographic redundancy
JP2000307657A (en) Router monitor system for data transmission system using network dispatcher for host cluster
CN111083061A (en) Method, equipment and system for determining DF (distribution function) of multicast flow
US6631421B1 (en) Recursive partitioning of networks
EP1712067B1 (en) A method, apparatus and system of organizing servers
US20080144634A1 (en) Selective passive address resolution learning
CN118041919A (en) Deployment method, load balancing method, system, equipment and medium
JP2003234752A (en) Load distribution method using tag conversion, tag converter and load distribution controller
Cisco Designing APPN Internetworks
Cisco Designing APPN Internetworks
Cisco Designing APPN Internetworks
Cisco Designing APPN Internetworks
CN116192855A (en) Load balancing method, load balancing device, electronic equipment and computer readable storage medium
Cisco Designing APPN Internetworks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination