CN113783904A - Load balancing method, routing server and load balancing system - Google Patents

Load balancing method, routing server and load balancing system Download PDF

Info

Publication number
CN113783904A
CN113783904A CN202010516780.0A CN202010516780A CN113783904A CN 113783904 A CN113783904 A CN 113783904A CN 202010516780 A CN202010516780 A CN 202010516780A CN 113783904 A CN113783904 A CN 113783904A
Authority
CN
China
Prior art keywords
server
application server
candidate application
service
standby
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
CN202010516780.0A
Other languages
Chinese (zh)
Other versions
CN113783904B (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.)
BYD Co Ltd
Original Assignee
BYD 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 BYD Co Ltd filed Critical BYD Co Ltd
Priority to CN202010516780.0A priority Critical patent/CN113783904B/en
Publication of CN113783904A publication Critical patent/CN113783904A/en
Application granted granted Critical
Publication of CN113783904B publication Critical patent/CN113783904B/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/1034Reaction to server failures by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a load balancing method, a routing server and a load balancing system, wherein the load balancing method comprises the following steps: receiving a service request sent by a client; determining candidate application servers according to the service request; judging whether the candidate application server can provide the corresponding service; if the candidate application server can not provide the corresponding service, further judging whether the candidate application server has a matched standby server; if the candidate application server has the matched standby server, selecting the matched standby server to provide service for the client; and if the candidate application server does not have the matched standby server, randomly selecting one standby server in an idle state to provide service for the client. The invention can ensure that the load balancing system can still provide service uninterruptedly under the condition that a certain application server has a fault, and avoid the high concurrency phenomenon that a large number of service requests access the database simultaneously.

Description

