CN115604272A - Load balancing method, device, system creating method, device and medium - Google Patents

Load balancing method, device, system creating method, device and medium Download PDF

Info

Publication number
CN115604272A
CN115604272A CN202211518396.XA CN202211518396A CN115604272A CN 115604272 A CN115604272 A CN 115604272A CN 202211518396 A CN202211518396 A CN 202211518396A CN 115604272 A CN115604272 A CN 115604272A
Authority
CN
China
Prior art keywords
virtual
subnet
load balancer
layer load
target
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.)
Granted
Application number
CN202211518396.XA
Other languages
Chinese (zh)
Other versions
CN115604272B (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211518396.XA priority Critical patent/CN115604272B/en
Publication of CN115604272A publication Critical patent/CN115604272A/en
Application granted granted Critical
Publication of CN115604272B publication Critical patent/CN115604272B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches

Abstract

The application discloses a load balancing method, a device, a system establishing method, equipment and a medium, which relate to the technical field of computers, and the load balancing method comprises the following steps: receiving a request of a client, and determining a target virtual server in a service pool according to the request; judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer; if not, the request is sent to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and the response of the target virtual server to the request is received sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer; the response is returned to the client. The method and the device realize seven-layer load balancing of a plurality of virtualization servers across multiple subnets.

Description

Load balancing method, device, system and system establishing method, device and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a load balancing method, apparatus, and system, a method and apparatus for creating a load balancing system, an electronic device, and a computer-readable storage medium.
Background
With the continuous development of cloud computing, a virtualized server cluster is more and more huge, and a corresponding virtualized network is more and more complex. The load balancing scheme in the existing virtualization environment basically aims at seven-layer load balancing of virtual servers in a single subnet or four-layer load balancing of virtual servers across multiple subnets.
Therefore, how to implement seven-layer load balancing for multiple virtualization servers across multiple subnets is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a load balancing method, a device and a system, a creating method and a device of a load balancing system, an electronic device and a computer readable storage medium, and realizes seven-layer load balancing of a plurality of virtual servers across a plurality of subnets.
In order to achieve the above object, the present application provides a load balancing method, which is applied to a seven-layer load balancer in a load balancing system, where the load balancing system includes a virtual gateway, a virtual router associated with the virtual gateway, multiple virtual switches associated with the virtual router, the seven-layer load balancer associated with any one of the virtual switches, and a service pool associated with the seven-layer load balancer, where each virtual switch forms a corresponding subnet, each subnet is associated with multiple virtual servers, and the service pool includes at least one virtual server associated with each subnet;
the method comprises the following steps:
receiving a request of a client, and determining a target virtual server in the service pool according to the request;
judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer;
if not, sending the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and receiving the response of the target virtual server to the request sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer;
returning the response to the client.
Wherein, after determining whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer, the method further comprises:
and if the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer, sending the request to the target virtual server through the virtual switch associated with the seven-layer load balancer, and receiving the response of the target virtual server to the request through the virtual switch associated with the seven-layer load balancer.
Wherein the receiving the request of the client includes:
receiving a request of a public network client through a virtual switch associated with the virtual gateway, the virtual router and the seven-layer load balancer in sequence;
correspondingly, returning the response to the client includes:
and returning the response to the public network client through the virtual switch, the virtual router and the virtual gateway which are associated with the seven-layer load balancer in sequence.
Wherein the receiving a request of a client includes:
receiving a request of a subnet client in a target subnet;
correspondingly, returning the response to the client includes:
returning the response to the subnet client.
Wherein, the receiving the request of the subnet client in the target subnet includes:
if the target subnet is the same as the subnet associated with the seven-layer load balancer, receiving a request of a subnet client in the target subnet through a virtual switch corresponding to the target subnet;
correspondingly, returning the response to the subnet client includes:
and returning the response to the subnet client through the virtual switch corresponding to the target subnet.
Wherein, the receiving the request of the subnet client in the target subnet includes:
if the target subnet is different from the subnet associated with the seven-layer load balancer, the request of the subnet client in the target subnet is received sequentially through the virtual switch corresponding to the target subnet, the virtual router and the virtual switch associated with the seven-layer load balancer;
correspondingly, returning the response to the subnet client includes:
and sequentially returning the response to the subnet client through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the target subnet.
In order to achieve the above object, the present application provides a method for creating a load balancing system, including:
creating a virtual router and a virtual gateway, and associating the virtual gateway with the virtual router; wherein the virtual gateway is configured to provide a floating IP address;
creating a plurality of virtual switches associated to the virtual router, each of the virtual switches forming a corresponding subnet;
creating a plurality of virtual server clusters comprising a plurality of virtual servers, setting an IP address of each virtual server, and respectively associating the virtual servers in each virtual server cluster to a corresponding virtual switch so as to add the virtual servers in each virtual server cluster to a subnet corresponding to the virtual switch;
creating a service pool, setting a port of the service pool, and associating at least one virtual server in each subnet to the service pool; the port of the service pool provides a port of real service for a virtual server in the service pool;
establishing a seven-layer load balancer based on a preset system mirror image containing the seven-layer load balancer, associating the seven-layer load balancer to any one of the virtual switches, and setting an IP address and a port of the seven-layer load balancer; the IP address of the seven-layer load balancer is in the range of the subnet corresponding to the associated virtual switch;
and associating the service pool to the seven-layer load balancer, and configuring the corresponding relation between the IP address of the virtual server in the service pool and the port of the service pool in the seven-layer load balancer.
Wherein associating the service pool to the seven-tier load balancer further comprises:
unbinding the service pool associated with the seven-tier load balancer and associating a new service pool to the seven-tier load balancer.
Wherein, after associating at least one virtual server in each of the subnets to the service pool, the method further comprises:
adding a new virtual server in the service pool;
or deleting the virtual server in the service pool.
Wherein, after creating the plurality of virtual switches to be associated to the virtual router, further comprising:
associating a new virtual switch to the virtual router;
or deleting the virtual switch associated with the virtual switch.
In order to achieve the above object, the present application provides a load balancing apparatus, which is applied to a seven-layer load balancer in a load balancing system, where the load balancing system includes a virtual gateway, a virtual router associated with the virtual gateway, a plurality of virtual switches associated with the virtual router, the seven-layer load balancer associated with any one of the virtual switches, and a service pool associated with the seven-layer load balancer, where each virtual switch forms a corresponding subnet, each subnet is associated with a plurality of virtual servers, respectively, and the service pool includes at least one virtual server associated with each subnet;
the device comprises:
the determining module is used for receiving a request of a client and determining a target virtual server in the service pool according to the request;
the judging module is used for judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer;
a first response module, configured to, when a subnet where the target virtual server is located is different from a subnet associated with the seven-layer load balancer, send the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router, and the virtual switch corresponding to the subnet where the target virtual server is located, and receive, by sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router, and the virtual switch associated with the seven-layer load balancer, a response of the target virtual server to the request;
a return module for returning the response to the client.
To achieve the above object, the present application provides a creating apparatus of a load balancing system, including:
a first creation module for creating a virtual router and a virtual gateway, associating the virtual gateway to the virtual router; wherein the virtual gateway is configured to provide a floating IP address;
a second creation module for creating a plurality of virtual switches associated to the virtual router, each virtual switch forming a corresponding subnet;
a third creating module, configured to create a plurality of virtual server clusters including a plurality of virtual servers, set an IP address of each virtual server, and associate a virtual server in each virtual server cluster with a corresponding virtual switch, respectively, so as to add the virtual server in each virtual server cluster into a subnet corresponding to the virtual switch;
a fourth creating module, configured to create a service pool, set a port of the service pool, and associate at least one virtual server in each subnet to the service pool; the port of the service pool provides a port of real service for a virtual server in the service pool;
a fifth creating module, configured to create a seven-layer load balancer based on a preset system image that includes the seven-layer load balancer, associate the seven-layer load balancer with any one of the virtual switches, and set an IP address and a port of the seven-layer load balancer; the IP address of the seven-layer load balancer is in the range of the subnet corresponding to the associated virtual switch;
and the association module is used for associating the service pool to the seven-layer load balancer, and configuring the corresponding relation between the IP address of the virtual server in the service pool and the port of the service pool in the seven-layer load balancer.
To achieve the above object, the present application provides a load balancing system, including:
a virtual gateway connected to the public network;
a virtual router associated with the virtual gateway;
a plurality of virtual switches associated with the virtual router; each virtual switch forms a corresponding subnet, each subnet is respectively associated with a corresponding virtual server cluster, and each virtual server cluster comprises a plurality of virtual servers;
a seven-layer load balancer associated with any one of the virtual switches;
a service pool associated with the seven-tier load balancer; wherein the service pool comprises at least one virtual server associated with each subnet.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
a processor for implementing the steps of the load balancing method or the creating method of the load balancing system when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the creation method of the load balancing method or the load balancing system as described above.
According to the above scheme, the load balancing method provided by the present application is applied to a seven-layer load balancer in a load balancing system, where the load balancing system includes a virtual gateway, a virtual router associated with the virtual gateway, a plurality of virtual switches associated with the virtual router, the seven-layer load balancer associated with any one of the virtual switches, and a service pool associated with the seven-layer load balancer, each of the virtual switches forms a corresponding subnet, each of the subnets is associated with a plurality of virtual servers, and the service pool includes at least one virtual server associated with each subnet; the method comprises the following steps: receiving a request of a client, and determining a target virtual server in the service pool according to the request; judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer; if not, sending the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and receiving the response of the target virtual server to the request sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer; returning the response to the client.
Based on the existing virtualization platform, the platform can conveniently control the association relationship between the subnet and the virtual route and the association relationship between the subnet and the virtual server, seven layers of load balancers and the subnet, the association relationship between the service pool and the virtual server and the association relationship between the seven layers of load balancers and the service pool are increased, seven layers of load balancers and the virtual server across multiple subnet environments can be balanced, the range of the virtual servers proxied by the seven layers of load balancers is flexibly controlled, the maximum control granularity of the virtual servers proxied by the seven layers of load balancers is one service pool, the minimum control granularity of the virtual servers is one virtual server, the control granularity of the load balancers in the related technology is one server, the control granularity is enlarged, and the deployment efficiency is improved. The application also discloses a load balancing device, a load balancing system, a method and a device for creating the load balancing system, an electronic device and a computer readable storage medium, and the technical effects can be realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure, but do not constitute a limitation of the disclosure. In the drawings:
FIG. 1 is a block diagram illustrating a load balancing system in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of load balancing in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating another method of load balancing in accordance with an exemplary embodiment;
FIG. 4 is a flow chart illustrating a method of load balancing of oil according to an exemplary embodiment;
FIG. 5 is a flow diagram illustrating a method of creating a load balancing system in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating another load balancing system in accordance with an exemplary embodiment;
FIG. 7 is a data flow diagram illustrating a seven-tier load balancer accessing a service pool in accordance with an illustrative embodiment;
FIG. 8 is a data flow diagram illustrating a subnet user accessing a seven-layer load balancer, according to an exemplary embodiment;
FIG. 9 is a data flow diagram illustrating a public network user accessing a seven-tier load balancer, according to an example embodiment;
FIG. 10 is a block diagram illustrating a load balancing apparatus in accordance with an exemplary embodiment;
FIG. 11 is a block diagram illustrating a creation apparatus of a load balancing system in accordance with an exemplary embodiment;
FIG. 12 is a block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be apparent that the described embodiments are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In addition, in the embodiments of the present application, "first", "second", and the like are used for distinguishing similar objects, and are not necessarily used for describing a specific order or a sequential order.
The embodiment provides a load balancing system, which realizes seven-layer load balancing of a plurality of virtualized servers across multiple subnets.
Referring to fig. 1, fig. 1 is a block diagram illustrating a load balancing system according to an exemplary embodiment, as shown in fig. 1, including:
a virtual gateway 10 connected to a public network;
a virtual router 20 associated with said virtual gateway 10;
a plurality of virtual switches 30 associated with the virtual router 20; each virtual switch forms a corresponding subnet, each subnet is respectively associated with a corresponding virtual server cluster 40, and each virtual server cluster 40 comprises a plurality of virtual servers 401;
a seven-layer load balancer 50 associated with any one of the virtual switches 30;
a service pool 60 associated with the seven-tier load balancer 50; the service pool 60 includes at least one virtual server 401 associated with each of the subnets.
In a specific implementation, the virtual router is associated with a plurality of subnets, each subnet being associated with a respective virtual server cluster. The seven-layer load balancer is associated with any subnet, and realizes intercommunication with a plurality of virtual server clusters. One or more virtual servers in each virtual server cluster join a service pool, the service pool is associated with a seven-layer load balancer, and the seven-layer load balancer provides load balancing for the service pool. The virtual gateway is associated with the virtual router, and the virtual gateway provides floating IP for the seven-layer load balancer to connect with the public network.
The embodiment of the application is based on the existing virtualization platform, the platform can conveniently control the association relationship between the subnet and the virtual router and the association relationship between the subnet and the virtual server, the seven-layer load balance of the virtual server in a multi-subnet environment can be realized by adding the association relationship between the controllable seven-layer load balancer and the subnet, the association relationship between the service pool and the virtual server and the association relationship between the seven-layer load balancer and the service pool, the range of the virtual server proxied by the seven-layer load balancer is flexibly controlled, the maximum control granularity of the virtual server proxied by the seven-layer load balancer is one service pool, the minimum control granularity is one virtual server, the control granularity of the load balancer in the related technology is one server, the control granularity is enlarged, and the deployment efficiency is improved.
The present embodiment provides a load balancing method, which is applied to a seven-layer load balancer in the load balancing system. Referring to fig. 2, fig. 2 is a flowchart illustrating a load balancing method according to an exemplary embodiment, as shown in fig. 2, including:
s101: receiving a request of a client, and determining a target virtual server in the service pool according to the request;
the execution subject of the present embodiment is a seven-layer load balancer in the load balancing system. In a specific implementation, the client sends a request to the load balancing system, where the client may be a public network client, accesses the load balancing system through a floating IP address provided by the virtual gateway, and the client may also be a client in a certain subnet in the load balancing system, which is not limited specifically herein. And when the seven-layer load balancer receives a request of the client, accessing the service pool to determine a target virtual server.
S102: judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer; if yes, entering S103; if not, entering S104;
s103: sending the request to the target virtual server through the virtual switch associated with the seven-layer load balancer, and receiving the response of the target virtual server to the request through the virtual switch associated with the seven-layer load balancer;
s104: sending the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and receiving the response of the target virtual server to the request sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer;
in specific implementation, if the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer, the seven-layer load balancer sends the request of the client to the target virtual server through the virtual switch corresponding to the subnet, and receives the response of the target virtual server to the request.
S105: returning the response to the client.
In a specific implementation, the seven-tier load balancer returns the response of the target virtual server to the request to the client.
The embodiment of the application is based on the existing virtualization platform, the platform can conveniently control the association relationship between the subnet and the virtual router and the association relationship between the subnet and the virtual server, the seven-layer load balance of the virtual server in a multi-subnet environment can be realized by adding the association relationship between the controllable seven-layer load balancer and the subnet, the association relationship between the service pool and the virtual server and the association relationship between the seven-layer load balancer and the service pool, the range of the virtual server proxied by the seven-layer load balancer is flexibly controlled, the maximum control granularity of the virtual server proxied by the seven-layer load balancer is one service pool, the minimum control granularity is one virtual server, the control granularity of the load balancer in the related technology is one server, the control granularity is enlarged, and the deployment efficiency is improved.
The embodiment of the application discloses a load balancing method, and compared with the previous embodiment, the embodiment further explains and optimizes the technical scheme. Specifically, the method comprises the following steps:
referring to fig. 3, a flowchart of another load balancing method according to an exemplary embodiment is shown, as shown in fig. 3, including:
s201: receiving a request of a public network client through a virtual switch associated with the virtual gateway, the virtual router and the seven-layer load balancer in sequence;
in this embodiment, the public network client accesses the load balancing system through a floating IP address provided by the virtual gateway, that is, sends a request to the virtual gateway, the virtual gateway sends the request to the virtual router, the virtual router sends the request to the virtual switch associated with the seven-layer load balancer, and the virtual switch sends the request to the seven-layer load balancer.
S202: determining a target virtual server in the service pool according to the request;
s203: judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer; if yes, entering S204; if not, entering S205;
s204: sending the request to the target virtual server through the virtual switch associated with the seven-layer load balancer, and receiving the response of the target virtual server to the request through the virtual switch associated with the seven-layer load balancer;
s205: sending the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and receiving the response of the target virtual server to the request sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer;
s206: and returning the response to the public network client through the virtual switch, the virtual router and the virtual gateway which are associated with the seven-layer load balancer in sequence.
In a specific implementation, the seven-layer load balancer returns the response of the target virtual server to the request to the public network client based on the path of the received request, that is, the seven-layer load balancer returns the response to the public network client sequentially through the virtual switch, the virtual router and the virtual gateway associated with the seven-layer load balancer.
The embodiment of the application discloses a load balancing method, and compared with the embodiment of the first load balancing method, the embodiment further describes and optimizes the technical scheme. Specifically, the method comprises the following steps:
referring to fig. 4, a flowchart of yet another load balancing method according to an exemplary embodiment is shown, as shown in fig. 4, including:
s301: receiving a request of a subnet client in a target subnet;
in this embodiment, the target subnet is a subnet in the load balancing system, and the target subnet may be the same as the subnet associated with the seven-layer load balancer or different from the subnet associated with the seven-layer load balancer, which is not limited herein. The subnet client in the target subnet can access the seven-layer load balancer through the incidence relation in the load balancing system, namely, the request is sent to the seven-layer load balancer.
S302: determining a target virtual server in the service pool according to the request;
s303: judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer; if yes, entering S304; if not, the process goes to S305;
s304: sending the request to the target virtual server through the virtual switch associated with the seven-layer load balancer, and receiving the response of the target virtual server to the request through the virtual switch associated with the seven-layer load balancer;
s305: sending the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and receiving the response of the target virtual server to the request sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer;
s306: returning the response to the subnet client.
In a specific implementation, the seven-tier load balancer returns a response to a request by a target virtual server to a subnet client based on a path of the received request.
As a possible implementation, the receiving a request of a subnet client in a target subnet includes: if the target subnet is the same as the subnet associated with the seven-layer load balancer, receiving a request of a subnet client in the target subnet through a virtual switch corresponding to the target subnet; correspondingly, returning the response to the subnet client includes: and returning the response to the subnet client through the virtual switch corresponding to the target subnet.
In specific implementation, if the target subnet is the same as the subnet associated with the seven-layer load balancer, the subnet client in the target subnet sends a request to the virtual switch corresponding to the target subnet, and the virtual switch sends the request to the seven-layer load balancer. And after receiving the response of the target virtual server to the request, the seven-layer load balancer returns the response to the subnet client through the virtual switch.
As another possible implementation, the receiving a request of a subnet client in a target subnet includes: if the target subnet is different from the subnet associated with the seven-layer load balancer, the request of the subnet client in the target subnet is received sequentially through the virtual switch corresponding to the target subnet, the virtual router and the virtual switch associated with the seven-layer load balancer; correspondingly, returning the response to the subnet client includes: and returning the response to the subnet client through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the target subnet in sequence.
In specific implementation, if the target subnet is different from the subnet associated with the seven-layer load balancer, the subnet client in the target subnet sends a request to the virtual switch corresponding to the target subnet, and the virtual switch sends the request to the seven-layer load balancer. And after receiving the response of the target virtual server to the request, the seven-layer load balancer returns the response to the subnet client through the virtual switch.
The present embodiment provides a method for creating a load balancing system, referring to fig. 5, fig. 5 is a flowchart illustrating a method for creating a load balancing system according to an exemplary embodiment, and as shown in fig. 5, the method includes:
s401: creating a virtual router and a virtual gateway, and associating the virtual gateway to the virtual router; wherein the virtual gateway is configured to provide a floating IP address;
in this step, a virtual router and a virtual gateway are newly created, the virtual gateway is associated to the virtual router, the virtual gateway provides a floating IP, and the seven-layer load balancer is connected to a public network based on a port forwarding function.
S402: creating a plurality of virtual switches associated to said virtual router, each said virtual switch forming a corresponding subnet;
in this step, a plurality of virtual switches are newly created to be associated with the virtual router, and one virtual switch forms one subnet.
S403: creating a plurality of virtual server clusters comprising a plurality of virtual servers, setting an IP address of each virtual server, and respectively associating the virtual servers in each virtual server cluster to a corresponding virtual switch so as to add the virtual servers in each virtual server cluster to a subnet corresponding to the virtual switch;
in this step, a plurality of virtual servers are created, the IP addresses of the virtual servers are set, and the virtual servers are divided into a plurality of groups and respectively associated with a plurality of virtual switches, so as to form a plurality of virtual server clusters.
S404: creating a service pool, setting a port of the service pool, and associating at least one virtual server in each subnet to the service pool; the port of the service pool provides a port of real service for a virtual server in the service pool;
in this step, a service pool is newly created, a port of the service pool is set, and one or more virtual servers in each subnet are associated to the service pool. The service pool port is a port through which the virtual server in the service pool provides real services.
S405: establishing a seven-layer load balancer based on a preset system mirror image containing the seven-layer load balancer, associating the seven-layer load balancer to any one of the virtual switches, and setting an IP address and a port of the seven-layer load balancer; the IP address of the seven-layer load balancer is in the range of the subnet corresponding to the associated virtual switch;
in the step, a seven-layer load balancer is newly built based on a preset system image containing the seven-layer load balancer, the seven-layer load balancer is associated to one of the virtual switches, the IP address and the port of the seven-layer load balancer are set for providing seven-layer load balancing service, and the IP address must be in the range of the associated subnet. The user accesses the seven-layer load balancing service through the IP address and port.
S406: and associating the service pool to the seven-layer load balancer, and configuring the corresponding relation between the IP address of the virtual server in the service pool and the port of the service pool in the seven-layer load balancer.
In this step, associating the service pool to the seven-layer load balancer, the system automatically configures "server IP: service pool ports "to seven-layer load balancer. A seven-tier load balancer can only be associated with one service pool.
On the basis of the foregoing embodiment, as a preferred implementation, after associating the service pool to the seven-layer load balancer, the method further includes: unbinding the service pool associated with the seven-tier load balancer and associating a new service pool to the seven-tier load balancer.
In particular implementations, the service pool already associated with the load balancer can be unbundled and a new service pool can be associated, thereby enabling an update of the service pool. And the granularity of controlling all virtual servers of one service pool is achieved by updating the service pool. The system can automatically update the configuration of the seven-layer load balancer according to the result of updating the service pool, and restart the load balancer to enable the configuration to take effect, so that the correct seven-layer load balancing service is provided.
On the basis of the foregoing embodiment, as a preferred implementation, after associating at least one virtual server in each of the subnets to the service pool, the method further includes: and adding a new virtual server in the service pool, or deleting the virtual server in the service pool.
In particular implementations, virtual servers can be added to or deleted from the service pool to enable updating of the virtual servers. The granularity of a single server in the service pool is controlled by updating the operation of the virtual server, the system can automatically update the configuration of the seven-layer load balancer according to the result of updating the virtual server, and restart the seven-layer load balancer to enable the configuration to take effect, so that the correct seven-layer load balancing service is provided.
On the basis of the foregoing embodiment, as a preferred implementation, after creating multiple virtual switch associations to the virtual router, the method further includes: associating a new virtual switch to the virtual router, or deleting a virtual switch associated with the virtual switch.
In a specific implementation, a new virtual switch may be associated to a virtual router or a virtual switch already associated to a virtual router may be deleted, so as to add or delete a virtual server cluster of the already associated virtual switch, thereby implementing an update of the virtual server cluster. After the virtual server cluster is added, the virtual servers in the cluster can be allowed to be added into the service pool. And deleting the virtual server cluster, all the cluster virtual servers which are associated to the service pool can be automatically released.
An application embodiment provided by the present application is described below, referring to fig. 6, and fig. 6 is a structural diagram of another load balancing system according to an exemplary embodiment. As shown in fig. 6, the virtual router is associated with subnet 1, subnet 2, and subnet 3, which are associated with three virtual server clusters, respectively. The seven-layer load balancer is associated with subnet 1 and interworks with three virtual server clusters. The virtual servers 2, 4, 6 and 7 are added into the same service pool, the service pool is associated with a seven-layer load balancer, and the load balancer provides load balancing for the service pool. The virtual gateway is associated with the virtual router, provides floating IP for the seven-layer load balancer to connect with the public network.
Based on the existing virtualization platform, the networking configuration process of the user is as follows:
step 1: and newly building a virtual router and a virtual gateway, associating the virtual gateway with the virtual router, providing a floating IP by the virtual gateway, and enabling the seven-layer load balancer to be connected with the public network based on a port forwarding function.
Step 2: three virtual switches are newly built to be associated to the virtual router, and one virtual switch forms one subnet.
And step 3: nine virtual servers are newly built, the IP addresses of the virtual servers are set, and the nine virtual servers are divided into three groups which are respectively associated with three virtual switches to form three virtual server clusters.
And 4, step 4: and (4) newly building a service pool, setting a port of the service pool, and associating the virtual servers 2, 4, 6 and 7 to the service pool. The service pool port is a port through which the virtual server in the service pool provides real service.
And 5: and establishing a seven-layer load balancer based on a preset system image containing the seven-layer load balancer, wherein the seven-layer load balancer is associated to one of the virtual switches, and setting the IP address and the port of the seven-layer load balancer for providing seven-layer load balancing service, wherein the IP address must be in the range of the associated subnet. The user accesses the seven-layer load balancing service through the IP address and port.
Step 6: associating the service pool to a seven-layer load balancer, and automatically configuring the server IP: service pool port "to a seven-layer load balancer. A seven-tier load balancer can only be associated with one service pool.
For a control scenario, operations of updating a service pool, updating a virtual server, and updating a virtual server cluster may be included.
Updating a service pool refers to unbundling a service pool already associated with a load balancer and associating a new service pool. And the granularity of controlling all virtual servers of one service pool is achieved by updating the service pool. The system can automatically update the configuration of the seven-layer load balancer according to the result of updating the service pool, and restart the load balancer to enable the configuration to take effect, so that the correct seven-layer load balancing service is provided.
Updating a virtual server refers to adding a virtual server to a service pool or deleting a virtual server in a service pool. The granularity of a single server in the control service pool is achieved by updating the operation of the virtual server, the system can automatically update the configuration of the seven-layer load balancer according to the result of updating the virtual server, and restart the seven-layer load balancer to enable the configuration to take effect, so that the correct seven-layer load balancing service is ensured to be provided.
Updating a virtual server cluster refers to associating a new virtual switch to a virtual router or deleting a virtual switch already associated to a virtual router, thereby adding or deleting a virtual server cluster of already associated virtual switches. After the virtual server cluster is added, the virtual servers in the cluster can be allowed to be added into the service pool; and deleting the virtual server cluster, all the cluster virtual servers which are associated to the service pool can be automatically released.
For data flow, the seven-layer load balancer accesses the virtual server in the service pool, namely the access service pool, assuming that the seven-layer load balancer is bound with the subnet 1 and distributes the request to the virtual server 4 by selecting the request, the data flow of the seven-layer load balancer accessing the service pool is shown in fig. 7, the seven-layer load balancer sends the request to the virtual router through the subnet 1, the virtual router forwards the request to the virtual server 4 of the subnet 2, and the data flow direction is 1, 2, 3 and 4; the virtual server 4 sends a response to the seven-layer load balancer with data flows 5, 6, 7, 8.
The data flow of subnet users accessing the seven-layer load balancer as shown in fig. 8, assuming that the seven-layer load balancer is bound to subnet 1, users of subnet 2 access the seven-layer load balancer. A user sends a request to a virtual router through a subnet 2, the virtual router forwards the request to a seven-layer load balancer of the subnet 1, and the data flow direction is 1, 2, 3 and 4; the seven-layer load balancer accesses the service pool to obtain a response, then forwards the response to the user, and the data flow of the response is 5, 6, 7 and 8.
The data flow of the public network user accessing the seven-layer load balancer is as shown in fig. 9, and assuming that the load balancer is bound to the subnet 1, the public network user accesses the seven-layer load balancer. A user sends a request to a virtual router through a gateway, the virtual router forwards the request to a seven-layer load balancer of a subnet 1, and the data flow direction is 1, 2, 3 and 4; the seven-layer load balancer accesses the service pool to obtain a response, then forwards the response to the user, and the data flow of the response is 5, 6, 7 and 8.
In the following, a load balancing apparatus provided in an embodiment of the present application is introduced, and a load balancing apparatus described below and a load balancing method described above may be referred to each other.
Referring to fig. 10, a block diagram of a load balancing apparatus according to an exemplary embodiment is shown, as shown in fig. 10, including:
a determining module 101, configured to receive a request from a client, and determine a target virtual server in the service pool according to the request;
a judging module 102, configured to judge whether a subnet where the target virtual server is located is the same as a subnet associated with the seven-layer load balancer;
a first response module 103, configured to, when the subnet where the target virtual server is located is different from the subnet associated with the seven-layer load balancer, send the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router, and the virtual switch corresponding to the subnet where the target virtual server is located, and receive, by sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router, and the virtual switch associated with the seven-layer load balancer, a response of the target virtual server to the request;
a returning module 104, configured to return the response to the client.
The embodiment of the application is based on the existing virtualization platform, the platform can conveniently control the association relationship between the subnet and the virtual router and the association relationship between the subnet and the virtual server, the seven-layer load balance of the virtual server in a multi-subnet environment can be realized by adding the association relationship between the controllable seven-layer load balancer and the subnet, the association relationship between the service pool and the virtual server and the association relationship between the seven-layer load balancer and the service pool, the range of the virtual server proxied by the seven-layer load balancer is flexibly controlled, the maximum control granularity of the virtual server proxied by the seven-layer load balancer is one service pool, the minimum control granularity is one virtual server, the control granularity of the load balancer in the related technology is one server, the control granularity is enlarged, and the deployment efficiency is improved.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
and the second response module is used for sending the request to the target virtual server through the virtual switch associated with the seven-layer load balancer and receiving the response of the target virtual server to the request through the virtual switch associated with the seven-layer load balancer when the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer.
On the basis of the foregoing embodiment, as a preferred implementation manner, the determining module 101 is specifically configured to: receiving a request of a public network client through a virtual switch associated with the virtual gateway, the virtual router and the seven-layer load balancer in sequence, and determining a target virtual server in the service pool according to the request;
correspondingly, the return module 104 is specifically configured to: and returning the response to the public network client through the virtual switch, the virtual router and the virtual gateway which are associated with the seven-layer load balancer in sequence.
On the basis of the foregoing embodiment, as a preferred implementation manner, the determining module 101 is specifically configured to: receiving a request of a subnet client in a target subnet, and determining a target virtual server in the service pool according to the request;
correspondingly, the return module 104 is specifically configured to: returning the response to the subnet client.
On the basis of the foregoing embodiment, as a preferred implementation manner, the determining module 101 is specifically configured to: if the target subnet is the same as the subnet associated with the seven-layer load balancer, receiving a request of a subnet client in the target subnet through a virtual switch corresponding to the target subnet, and determining a target virtual server in the service pool according to the request;
correspondingly, the return module 104 is specifically configured to: and returning the response to the subnet client through the virtual switch corresponding to the target subnet.
On the basis of the foregoing embodiment, as a preferred implementation manner, the determining module 101 is specifically configured to: if the target subnet is different from the subnet associated with the seven-layer load balancer, the request of the subnet client in the target subnet is received sequentially through the virtual switch corresponding to the target subnet, the virtual router and the virtual switch associated with the seven-layer load balancer, and a target virtual server is determined in the service pool according to the request;
correspondingly, the return module 104 is specifically configured to: and sequentially returning the response to the subnet client through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the target subnet.
In the following, a creating apparatus of a load balancing system provided by an embodiment of the present application is introduced, and a creating apparatus of a load balancing system described below and a creating method of a load balancing system described above may be referred to each other.
Referring to fig. 11, a block diagram of a creating apparatus of a load balancing system according to an exemplary embodiment is shown, as shown in fig. 11, including:
a first creating module 201, configured to create a virtual router and a virtual gateway, and associate the virtual gateway with the virtual router; wherein the virtual gateway is configured to provide a floating IP address;
a second creating module 202, configured to create a plurality of virtual switches associated to the virtual router, each of the virtual switches forming a corresponding subnet;
a third creating module 203, configured to create a plurality of virtual server clusters including a plurality of virtual servers, set an IP address of each virtual server, and associate a virtual server in each virtual server cluster with a corresponding virtual switch, so as to add a virtual server in each virtual server cluster into a subnet corresponding to the virtual switch;
a fourth creating module 204, configured to create a service pool, set a port of the service pool, and associate at least one virtual server in each subnet to the service pool; the port of the service pool provides a port of real service for a virtual server in the service pool;
a fifth creating module 205, configured to create a seven-layer load balancer based on a preset system image including the seven-layer load balancer, associate the seven-layer load balancer with any one of the virtual switches, and set an IP address and a port of the seven-layer load balancer; the IP address of the seven-layer load balancer is in the range of the subnet corresponding to the associated virtual switch;
an associating module 206, configured to associate the service pool to the seven-layer load balancer, where a corresponding relationship between an IP address of a virtual server in the service pool and a port of the service pool is configured in the seven-layer load balancer.
The embodiment of the application is based on the existing virtualization platform, the platform can conveniently control the association relationship between the subnet and the virtual router and the association relationship between the subnet and the virtual server, the seven-layer load balance of the virtual server in a multi-subnet environment can be realized by adding the association relationship between the controllable seven-layer load balancer and the subnet, the association relationship between the service pool and the virtual server and the association relationship between the seven-layer load balancer and the service pool, the range of the virtual server proxied by the seven-layer load balancer is flexibly controlled, the maximum control granularity of the virtual server proxied by the seven-layer load balancer is one service pool, the minimum control granularity is one virtual server, the control granularity of the load balancer in the related technology is one server, the control granularity is enlarged, and the deployment efficiency is improved.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
a first update module to unbind a service pool associated with the seven-tier load balancer and associate a new service pool to the seven-tier load balancer.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
and the second updating module is used for adding a new virtual server in the service pool or deleting the virtual server in the service pool.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
and the third updating module is used for associating a new virtual switch to the virtual router or deleting the virtual switch associated with the virtual switch.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
Based on the hardware implementation of the program module, and in order to implement the method according to the embodiment of the present application, an embodiment of the present application further provides an electronic device, and fig. 12 is a structural diagram of an electronic device according to an exemplary embodiment, as shown in fig. 12, the electronic device includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
the processor 2 is connected with the communication interface 1 to implement information interaction with other devices, and is used for executing a load balancing method or a creating method of a load balancing system provided by one or more of the above technical solutions when running a computer program. And the computer program is stored on the memory 3.
In practice, of course, the various components in the electronic device are coupled together by the bus system 4. It will be appreciated that the bus system 4 is used to enable connection communication between these components. The bus system 4 comprises, in addition to a data bus, a power bus, a control bus and a status signal bus. For clarity of illustration, however, the various buses are labeled as bus system 4 in fig. 12.
The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, a Compact Disc Read-Only Memory (CD-ROM), a magnetic random access Memory (mram); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), synchronous Static Random Access Memory (SSRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), synchronous Dynamic Random Access Memory (SLDRAM), direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 3 described in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiment of the present application may be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 2. The processor 2 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 2 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 3, and the processor 2 reads the program in the memory 3 and in combination with its hardware performs the steps of the aforementioned method.
When the processor 2 executes the program, the corresponding processes in the methods according to the embodiments of the present application are realized, and for brevity, are not described herein again.
In an exemplary embodiment, the present application further provides a storage medium, i.e. a computer storage medium, specifically a computer readable storage medium, for example, including a memory 3 storing a computer program, which can be executed by a processor 2 to implement the steps of the foregoing method. The computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash Memory, magnetic surface Memory, optical disk, CD-ROM, etc. Memory.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media capable of storing program code.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof that contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which may be a personal computer, a server, a network device, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A load balancing method is characterized in that the method is applied to a seven-layer load balancer in a load balancing system, the load balancing system comprises a virtual gateway, a virtual router associated with the virtual gateway, a plurality of virtual switches associated with the virtual router, the seven-layer load balancer associated with any one virtual switch, and a service pool associated with the seven-layer load balancer, each virtual switch forms a corresponding subnet, each subnet is respectively associated with a plurality of virtual servers, and the service pool comprises at least one virtual server associated with each subnet;
the method comprises the following steps:
receiving a request of a client, and determining a target virtual server in the service pool according to the request;
judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer;
if not, sending the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the subnet where the target virtual server is located, and receiving the response of the target virtual server to the request sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router and the virtual switch associated with the seven-layer load balancer;
returning the response to the client.
2. The load balancing method according to claim 1, wherein after determining whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer, the method further comprises:
and if the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer, sending the request to the target virtual server through the virtual switch associated with the seven-layer load balancer, and receiving the response of the target virtual server to the request through the virtual switch associated with the seven-layer load balancer.
3. The load balancing method according to claim 1, wherein the receiving a request from a client comprises:
receiving a request of a public network client through a virtual switch associated with the virtual gateway, the virtual router and the seven-layer load balancer in sequence;
correspondingly, returning the response to the client includes:
and returning the response to the public network client through the virtual switch, the virtual router and the virtual gateway which are associated with the seven-layer load balancer in sequence.
4. The load balancing method according to claim 1, wherein the receiving a request from a client comprises:
receiving a request of a subnet client in a target subnet;
correspondingly, returning the response to the client includes:
returning the response to the subnet client.
5. The load balancing method of claim 4, wherein the receiving a request from a subnet client in the target subnet comprises:
if the target subnet is the same as the subnet associated with the seven-layer load balancer, receiving a request of a subnet client in the target subnet through a virtual switch corresponding to the target subnet;
correspondingly, returning the response to the subnet client includes:
and returning the response to the subnet client through the virtual switch corresponding to the target subnet.
6. The load balancing method of claim 4, wherein the receiving a request from a subnet client in the target subnet comprises:
if the target subnet is different from the subnet associated with the seven-layer load balancer, the request of the subnet client in the target subnet is received sequentially through the virtual switch corresponding to the target subnet, the virtual router and the virtual switch associated with the seven-layer load balancer;
correspondingly, returning the response to the subnet client includes:
and returning the response to the subnet client through the virtual switch associated with the seven-layer load balancer, the virtual router and the virtual switch corresponding to the target subnet in sequence.
7. A method for creating a load balancing system, comprising:
creating a virtual router and a virtual gateway, and associating the virtual gateway to the virtual router; wherein the virtual gateway is configured to provide a floating IP address;
creating a plurality of virtual switches associated to the virtual router, each of the virtual switches forming a corresponding subnet;
creating a plurality of virtual server clusters comprising a plurality of virtual servers, setting an IP address of each virtual server, and respectively associating the virtual servers in each virtual server cluster to a corresponding virtual switch so as to add the virtual servers in each virtual server cluster to a subnet corresponding to the virtual switch;
creating a service pool, setting a port of the service pool, and associating at least one virtual server in each subnet to the service pool; the port of the service pool provides a port of real service for a virtual server in the service pool;
establishing a seven-layer load balancer based on a preset system mirror image containing the seven-layer load balancer, associating the seven-layer load balancer to any one of the virtual switches, and setting an IP address and a port of the seven-layer load balancer; the IP address of the seven-layer load balancer is in the range of the subnet corresponding to the associated virtual switch;
and associating the service pool to the seven-layer load balancer, and configuring the corresponding relation between the IP address of the virtual server in the service pool and the port of the service pool in the seven-layer load balancer.
8. The method for creating a load balancing system according to claim 7, wherein after associating the service pool to the seven-layer load balancer, further comprising:
unbinding the service pool associated with the seven-tier load balancer and associating a new service pool to the seven-tier load balancer.
9. The method for creating a load balancing system according to claim 7, wherein said associating at least one virtual server in each of said sub-networks to said service pool further comprises:
adding a new virtual server in the service pool;
or deleting the virtual server in the service pool.
10. The method for creating a load balancing system according to claim 7, wherein after creating the plurality of virtual switches associated with the virtual router, further comprising:
associating a new virtual switch to the virtual router;
or deleting the virtual switch associated with the virtual switch.
11. The load balancing device is characterized by being applied to a seven-layer load balancer in a load balancing system, wherein the load balancing system comprises a virtual gateway, a virtual router associated with the virtual gateway, a plurality of virtual switches associated with the virtual router, the seven-layer load balancer associated with any one virtual switch, and a service pool associated with the seven-layer load balancer, each virtual switch forms a corresponding subnet, each subnet is respectively associated with a plurality of virtual servers, and the service pool comprises at least one virtual server associated with each subnet;
the device comprises:
the determining module is used for receiving a request of a client and determining a target virtual server in the service pool according to the request;
the judging module is used for judging whether the subnet where the target virtual server is located is the same as the subnet associated with the seven-layer load balancer;
a first response module, configured to, when a subnet where the target virtual server is located is different from a subnet associated with the seven-layer load balancer, send the request to the target virtual server sequentially through the virtual switch associated with the seven-layer load balancer, the virtual router, and the virtual switch corresponding to the subnet where the target virtual server is located, and receive, by sequentially through the virtual switch corresponding to the subnet where the target virtual server is located, the virtual router, and the virtual switch associated with the seven-layer load balancer, a response of the target virtual server to the request;
and the return module is used for returning the response to the client.
12. An apparatus for creating a load balancing system, comprising:
a first creation module for creating a virtual router and a virtual gateway, associating the virtual gateway to the virtual router; wherein the virtual gateway is configured to provide a floating IP address;
a second creation module for creating a plurality of virtual switches associated to the virtual router, each virtual switch forming a corresponding subnet;
a third creating module, configured to create a plurality of virtual server clusters including a plurality of virtual servers, set an IP address of each virtual server, and associate a virtual server in each virtual server cluster with a corresponding virtual switch, respectively, so as to add the virtual server in each virtual server cluster into a subnet corresponding to the virtual switch;
a fourth creating module, configured to create a service pool, set a port of the service pool, and associate at least one virtual server in each subnet to the service pool; the port of the service pool provides a port of real service for a virtual server in the service pool;
a fifth creating module, configured to create a seven-layer load balancer based on a preset system image including the seven-layer load balancer, associate the seven-layer load balancer with any one of the virtual switches, and set an IP address and a port of the seven-layer load balancer; the IP address of the seven-layer load balancer is in the range of the subnet corresponding to the associated virtual switch;
and the association module is used for associating the service pool to the seven-layer load balancer, and configuring the corresponding relation between the IP address of the virtual server in the service pool and the port of the service pool in the seven-layer load balancer.
13. A load balancing system, comprising:
a virtual gateway connected to the public network;
a virtual router associated with the virtual gateway;
a plurality of virtual switches associated with the virtual router; each virtual switch forms a corresponding subnet, each subnet is respectively associated with a corresponding virtual server cluster, and each virtual server cluster comprises a plurality of virtual servers;
a seven-layer load balancer associated with any one of the virtual switches;
a service pool associated with the seven-tier load balancer; wherein the service pool comprises at least one virtual server associated with each subnet.
14. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the load balancing method according to any one of claims 1 to 6 or the creation method of the load balancing system according to any one of claims 7 to 10 when executing the computer program.
15. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the load balancing method according to any one of claims 1 to 6 or the creating method of the load balancing system according to any one of claims 7 to 10.
CN202211518396.XA 2022-11-30 2022-11-30 Load balancing method, device, system and system establishing method, device and medium Active CN115604272B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211518396.XA CN115604272B (en) 2022-11-30 2022-11-30 Load balancing method, device, system and system establishing method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211518396.XA CN115604272B (en) 2022-11-30 2022-11-30 Load balancing method, device, system and system establishing method, device and medium