Load balancing method, routing server and load balancing system
Technical Field
The present invention relates to the technical field of servers, and in particular, to a load balancing method, a routing server, and a load balancing system.
Background
The load balancing is a system consisting of a plurality of servers, and the requests can be evenly distributed to the servers in the load balancing system through a plurality of algorithms, so that the response time of the requests is shortened, and the processing capacity of the system is improved. However, the current load balancing system does not have a detection method and capability for the network system condition, once a fault occurs between a certain server or a certain segment of load balancing equipment and a server network, the load balancing equipment still drains a part of requests to the server which originally provides the service, a large amount of requests are lost, and the requirement of uninterrupted availability cannot be met. Even if these requests are shunted to other servers, the new server does not have a cache for these requests, which can cause a situation where the database is momentarily stressed.
Disclosure of Invention
The invention provides a load balancing method, a routing server and a load balancing system, which aim to solve at least one of the technical problems.
The embodiment of the invention provides a load balancing method, which comprises the following steps: the routing server receives a service request sent by a client; the routing server determines a candidate application server according to the service request; the routing server judges whether the candidate application server can provide corresponding service; if the candidate application server can not provide the corresponding service, the routing server further judges whether the candidate application server has a matched standby server; if the candidate application server has the matched standby server, the routing server selects the matched standby server to provide service for the client; and if the candidate application server does not have the matched standby server, the routing server randomly selects a standby server in an idle state to provide service for the client.
Optionally, if the candidate application server can provide the corresponding service, the routing server directly selects the candidate application server to provide the service to the client.
Optionally, the determining, by the routing server, the candidate application server according to the service request includes:
and calculating the ID of the candidate application server based on a Hash consistency algorithm to determine the candidate application server.
Optionally, the determining, by the routing server, whether the candidate application server can provide the corresponding service includes:
inquiring an application server list to acquire state information of the candidate application servers, wherein the application server list stores the application servers and the corresponding state information;
and judging whether the candidate application server can provide corresponding service according to the state information of the candidate application server.
Optionally, the step of the route server further determining whether the candidate application server has a matched standby server includes:
inquiring whether a standby server corresponding to the candidate application server exists in a standby server list or not;
and judging whether the candidate application server has a matched standby server or not according to the query result.
Another embodiment of the present invention provides a routing server, including: the receiving module is used for receiving a service request sent by a client;
a determining module for determining candidate application servers according to the service request;
the first judging module is used for judging whether the candidate application server can provide corresponding service;
a second judging module, configured to further judge whether the candidate application server has a matched standby server if the candidate application server cannot provide the corresponding service;
the selection module is used for selecting the matched standby server to provide service for the client if the candidate application server has the matched standby server; and if the candidate application server does not have the matched standby server, the routing server randomly selects a standby server in an idle state to provide service for the client.
Optionally, the selecting module is further configured to:
and if the candidate application server can provide the corresponding service, directly selecting the candidate application server to provide the service for the client.
Optionally, the determining module is configured to:
and calculating the ID of the candidate application server based on a Hash consistency algorithm to determine the candidate application server.
Optionally, the first determining module is configured to:
inquiring an application server list to acquire state information of the candidate application servers, wherein the application server list stores the application servers and the corresponding state information;
and judging whether the candidate application server can provide corresponding service according to the state information of the candidate application server.
Optionally, the second determining module is configured to:
inquiring whether a standby server corresponding to the candidate application server exists in a standby server list or not;
and judging whether the candidate application server has a matched standby server or not according to the query result.
An embodiment of the present invention provides a load balancing system, including:
the routing server is used for receiving a service request sent by a client, determining a candidate application server according to the service request, and judging whether the candidate application server can provide corresponding service, if the candidate application server cannot provide the corresponding service, further judging whether the candidate application server has a matched standby server, if the candidate application server has the matched standby server, selecting the matched standby server to provide service for the client, and if the candidate application server does not have the matched standby server, randomly selecting one standby server in an idle state to provide service for the client;
the application server and the standby server are connected with the routing server and used for providing service for the client according to the service request;
and the monitoring server is respectively connected with the routing server, the application server and the standby server and is used for monitoring the states of the application server and the standby server, acquiring the state change information of the application server or the standby server when the states of the application server or the standby server change, and sending the state change information to the routing server so as to update an application server list or a standby server list by the routing server.
The technical scheme provided by the embodiment of the invention has the following beneficial effects: by receiving a service request sent by a client, determining a candidate application server according to the service request, and judging whether the candidate application server can provide a corresponding service, if the candidate application server can not provide the corresponding service, further judging whether the candidate application server has a matched standby server, if the candidate application server has the matched standby server, selecting the matched standby server to provide service for the client, if the candidate application server does not have the matched standby server, a standby server in an idle state is randomly selected to provide service for the client, so that the load balancing system can ensure that when a certain application server fails, it can still guarantee uninterrupted service and avoid high concurrency of a large number of service requests accessing the database at the same time.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow diagram of a method of load balancing according to one embodiment of the invention;
FIG. 2 is a flow diagram of a method of load balancing according to another embodiment of the invention;
FIG. 3 is a block diagram of a routing server according to one embodiment of the present invention;
fig. 4 is a block diagram of a load balancing system according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a load balancing method, a routing server, and a load balancing system according to embodiments of the present invention with reference to the drawings.
Load balancing is a clustering technique of servers or network devices. Load balancing may share a particular service to multiple servers, thereby increasing service processing capacity. However, the current load balancing system does not have a detection method and capability for the network system condition, once a fault occurs between a certain server or a certain section of load balancing equipment and a server network, the load balancing equipment still drains a part of requests to the server which originally provides the service, a large amount of requests are lost, and the requirement of uninterrupted availability cannot be met. Therefore, the invention provides a load balancing method, a routing server and a load balancing system.
Fig. 1 is a flow diagram of a method of load balancing according to one embodiment of the invention.
As shown in fig. 1, the load balancing method includes:
s101, the routing server receives a service request sent by a client.
In the load balancing system, a routing server is mainly responsible for receiving a service request from a client, forwards the service request to an application server or a standby server capable of processing the service request, and processes the service request by the application server or the standby server, so that the load balancing purpose is achieved.
In one embodiment of the invention, the routing server may first receive a service request sent by a client. Wherein the service request may be various network application services.
And S102, the routing server determines candidate application servers according to the service request.
In one embodiment of the invention, the IDs of the candidate application servers may be calculated based on a hash consistency algorithm to determine the candidate application servers. The Hash consistency algorithm is as follows: will [0,2 ]32) All integers are projected onto a circle, and then the integers obtained by hashing the unique code of the application server (application server ID) are also projected onto the circle (e.g., Node-A, Node-B). When a service request is received, an integer obtained by hashing the unique code (such as the client ID) of the service request is also projected onto the circle (such as request-1 and request-2). Finally, the first corresponding application server, that is, the application server allocated to the service request, is found in the clockwise direction.
S103, the route server judges whether the candidate application server can provide the corresponding service.
In an embodiment of the present invention, the application server list may be queried to obtain the state information of the candidate application server, and then whether the candidate application server can provide the corresponding service is determined according to the state information of the candidate application server. The application server list stores the application servers and the corresponding state information, and the application server list can be stored in the routing server. If the state information corresponding to the application server 1 is in a normal service state, the state information corresponding to the application server 2 is in a failure state.
S104, if the candidate application server can not provide the corresponding service, the route server further judges whether the candidate application server has the matched standby server.
In an embodiment of the present invention, it may be queried whether a standby server having a corresponding relationship with the candidate application server exists in the standby server list, and then, whether the candidate application server has a matched standby server is determined according to a query result. Wherein, the standby server list is also stored in the route server, the list stores the information of the standby server, such as the failure of the application server 1, and the standby server 1 matched with the application server 1 can provide the service.
S105, if the candidate application server has the matched standby server, the routing server selects the matched standby server to provide service for the client.
Because the matched standby server and the candidate application server have the corresponding relation, the service requests do not need to be cached, and the high concurrency phenomenon that a large number of service requests access the database at the same time is avoided.
S106, if the candidate application server does not have the matched standby server, the routing server randomly selects a standby server in an idle state to provide service for the client.
In addition, as shown in fig. 2, the load balancing method may further include the steps of:
s107, if the candidate application server can provide the corresponding service, the routing server directly selects the candidate application server to provide the service for the client.
In an embodiment of the present invention, if the determined candidate application server is capable of providing the corresponding service, such as being in a normal state and idle, the candidate application server may be directly used as the application server to provide the service for the client.
The load balancing method of the embodiment of the invention determines the candidate application server according to the service request by receiving the service request sent by the client and judges whether the candidate application server can provide the corresponding service, if the candidate application server cannot provide the corresponding service, further determining whether the candidate application server has a matched standby server, if the candidate application server has the matched standby server, the matched standby server is selected to provide service for the client, if the candidate application server does not have the matched standby server, a standby server in an idle state is randomly selected to provide service for the client, so that the load balancing system can ensure that when a certain application server fails, it can still guarantee uninterrupted service and avoid high concurrency of a large number of service requests accessing the database at the same time.
In order to implement the above embodiment, the present invention further provides a routing server.
Fig. 3 is a block diagram of a routing server according to one embodiment of the present invention.
As shown in fig. 3, the routing server includes a receiving module 310, a determining module 320, a first judging module 330, a second judging module 340, and a selecting module 350.
The receiving module 310 is configured to receive a service request sent by a client.
A determining module 320 for determining candidate application servers according to the service request.
The first determining module 330 is configured to determine whether the candidate application server can provide the corresponding service.
A second determining module 340, configured to further determine whether the candidate application server has a matched standby server if the candidate application server cannot provide the corresponding service.
A selecting module 350, configured to select a matched standby server to provide a service for the client if the candidate application server has the matched standby server; and if the candidate application server does not have the matched standby server, the routing server randomly selects one standby server in an idle state to provide service for the client.
It should be noted that the foregoing explanation of the load balancing method is also applicable to the routing server in the embodiment of the present invention, and details not disclosed in the embodiment of the present invention are not described herein again.
The routing server of the embodiment of the invention receives the service request sent by the client, determines the candidate application server according to the service request, and judges whether the candidate application server can provide the corresponding service, if the candidate application server cannot provide the corresponding service, further determining whether the candidate application server has a matched standby server, if the candidate application server has the matched standby server, the matched standby server is selected to provide service for the client, if the candidate application server does not have the matched standby server, a standby server in an idle state is randomly selected to provide service for the client, so that the load balancing system can ensure that when a certain application server fails, it can still guarantee uninterrupted service and avoid high concurrency of a large number of service requests accessing the database at the same time.
In order to implement the above embodiments, the present invention further provides a load balancing system.
As shown in fig. 4, the load balancing system includes a routing server 410, an application server 420, a standby server 430, and a monitoring server 440.
The routing server 410 is configured to receive a service request sent by a client, determine a candidate application server 420 according to the service request, and determine whether the candidate application server 420 can provide a corresponding service. If the candidate application server 420 cannot provide the corresponding service, it is further determined whether the candidate application server 420 has a matched standby server 430. If the candidate application server 420 has a matched standby server 430, the matched standby server 430 is selected to serve the client. If the candidate application server 420 does not have a matched standby server 430, a standby server 430 in an idle state is randomly selected to serve the client.
And the application server 420 and the standby server 430 are connected with the routing server 410 and used for providing services for the client according to the service request.
And a monitoring server 440, connected to the routing server 410, the application server 420 and the standby server 430, for monitoring states of the application server 420 and the standby server 430, and when the state of the application server 420 or the standby server 430 changes, acquiring state change information of the application server 420 or the standby server 430, and sending the state change information to the routing server 410, so that the routing server 410 updates an application server list or a standby server list.
It should be appreciated that monitoring server 440 does not monitor the status of standby server 430 if it is not in a state to provide service. If standby server 430 is in a state of providing service, monitoring server 440 monitors it.
The load balancing system is described in detail below with a specific example.
The load balancing system may include a routing server, a monitoring server, a cluster server, and a backup server.
The routing server can obtain the IP address and the port number of the cluster server which needs to be connected with the client by performing hash consistency operation on the unique identification ID of the client.
The monitoring server is responsible for monitoring the cluster server. When a certain cluster server fails or recovers to work, the monitoring server sends a notification to the routing server, so that the routing server controls the standby server to acquire the cache information of the failed cluster server at one time to replace the cache information to provide service for the client.
The cluster server is responsible for processing service requests of the client, and when the client is connected, a corresponding relation between the cluster server and the client is stored in the database. After the cluster server with the fault is restarted, the cache can be loaded at one time through the corresponding relation, and the request pressure of the database is reduced. The number of the standby servers may be less than or equal to the number of the cluster servers.
Specifically, the client sends a request to the routing server. The routing server firstly calculates the cluster server needing to provide service by using a Hash consistency algorithm, and then judges whether the state of the cluster server can normally provide service. If the service is normally provided, selecting the cluster server to provide the service; if the cluster server can not provide the service normally, judging whether the cluster server has an allocated standby server. If so, the allocated standby server is selected to provide the service. If not, a standby server which is not providing the service is randomly selected to provide the service. Wherein, the route server maintains three lists, which are respectively: A. the cluster server list is used for storing the cluster server list and the corresponding service state; B. the standby server list is used for storing the standby server list and the corresponding service state; C. and the failed cluster server and the selected standby server list.
In a load balancing system, cluster servers and standby servers may dynamically register for service with a monitoring server. The cluster service has two states of normal service and failure, and the standby server node has two states of standby and starting. The standby state refers to a state that the standby server does not provide service, and the active state refers to a state that the standby server provides service. And the monitoring server carries out health detection on the cluster server and the standby server at regular time, and informs the routing server to change the algorithm when a fault is detected.
The specific execution flow is as follows:
(1) the cluster server dynamically adds cluster server registrations to the monitoring server.
S811, starting the cluster server and sending the cluster server adding message to the monitoring server.
And S812, after receiving the cluster server adding message, the monitoring server starts to monitor the corresponding cluster server.
S813, the monitoring server sends a server adding message to the routing server.
S814, after the routing server receives the server adding message, the routing server adds the cluster server in the cluster server list, and sets the state identifier as a normal service.
And S815, when the client sends the service request, the routing server calculates the cluster server providing the service through an improved hash consistency algorithm.
S816, the routing server feeds back the connection address of the cluster server providing the service to the client.
And S817, the client communicates with the cluster server providing the service according to the connection address.
If the cluster server is connected, the cluster server can acquire the cache information of each connected client and simultaneously store the client information and the unique client identifier in a database. If the connected backup server is used, the corresponding relation between the cluster server and the connected client is not preserved permanently.
(2) The standby server dynamically registers with the monitoring server.
S821, after starting the backup server, sending a backup server addition message to the monitoring server.
The monitoring server does not monitor the standby server.
S822, the monitoring server sends a backup server add message to the routing server.
S823, the routing server receives the backup server adding message, adds the backup server to the backup server list, and sets the status flag of the backup server to the standby status.
(3) The cluster server is deleted.
And S831, the monitoring server detects the cluster servers at regular intervals.
Mainly comprising the detection of network status and applications. The network state may include detection of a ping command, and detection of an application refers to detection of a socket connection state.
S832, if the monitoring server detects a network status or a failure occurs in the application, the monitoring server stops monitoring the failed cluster server, and sends a message for updating the server status to the routing server, and the status identifier changes to failure.
And S833, after receiving the update server state message, the routing server changes the state identifier of the corresponding cluster server in the cluster server list to be a fault.
S834, randomly selecting a standby server with a state mark as a standby state from the standby server list by utilizing a Hash consistency algorithm for starting, and updating the state information of the standby server.
S835, the routing server sends a message of starting the standby server to the monitoring server.
And S836, after receiving the message of starting the standby server, the monitoring server is connected with the standby server and sends the information of the failed cluster server, and the standby server loads the cache information of the failed cluster server from the database at one time to replace the cache information to provide service for the client.
S837, after receiving the message of updating the server status, the route server updates the status in the corresponding standby server list, namely, the route server is modified to be in the starting state.
(4) And after the cluster server is recovered, dynamically changing the state of the cluster server.
And S841, after the cluster server with the fault is restarted, sending a server adding message to the monitoring server.
S842, the monitoring server starts monitoring the cluster server after receiving the server adding message.
S843, the monitoring server sends a server adding message to the routing server.
S844, after receiving the server adding message, the routing server adds the cluster server to the cluster server list if the cluster server is not in the cluster server list. And if the cluster server is already in the cluster server list, changing the state information of the cluster server into normal service.
S845, the route server modifies the state of the standby server replacing the cluster server to be standby.
S846, deleting the corresponding relation between the cluster server and the standby server.
S847, the routing server sends a stop standby server message to the monitoring server.
And S848, after receiving the message of stopping the standby server, the monitoring server cancels the monitoring of the standby server.
The load balancing system of the embodiment of the invention can dynamically update the load balancing algorithm by monitoring the cluster server through the monitoring server, ensures that the load balancing system provides uninterrupted service, and after the cluster server breaks down, the flow of the broken-down server is distributed to the normal cluster server instead of simply deleting the broken-down server, but the flow of the broken-down server is distributed to a standby server by utilizing a pre-stored relation list, and the standby server acquires the cache data at one time, thereby greatly reducing the pressure of a database.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (11)

1. A method of load balancing, comprising:
the routing server receives a service request sent by a client;
the routing server determines a candidate application server according to the service request;
the routing server judges whether the candidate application server can provide corresponding service;
if the candidate application server can not provide the corresponding service, the routing server further judges whether the candidate application server has a matched standby server;
if the candidate application server has the matched standby server, the routing server selects the matched standby server to provide service for the client;
and if the candidate application server does not have the matched standby server, the routing server randomly selects a standby server in an idle state to provide service for the client.
2. The method of claim 1, further comprising:
and if the candidate application server can provide the corresponding service, the routing server directly selects the candidate application server to provide the service for the client.
3. The method of claim 1, wherein the routing server determining candidate application servers from the service request comprises:
and calculating the ID of the candidate application server based on a Hash consistency algorithm to determine the candidate application server.
4. The method of claim 1, wherein the routing server determining whether the candidate application server is capable of providing the corresponding service comprises:
inquiring an application server list to acquire state information of the candidate application servers, wherein the application server list stores the application servers and the corresponding state information;
and judging whether the candidate application server can provide corresponding service according to the state information of the candidate application server.
5. The method of claim 1, wherein the routing server further determining whether the candidate application server has a matched backup server comprises:
inquiring whether a standby server corresponding to the candidate application server exists in a standby server list or not;
and judging whether the candidate application server has a matched standby server or not according to the query result.
6. A routing server, comprising:
the receiving module is used for receiving a service request sent by a client;
a determining module for determining candidate application servers according to the service request;
the first judging module is used for judging whether the candidate application server can provide corresponding service;
a second judging module, configured to further judge whether the candidate application server has a matched standby server if the candidate application server cannot provide the corresponding service;
the selection module is used for selecting the matched standby server to provide service for the client if the candidate application server has the matched standby server; and if the candidate application server does not have the matched standby server, the routing server randomly selects a standby server in an idle state to provide service for the client.
7. The routing server of claim 6, wherein the selection module is further to:
and if the candidate application server can provide the corresponding service, directly selecting the candidate application server to provide the service for the client.
8. The routing server of claim 6, wherein the determination module is to:
and calculating the ID of the candidate application server based on a Hash consistency algorithm to determine the candidate application server.
9. The routing server of claim 6, wherein the first determining module is configured to:
inquiring an application server list to acquire state information of the candidate application servers, wherein the application server list stores the application servers and the corresponding state information;
and judging whether the candidate application server can provide corresponding service according to the state information of the candidate application server.
10. The routing server of claim 6, wherein the second determining module is configured to:
inquiring whether a standby server corresponding to the candidate application server exists in a standby server list or not;
and judging whether the candidate application server has a matched standby server or not according to the query result.
11. A load balancing system, comprising:
the routing server is used for receiving a service request sent by a client, determining a candidate application server according to the service request, and judging whether the candidate application server can provide corresponding service, if the candidate application server cannot provide the corresponding service, further judging whether the candidate application server has a matched standby server, if the candidate application server has the matched standby server, selecting the matched standby server to provide service for the client, and if the candidate application server does not have the matched standby server, randomly selecting one standby server in an idle state to provide service for the client;
the application server and the standby server are connected with the routing server and used for providing service for the client according to the service request;
and the monitoring server is respectively connected with the routing server, the application server and the standby server and is used for monitoring the states of the application server and the standby server, acquiring the state change information of the application server or the standby server when the states of the application server or the standby server change, and sending the state change information to the routing server so as to update an application server list or a standby server list by the routing server.
CN202010516780.0A 2020-06-09 2020-06-09 Load balancing method, route server and load balancing system Active CN113783904B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010516780.0A CN113783904B (en) 2020-06-09 2020-06-09 Load balancing method, route server and load balancing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010516780.0A CN113783904B (en) 2020-06-09 2020-06-09 Load balancing method, route server and load balancing system