Publications (2)

Publication Number Publication Date
CN115604272A true CN115604272A (en) 2023-01-13
CN115604272B CN115604272B (en) 2023-03-14

Family

ID=84853646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211518396.XA Active CN115604272B (en) 2022-11-30 2022-11-30 Load balancing method, device, system and system establishing method, device and medium

Country Status (1)

Country Link
CN (1) CN115604272B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030225859A1 (en) * 2002-05-31 2003-12-04 Sun Microsystems, Inc. Request mapping for load balancing
CN101778048A (en) * 2010-02-22 2010-07-14 浪潮(北京)电子信息产业有限公司 Data forwarding method, load balance scheduler and load balance system
CN104243337A (en) * 2013-06-09 2014-12-24 杭州华三通信技术有限公司 Method and device for cross-cluster load balancing
CN106686085A (en) * 2016-12-29 2017-05-17 华为技术有限公司 Load balancing method, apparatus and system
CN107086966A (en) * 2016-02-16 2017-08-22 阿里巴巴集团控股有限公司 A kind of load balancing of network, control and network interaction method and device
US20180063233A1 (en) * 2016-08-25 2018-03-01 Nhn Entertainment Corporation Method and system for processing load balancing using virtual switch in virtual network environment
US20180121225A1 (en) * 2016-11-03 2018-05-03 Salesforce.Com, Inc. Cost efficient and on-demand pool of running instances in a virtual machine environment
CN109547354A (en) * 2018-11-21 2019-03-29 广州市百果园信息技术有限公司 Load-balancing method, device, system, core layer switch and storage medium
CN111901409A (en) * 2020-07-24 2020-11-06 山东海量信息技术研究院 Load balancing implementation method and device of virtualized cloud platform and readable storage medium
CN112740628A (en) * 2018-09-21 2021-04-30 思科技术公司 Segmented routing with fast reroute for container networking

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030225859A1 (en) * 2002-05-31 2003-12-04 Sun Microsystems, Inc. Request mapping for load balancing
CN101778048A (en) * 2010-02-22 2010-07-14 浪潮(北京)电子信息产业有限公司 Data forwarding method, load balance scheduler and load balance system
CN104243337A (en) * 2013-06-09 2014-12-24 杭州华三通信技术有限公司 Method and device for cross-cluster load balancing
CN107086966A (en) * 2016-02-16 2017-08-22 阿里巴巴集团控股有限公司 A kind of load balancing of network, control and network interaction method and device
US20180063233A1 (en) * 2016-08-25 2018-03-01 Nhn Entertainment Corporation Method and system for processing load balancing using virtual switch in virtual network environment
US20180121225A1 (en) * 2016-11-03 2018-05-03 Salesforce.Com, Inc. Cost efficient and on-demand pool of running instances in a virtual machine environment
CN106686085A (en) * 2016-12-29 2017-05-17 华为技术有限公司 Load balancing method, apparatus and system
CN112740628A (en) * 2018-09-21 2021-04-30 思科技术公司 Segmented routing with fast reroute for container networking
CN109547354A (en) * 2018-11-21 2019-03-29 广州市百果园信息技术有限公司 Load-balancing method, device, system, core layer switch and storage medium
CN111901409A (en) * 2020-07-24 2020-11-06 山东海量信息技术研究院 Load balancing implementation method and device of virtualized cloud platform and readable storage medium