Publications (2)

Publication Number Publication Date
CN113783904A true CN113783904A (en) 2021-12-10
CN113783904B CN113783904B (en) 2023-05-09

Family

ID=78834331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010516780.0A Active CN113783904B (en) 2020-06-09 2020-06-09 Load balancing method, route server and load balancing system

Country Status (1)

Country Link
CN (1) CN113783904B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013025497A (en) * 2011-07-19 2013-02-04 Nippon Telegr & Teleph Corp <Ntt> Distributed processing system, distributed processing method, load distribution device, load distribution method, and load distribution program
CN103580988A (en) * 2012-07-31 2014-02-12 阿里巴巴集团控股有限公司 Method for message receiving, pushing and transmitting, device, server group and system
US20140310418A1 (en) * 2013-04-16 2014-10-16 Amazon Technologies, Inc. Distributed load balancer
WO2015101260A1 (en) * 2013-12-30 2015-07-09 广州华多网络科技有限公司 Method and system for processing instant communication service
CN104852934A (en) * 2014-02-13 2015-08-19 阿里巴巴集团控股有限公司 Method for realizing flow distribution based on front-end scheduling, device and system thereof
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster
CN107819605A (en) * 2016-09-14 2018-03-20 北京百度网讯科技有限公司 Method and apparatus for the switching server in server cluster
US20180219783A1 (en) * 2017-01-30 2018-08-02 Cisco Technology, Inc. Reliable load-balancer using segment routing and real-time application monitoring
CN111131451A (en) * 2019-12-23 2020-05-08 武汉联影医疗科技有限公司 Service processing system and service processing method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013025497A (en) * 2011-07-19 2013-02-04 Nippon Telegr & Teleph Corp <Ntt> Distributed processing system, distributed processing method, load distribution device, load distribution method, and load distribution program
CN103580988A (en) * 2012-07-31 2014-02-12 阿里巴巴集团控股有限公司 Method for message receiving, pushing and transmitting, device, server group and system
US20140310418A1 (en) * 2013-04-16 2014-10-16 Amazon Technologies, Inc. Distributed load balancer
WO2015101260A1 (en) * 2013-12-30 2015-07-09 广州华多网络科技有限公司 Method and system for processing instant communication service
CN104852934A (en) * 2014-02-13 2015-08-19 阿里巴巴集团控股有限公司 Method for realizing flow distribution based on front-end scheduling, device and system thereof
CN107819605A (en) * 2016-09-14 2018-03-20 北京百度网讯科技有限公司 Method and apparatus for the switching server in server cluster
US20180219783A1 (en) * 2017-01-30 2018-08-02 Cisco Technology, Inc. Reliable load-balancer using segment routing and real-time application monitoring
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster
CN111131451A (en) * 2019-12-23 2020-05-08 武汉联影医疗科技有限公司 Service processing system and service processing method

Also Published As

Publication number Publication date
CN113783904B (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN106789362B (en) Equipment management method and network management system
US8856581B2 (en) Method for resource information backup operation based on peer to peer network and peer to peer network thereof
US20090150718A1 (en) Large-scale cluster monitoring system, and method of automatically building/restoring the same
CN107153660B (en) Fault detection processing method and system for distributed database system
EP2091180A1 (en) Method, system and device for realizing switching between main and spare
CN105933391A (en) Node capacity expansion method, device and system
US20210014106A1 (en) High availability on a distributed networking platform
CN103795553A (en) Switching of main and standby servers on the basis of monitoring
US9390156B2 (en) Distributed directory environment using clustered LDAP servers
CN110618889A (en) Service availability detection method and device, computer equipment and storage medium
EP3813335B1 (en) Service processing methods and systems based on a consortium blockchain network
CN112118130A (en) Self-adaptive distributed cache master/standby state information switching method and device
CN107508700B (en) Disaster recovery method, device, equipment and storage medium
CN113076212A (en) Cluster management method, device and equipment and computer readable storage medium
JPH10312365A (en) Load decentralization system
CN109189854B (en) Method and node equipment for providing continuous service
CN113783904B (en) Load balancing method, route server and load balancing system
CN111917870A (en) Request processing method, system, device, electronic equipment and storage medium
CN115514797A (en) Backup SMF discovery method, device, electronic equipment and medium
CN115145782A (en) Server switching method, mooseFS system and storage medium
CN111614701B (en) Distributed cluster and container state switching method and device
CN110198221A (en) A kind of implementation method of load balancing, apparatus and system
CN110650059B (en) Fault cluster detection method, device, computer equipment and storage medium
US8438261B2 (en) Failover scheme with service-based segregation
CN113596195A (en) Public IP address management method, device, main node and 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