Also Published As

Publication number Publication date
CN115604272B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
US10911528B2 (en) Managing replication of computing nodes for provided computer networks
CN112470436B (en) Systems, methods, and computer-readable media for providing multi-cloud connectivity
US9749145B2 (en) Interoperability for distributed overlay virtual environment
US10484515B2 (en) Implementing logical metadata proxy servers in logical networks
US9935920B2 (en) Virtualization gateway between virtualized and non-virtualized networks
EP2838244B1 (en) Providing services for logical networks
US20170353394A1 (en) Resource placement templates for virtual networks
US11095716B2 (en) Data replication for a virtual networking system
JP2019528005A (en) Method, apparatus, and system for a virtual machine to access a physical server in a cloud computing system
CN101924693A (en) Be used for method and system in migrating processes between virtual machines
CN112350918B (en) Service traffic scheduling method, device, equipment and storage medium
US20220174037A1 (en) Distributed network address translation over network environments
CN111556110B (en) Automatic adaptation method for different physical service networks of private cloud system
CN115686729A (en) Container cluster network system, data processing method, device and computer program product
CN111756629B (en) Method, device, equipment, network and medium for accessing equipment to overlay network and communication
CN115604272B (en) Load balancing method, device, system and system establishing method, device and medium
CN114172853B (en) Configuration method and device of traffic forwarding and bare computer server
CN113472799B (en) Interconnection management method, device and equipment based on cloud platform
CN112968879B (en) Method and equipment for realizing firewall management
CN114944971A (en) Kubernetes network deployment method and device, electronic equipment and storage medium
CN117118774B (en) Access method and device of cloud computing gateway under two-layer network
WO2024037619A1 (en) Cloud computing technology-based virtual instance creation method and cloud management platform
WO2024078427A1 (en) Serverless function configuration system, method and apparatus
JP7212158B2 (en) Provider network service extension
CN116233211A (en) Network management method, device, equipment and machine-readable storage medium

Legal Events

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