CN102984184B - The service load balancing method and device of a kind of distributed system - Google Patents

The service load balancing method and device of a kind of distributed system Download PDF

Info

Publication number
CN102984184B
CN102984184B CN201110259333.2A CN201110259333A CN102984184B CN 102984184 B CN102984184 B CN 102984184B CN 201110259333 A CN201110259333 A CN 201110259333A CN 102984184 B CN102984184 B CN 102984184B
Authority
CN
China
Prior art keywords
service
network interface
main
load
server
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.)
Active
Application number
CN201110259333.2A
Other languages
Chinese (zh)
Other versions
CN102984184A (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.)
Shanghai Left Bank Investment Management Co ltd
Shanghai Kelu Software Co Ltd
Original Assignee
Shanghai Kelu Software 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 Shanghai Kelu Software Co Ltd filed Critical Shanghai Kelu Software Co Ltd
Priority to CN201110259333.2A priority Critical patent/CN102984184B/en
Publication of CN102984184A publication Critical patent/CN102984184A/en
Application granted granted Critical
Publication of CN102984184B publication Critical patent/CN102984184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a kind of service load balancing method of distributed system and device, relative to prior art load balancing is carried out according only to network interface flow, the present invention is synthetically considering the load condition of service, after load condition each network interface flow corresponding with the service of server where the service, just determine the busy extent of the service, judge whether to be adapted to be continuing with the service, and the switching of principal and subordinate's service is carried out according to judged result, so as to be effectively prevented from because of one-sidedness caused by the availability that service or server are determined only by uninterrupted, the busy of service can more precisely be judged, appropriate, the probability of happening of effective control system overload.And, all extra-heavy main services on server are only carried out active-standby switch by the present invention with active service, rather than whole server is switched over, so as to ensure more effectively to utilize all hardware resource, and flexible deployment preferably can be carried out to each service on server.

Description

The service load balancing method and device of a kind of distributed system
Technical field
The present invention relates to the service load balancing skill under a kind of load-balancing technique, more particularly to a kind of distributed environment Art.
Background technology
With the further extension and development of industrial control system, it is desirable to provide more powerful disposal ability, so as to energy It is enough more to handle user's visit capacity growing day by day and processing request in time.Typically by setting a series of offer same services The server of content with constitute server cluster come customer in response end processing ask.Receiving the request of the processing from client Which handled afterwards, it is necessary to carry out load balancing and calculate with determining the request being specifically sent to platform server.
Distributed system provide the user an abundant resource collection, thus be increasingly able to be widely applied and by The attention of people, in the prior art, is carried out generally according to each computer or the network interface flow of server in cluster Load balancing is calculated, and judges the load state of each computer or server.It is of the invention however as the deep progress of research Inventor is had found, load balancing calculating is carried out using only network interface flow, and what some were serviced in some moment, distributed system bears Carry very heavy and other service load very light.And then the inventors found that flow size for server or The load of computer is embodied with very big one-sidedness, although the interaction of some information on services is few, calculates complicated.In view of each clothes It is engaged in there is individual performance difference between device, and services the difference in institute's cost source, only relies on network interface flow to carry out load balancing meter Calculate, it is impossible to realize real adaptive load balancing service deployment mechanism, it is impossible to efficiently utilize all hardware resource, it is impossible to effectively The probability of happening of control system overload.
Also, prior art is typically all to carry out load balancing based on server, i.e., to service during load balancing Device integrally carries out active-standby switch, but in practical application, the operation load respectively serviced on synchronization, server is to differ , if carrying out overall switching based on server, then all normal on the server or extra-heavy service can be switched To on another server, easily causing the busy of another server.And one in synchronization only enables active/standby server Platform, existing hardware resource is not made full use of.
In order to solve the above problems, in a distributed system, thus a kind of new service load balancing method arises at the historic moment.
The content of the invention
The present invention solves the technical problem of the offer a kind of service load balancing method and device of distributed system, Make it possible to judge more rationally, exactly the busy extent of Services in Distributed System, the generation of effective control system overload is general Rate, and all hardware resource in distributed system can be more effectively utilized, realize to the spirit between each service on server Deployment living.
In order to solve the above-mentioned technical problem, the invention provides a kind of service load balancing method of distributed system, it is Each service is distributed in each server of different industrial networks in system, and a service is distributed on multiple servers, by multiple clothes Business device provides same services, carries out Backup service, service based on one of them service, and remaining is backup services, each service pair Multiple network interfaces are answered, network backup are carried out, the method includes the steps of:
Each service is preserved with the corresponding relation between the resource object that service is used and respectively servicing corresponding network interface; The load of server where the load of main service exceeds pre-determined threshold, or main service is corresponding beyond pre-determined threshold, or main service At least n network interface flow is less than at least m network interface flow in minimum normal value, or the corresponding each network interface of main service and surpassed in each network interface When going out maximum limit value, active-standby switch is carried out with active service to the main service, wherein, m, n are more than or equal to 1, less than or equal to this Service corresponding all network interface quantity;
When receiving the service request from client, service name and resource object title in request are found Current corresponding main service, to this it is main service corresponding each network interface flow and select, multiple idle network interfaces are therefrom selected, by sky The corresponding access address of not busy network interface returns to client;Client obtains asked service from access address.
As the improvement of above-mentioned technical proposal, the service load can include:The number of threads of service;The server load It can include:Cpu load, and/or memory usage.
As the improvement of above-mentioned technical proposal, before the step of carrying out active-standby switch with active service to the main service, also It can comprise the steps of:The information on load of server where the information on load of each main service of timing acquisition, the main service and should It is main to service corresponding each network interface flow.
As the improvement of above-mentioned technical proposal, service name and resource object title in request, it is current right to find Before the main service answered, the step of selecting the corresponding each network interface flow of main service, can also further it include following Step:
Each service in system is registered, the corresponding relation between the resource object that service and the service are used is preserved, Service the corresponding relation between network interface, service is with institute's corresponding relation between servers, main information on services in respectively servicing;
Service name and resource object title in request, find current corresponding main service, to the main service pair In the step of each network interface flow answered is selected, currently requested main service is found according to the corresponding relation of registration and should It is main to service corresponding network interface.
As the improvement of above-mentioned technical proposal, after the step of carrying out active-standby switch with active service to the main service, bag Containing following steps:The main information on services after switching is updated in log-on message.
As the improvement of above-mentioned technical proposal, each network interface flow corresponding to the main service is selected, and therefrom selection is more In the step of individual idle network interface, one primary idle network interface of selection and a standby idle network interface;
In the step of corresponding access address of the network interface is returned into client, the access address of return at least includes:Clothes Business name, primary network interface IP address+port numbers, the IP address of standby network interface.
Present invention also offers a kind of service load balancing device of distributed system, each service is distributed in difference in system In each server of industrial network, a service is distributed on multiple servers, and same services are provided by multiple servers, is carried out Backup service, is serviced based on one of service, remaining is backup services, the multiple network interfaces of each service correspondence, carries out network standby Part, the device is included:
Memory module, for preserving corresponding relation and each service between the resource object that each service and service are used Corresponding network interface;Active-standby switch module, for carrying out active-standby switch between main service and active service;Monitoring module, is used for The load of server where the load of main service exceeds pre-determined threshold, or main service exceeds pre-determined threshold, or main service correspondence Each network interface at least n network interface flow be less than at least m network interface flow in minimum normal value, or the corresponding each network interface of main service During beyond maximum limit value, indicate that active-standby switch module carries out active-standby switch to the main service with active service, wherein, m, n are big In equal to 1, all network interface quantity corresponding less than or equal to the service;Network interface selecting module, for receiving from client During service request, service name and resource object title in request find current corresponding main service, to the main service Corresponding each network interface flow is selected, and therefrom selects multiple idle network interfaces;Entrance returns to module, for by network interface selecting module The corresponding access address of idle network interface of selection returns to client, indicates that client obtains asked clothes from access address Business.
As the improvement of above-mentioned technical proposal, service load can include:The number of threads of service;And server load can With including:Cpu load, and/or memory usage.
As the improvement of above-mentioned technical proposal, the device can also be included:Data obtaining module, for each master of timing acquisition The information on load of server where the information on load of service, the main service and the corresponding each network interface flow of the main service.
As the improvement of above-mentioned technical proposal, the device can also be included further:Registering modules, for each in system Service is registered, and will service corresponding relation between the resource object that uses of the service, service with it is corresponding between network interface Relation, service and institute's corresponding relation between servers, main information on services is stored in the memory module in respectively servicing;
Network interface selecting module finds the corresponding main clothes of currently requested service according to the corresponding relation preserved in memory module Business and the corresponding network interface of main service.
As the improvement of above-mentioned technical proposal, Registering modules are additionally operable to after active-standby switch module carries out active-standby switch, more Main information on services after new switching, and the main information on services after updating is preserved in a storage module.
As the improvement of above-mentioned technical proposal, following submodule is further included in network interface selecting module:
Select the submodule of a primary idle network interface;
Select the submodule of a standby idle network interface;
The access address that entrance returns to module return can include:It is Service name, primary network interface IP address+port numbers, standby The IP address of network interface.
Compared with prior art, the main distinction and its effect are embodiment of the present invention:In a distributed system, will be each Service is distributed in each server of different industrial networks, and a service is distributed on multiple servers, is carried by multiple servers For same services, Backup service is carried out, is serviced based on one of them service, remaining is backup services, each service is corresponding multiple Network interface, for carrying out network backup.And the load of server surpasses where the load of main service exceeds pre-determined threshold, or main service Go out pre-determined threshold, or the flow of the corresponding each network interface of main service is less than minimum normal value, or the main stream for servicing corresponding each network interface When amount exceeds maximum limit value, active-standby switch is carried out with active service to the main service.Please in the service from client that receives When asking, service name and resource object title in request find current corresponding main service, corresponding to the main service Each network interface flow is selected, and therefrom selects multiple idle network interfaces, and the corresponding access address of idle network interface is returned into client, Client obtains asked service from access address.Load balancing is carried out according only to network interface flow relative to prior art, this Invention embodiment is synthetically considering the load condition of service, the load condition of server and the service pair where the service After each network interface flow answered, the busy extent of the service is just determined, judges whether to be adapted to be continuing with the service, and according to judgement As a result the switching of principal and subordinate's service is carried out, so as to be effectively prevented from because determining service or server only by uninterrupted One-sidedness caused by availability, prevents from interacting partial information less but calculating the erroneous judgement of complicated service, and can be more accurate Ground judges busy, the appropriate of service, the probability of happening of effective control system overload.Also, prior art is generally basede on clothes Business device carries out load balancing, i.e., integrally carry out active-standby switch to server during load balancing, but in practical application, The operation load respectively serviced on synchronization, server is differed, if carrying out overall switching based on server, then can be by All normal or extra-heavy service is switched on another server on the server, easily causes another server It is busy, also, one in synchronization only enables active/standby server, do not make full use of existing hardware resource.And In embodiment of the present invention, all extra-heavy main services on server are only subjected to active-standby switch with active service, so as to Enough ensure more effectively to utilize all hardware resource, and flexible deployment preferably can be carried out to each service on server.
Brief description of the drawings
The present invention is described in further detail with reference to the accompanying drawings and detailed description.
Fig. 1 is sentencing for the active and standby service in the service load balancing method of the distributed system of first embodiment of the invention Disconnected switching flow figure;
Fig. 2 be the distributed system of first embodiment of the invention service load balancing method in service network interface selection Flow chart;
Fig. 3 is the service load balancing structure drawing of device of the distributed system of second embodiment of the invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, the implementation below in conjunction with accompanying drawing to the present invention Mode is described in further detail.
First embodiment of the invention is related to a kind of service load balancing method of distributed system, in distributed system In, each service is distributed in each server of different industrial networks, and a service is distributed on multiple servers, by multiple services Device provides same services, carries out Backup service, is serviced based on one of them service, remaining is backup services, and each service is corresponding Multiple network interfaces, for carrying out network backup.
Each service needs to be registered in distributed system, when carrying out service registry, it is necessary to preserve service and the service Corresponding relation between the resource object used, service the corresponding relation between network interface, service with pair between servers It should be related to, and main information on services in each service, it can all be stored in registration table.The preservation of main information on services can have various shapes Formula, such as comes service based on the service i.e. of foremost in the corresponding relation.
The service load balancing method of specific distributed system includes active and standby service and judges switching and service network interface selection Two parts, wherein judgement and the switching flow of active and standby service, as shown in Figure 1.
In a step 101, the information on load of server where the information on load of each main service of timing acquisition, the main service, With the corresponding each network interface flow of main service.
Wherein, the mode of each information of the main service of timing acquisition can have a variety of, such as:Can be in each main service active Report;It can also actively be asked for from the server of carry out load balancing to each main service;Or, a service operation can also be set Platform(For management service), timed collection service operation state, and regularly report.This several reporting schemes does not influence this reality Apply the final effect of mode.
The load of main service can include:The information such as the number of threads of service.Specifically, service load balancing device can Load is determined with the number of threads reported according to the service.For example, real-time data base can determine to bear according to subscription Lotus amount.And server load can include:The information such as cpu load, memory usage.For example, each main service is every very The information such as the cpu load and memory usage of server where clock just reports this service.
The information that service load balancing device is reported according to each main service, load in real time to each main service, main service institute It is monitored in the corresponding each network interface flow of the load of server and main service, as shown in step 102 to step 105.
In a step 102, judge whether the load of main service exceeds pre-determined threshold.If the load of main service is beyond default Thresholding, then into step 106;If the load of main service is without departing from pre-determined threshold, into step 103.The load of main service It can be included beyond pre-determined threshold:The number of threads of main service is beyond pre-determined threshold etc..
In step 103, whether the load of server where judging main service exceeds pre-determined threshold.If where main service The load of server exceeds pre-determined threshold, then into step 106;If the load of server is without departing from pre- gating where main service Limit, then into step 104.
Specifically, server load can include:Cpu load and memory usage.And the server where main service Load can also include a variety of situations beyond pre-determined threshold, such as the cpu load of server where main service exceed pre-determined threshold; The memory usage of server is beyond pre-determined threshold etc. where main service.Wherein, when server meets any of the above-described situation, quilt The load for regarding as the server exceeds pre-determined threshold.
At step 104, judge whether main service is having at least n network interface flow less than minimum just in corresponding each network interface Whether constant value, i.e. network are obstructed.If main service in corresponding each network interface has more than n(Containing n)Individual network interface flow is less than minimum Normal value, then judge network failure, into step 106;If flow is normal less than minimum in the corresponding each network interface of main service The network interface quantity of value is less than n, then judges that network is normal, into step 105.Wherein n can be set according to actual conditions, and n is big In equal to 1, all network interface quantity corresponding less than or equal to the service.Assuming that n is 1, as long as then in the corresponding each network interface of main service There is a network interface flow to be less than minimum normal value, that is, its network failure is thought, into step 106;Otherwise it is assumed that network is normal, enter Enter step 105.
In step 105, judge whether main service has at least m network interface flow to be limited beyond highest in corresponding each network interface Whether value processed, i.e. network are excessively busy.If more than m(Containing m)Individual network interface flow exceeds maximum limit value, then illustrates that network is excessively busy, Be not suitable for being further added by new service, into step 106;If the network interface quantity in each network interface beyond maximum limit value is less than m, Think that network is normal, return to step 101, server is negative where information on load again in real time to each main service, the main service Lotus information and the corresponding each network interface flow of the main service carry out circularly monitoring.Wherein m can be set according to actual conditions, and m is more than Equal to 1, all network interface quantity corresponding less than or equal to the service.Assuming that m is 3, then have in the corresponding each network interface of main service 3 with On(Containing 3)Network interface flow exceeds maximum limit value, just thinks that the server network is excessively busy, into step 106;Otherwise it is assumed that net Network is normal, return to step 101.
In step 106, active and standby service is carried out to the main service and active service to switch.Active-standby switch is being carried out to service Afterwards, the main information on services after switching is updated in log-on message.Step 101 is then returned to, each main service is born in real time again The information on load of server where lotus information, the main service and the corresponding each network interface flow of the main service continue cycling through monitoring.
It can be seen that, by above-mentioned flow, when the service of some in system or the server where it go wrong, service is negative Carrying balancing equipment can automatically be detected and respective service is switched into active service, stop service request being distributed to the event The service of barrier, and continue to provide the service by other services working properly.
Load balancing is carried out according only to network interface flow relative to prior art, present embodiment is synthetically considering service Load condition, after load condition each network interface flow corresponding with the service of server where the service, just determine the service Busy extent, judge whether to be adapted to be continuing with the service, and the switching of principal and subordinate's service is carried out according to judged result.So as to It can be effectively prevented from, because of one-sidedness caused by the availability for determining service only by uninterrupted, preventing from handing over partial information Mutually less but the erroneous judgement of complicated service is calculated, and can more precisely judge busy, the appropriate of service, effective control system The probability of happening of overload.And prior art is generally basede on server and carries out load balancing, i.e., to service during load balancing Device integrally carries out active-standby switch, and present embodiment is based on service and carries out active-standby switch, only by all overburdens on server(Bag Include service overburden, server overburden, service that corresponding network interface flow is excessive or suspension)Main service and active service carry out Active-standby switch, the former server where before service switching still can provide other not extra-heavy services, so as to ensure All hardware resource is more effectively utilized, the flexible deployment to respectively being serviced on server is realized.
The selection that network interface is serviced in service load balancing is illustrated below:
When receiving the service request from client, service name and resource object title in request are found Current corresponding main service, each network interface flow corresponding to the main service is selected, therefrom selection free time network interface, by idle net The corresponding access address of mouth returns to client, and client obtains asked service from the access address.It is specific distributed The selection flow of network interface is serviced in the service load balancing method of system, as shown in Figure 2.
In step 201, the service request from client is received.
In step 202., in the service request service name and resource object title, and preserved in registration table Corresponding relation, finds the corresponding main service of requested service and the corresponding each network interface of the main service.
In step 203, the corresponding each network interface flow of main service is judged, and therefrom selection free time network interface.
Specifically, a threshold value can be pre-set, when a network interface flow is less than this threshold value, the network interface is quilt Regard as idle network interface.Multiple idle network interfaces are determined according to this threshold value, and therefrom one primary idle network interface of selection and one standby Idle network interface.
In step 204, the corresponding access address of the network interface is returned into client.Wherein, the access address of return can With including:Service name, primary network interface IP address+port numbers, IP address of standby network interface etc..Afterwards, client can connect from this Enter the service that address acquisition is asked.
Second embodiment of the invention is related to a kind of service load balancing device of distributed system, as shown in figure 3, system In each service be distributed in each server of different industrial networks, a service is distributed on multiple servers, by multiple services Device provides same services, carries out Backup service, is serviced based on one of them service, remaining is backup services, and each service is corresponding Multiple network interfaces, carry out network backup, and the device is included:
Memory module, for preserving corresponding relation and each service between the resource object that each service and service are used Corresponding network interface;Active-standby switch module, for carrying out active-standby switch between main service and active service;Monitoring module, is used for The load of server where the load of main service exceeds pre-determined threshold, or main service exceeds pre-determined threshold, or main service correspondence Each network interface at least n network interface flow be less than at least m network interface flow in minimum normal value, or the corresponding each network interface of main service During beyond maximum limit value, active-standby switch is carried out with active service to the main service, wherein, m, n are more than or equal to 1, are less than or equal to The corresponding all network interface quantity of the service;Network interface selecting module, for when receiving the service request from client, according to please Service name and resource object title in asking, find current corresponding main service, and main corresponding each network interface flow is serviced to this Selected, therefrom select multiple idle network interfaces;Entrance returns to module, for the idle network interface pair for selecting network interface selecting module The access address answered returns to client, indicates that client obtains asked service from access address.
As a further improvement, service load can include:The number of threads of service;And server load can include: Cpu load, and/or memory usage.
As a further improvement, the device can also be included:Data obtaining module, for the negative of each main service of timing acquisition The information on load of server where lotus information, the main service and the corresponding each network interface flow of the main service.Registering modules, are used for Each service in system is registered, and the corresponding relation between the resource object that service and the service are used, service and net Corresponding relation between mouthful, service and institute's corresponding relation between servers, main information on services is stored in storage mould in respectively servicing In block;Network interface selecting module according to the corresponding relation preserved in memory module find it is currently requested service it is corresponding it is main service, With the corresponding network interface of main service.
As a further improvement, Registering modules are additionally operable to after active-standby switch module carries out active-standby switch, update after switching Main information on services, and the main information on services after updating is preserved in a storage module.
As a further improvement, can further include following submodule in network interface selecting module:Select a primary free time The submodule of network interface;Select the submodule of a standby idle network interface;Wherein, the access address that entrance return module is returned includes: Service name, primary network interface IP address+port numbers, the IP address of standby network interface.
In summary, in present embodiment, the server where the load of main service exceeds pre-determined threshold, or main service Load exceeds pre-determined threshold, or the flow of the corresponding each network interface of main service is less than minimum normal value, or the corresponding each net of main service When the flow of mouth exceeds maximum limit value, then active-standby switch is carried out with active service to the main service.Receiving from client Service request when, service name and resource object title in request find current corresponding main service, to the main clothes Corresponding each network interface flow of being engaged in is selected, and therefrom selects multiple idle network interfaces, and the corresponding access address of idle network interface is returned To client, client obtains asked service from access address.Born relative to prior art according only to network interface flow Carry balanced, present embodiment is synthetically considering the load condition of service, the load condition of server where the service and should Service after corresponding each network interface flow, just determine the busy extent of the service, judge whether to be adapted to be continuing with the service, and root It is judged that result carries out the switching of principal and subordinate's service, so as to being effectively prevented from because determining to service only by uninterrupted or taking One-sidedness caused by the availability of device of being engaged in, prevents from interacting partial information less but calculating the erroneous judgement of complicated service, and can be more Adequately judge busy, the appropriate of service, the probability of happening of effective control system overload.Also, prior art is general Load balancing is carried out based on server, i.e., integrally carries out active-standby switch to server during load balancing, but reality should In, the operation load respectively serviced on synchronization, server is differed, if carrying out overall cut based on server Change, then all normal on the server or extra-heavy service can be switched on another server, easily caused another Platform server it is busy, also, only enable one therein of active/standby server in synchronization, do not make full use of existing hard Part resource.And in the present embodiment, all extra-heavy main services on server and active service are only subjected to active-standby switch, So as to ensure more effectively to utilize all hardware resource, the flexible deployment to respectively being serviced on server is realized.
Although by referring to some of the preferred embodiment of the invention, being shown and described to the present invention, It will be understood by those skilled in the art that can to it, various changes can be made in the form and details, without departing from this hair Bright spirit and scope.

Claims (12)

1. a kind of service load balancing method of distributed system, it is characterised in that each service is distributed in different industry in system In each server of network, a service is at least distributed on two servers, provides identical by least two server Service, carries out Backup service, is serviced based on one of them service, remaining is backup services, each corresponding at least two nets of service Mouthful, network backup is carried out, the method includes the steps of:
Each service is preserved with the corresponding relation between the resource object that service is used and respectively servicing corresponding network interface;
The load of server exceeds pre-determined threshold where the load of the main service exceeds pre-determined threshold, or the main service, Or at least n network interface flow is less than minimum normal value in the corresponding each network interface of the main service, or the main service is corresponding respectively When at least m network interface flow exceeds maximum limit value in network interface, active-standby switch is carried out with active service to the main service, wherein, M, n are more than or equal to 1, all network interface quantity corresponding less than or equal to the service;
When receiving the service request from client, service name and resource object title in request are found current Corresponding main service, selects the corresponding each network interface flow of main service, at least one idle network interface is therefrom selected, by institute State the corresponding access address of idle network interface and return to the client;
The client obtains asked service from the access address.
2. the service load balancing method of distributed system according to claim 1, it is characterised in that the service load At least include:The number of threads of the service;
The server load at least includes one below:Cpu load, and/or memory usage.
3. the service load balancing method of distributed system according to claim 2, it is characterised in that the described pair of main clothes Before the step of business carries out active-standby switch with active service, also comprise the steps of:
The information on load of server where the information on load of each main service of timing acquisition, the main service and the main service are corresponding Each network interface flow.
4. the service load balancing method of distributed system according to claim 2, it is characterised in that each clothes of the preservation Be engaged in the corresponding relation between the resource object that is used with service and the step of respectively service corresponding network interface before, to the system In each service registered;
It is described to preserve each step for servicing with the corresponding relation between the resource object that service is used and respectively servicing corresponding network interface In rapid, the corresponding relation between the resource object that service and the service are used, the corresponding relation between service and network interface, service are preserved With corresponding relation between servers, main information on services in each service;
The service name and resource object title in request, finds current corresponding main service, to the main service pair In the step of each network interface flow answered is selected, according to the corresponding relation of the registration find currently requested main service, With the corresponding network interface of main service.
5. the service load balancing method of distributed system according to claim 4, it is characterised in that the described pair of main clothes After the step of business carries out active-standby switch with active service, comprise the steps of:
The main information on services after switching is updated in log-on message.
6. the service load balancing method of distributed system according to claim 2, it is characterised in that the described pair of main clothes Corresponding each network interface flow of being engaged in is selected, in the step of therefrom selecting at least one idle network interface, selects a primary idle net Mouth and a standby idle network interface;
It is described the step of the corresponding access address of idle network interface is returned into the client in, the access address of return is at least wrapped Include:Service name, primary network interface IP address+port numbers, the IP address of standby network interface.
7. the service load balancing device of a kind of distributed system, it is characterised in that each service is distributed in different industry in system In each server of network, a service is at least distributed on two servers, provides identical by least two server Service, carries out Backup service, is serviced based on one of them service, remaining is backup services, each corresponding at least two nets of service Mouthful, network backup is carried out, the device is included:
Memory module, it is corresponding with the corresponding relation between the resource object that service is used and each service for preserving each service Network interface;
Active-standby switch module, for carrying out active-standby switch between main service and active service;
Monitoring module, the load of server where for exceeding pre-determined threshold, or the main service in the load of the main service At least n network interface flow is less than minimum normal value, or the master in pre-determined threshold, or the corresponding each network interface of the main service When servicing in corresponding each network interface at least m network interface flow and exceeding maximum limit value, indicate the active-standby switch module to the master Service carries out active-standby switch with active service, wherein, m, n are more than or equal to 1, all network interface numbers corresponding less than or equal to the service Amount;
Network interface selecting module, for when receiving the service request from client, service name and resource in request Object oriented, finds current corresponding main service, to this it is main service corresponding each network interface flow and select, therefrom select at least One idle network interface;
Entrance returns to module, and the corresponding access address of idle network interface for the network interface selecting module to be selected returns to described Client, indicates that the client obtains asked service from the access address.
8. the service load balancing device of distributed system according to claim 7, it is characterised in that the service load At least include:The number of threads of the service;
The server load at least includes one below:Cpu load, and/or memory usage.
9. the service load balancing device of distributed system according to claim 8, it is characterised in that the device is also wrapped Contain:
Data obtaining module, information on load for each main service of timing acquisition, the information on load of server where the main service, With the corresponding each network interface flow of main service.
10. the service load balancing device of distributed system according to claim 8, it is characterised in that the device is also wrapped Contain:
Registering modules, for being registered to each service in the system, and will service the resource object that is used with the service it Between corresponding relation, service the corresponding relation between network interface, service and institute's corresponding relation between servers, master in each service Information on services is stored in the memory module;
It is corresponding that the network interface selecting module finds currently requested service according to the corresponding relation preserved in the memory module Main service and the corresponding network interface of main service.
11. the service load balancing device of distributed system according to claim 10, it is characterised in that the registration mould Block is additionally operable to after the active-standby switch module carries out active-standby switch, updates the main information on services after switching, and after this is updated Main information on services be stored in the memory module.
12. the service load balancing device of the distributed system according to claim 8, it is characterised in that the network interface Following submodule is further included in selecting module:
Select the submodule of a primary idle network interface;
Select the submodule of a standby idle network interface;
The access address that the entrance returns to module return at least includes:It is Service name, primary network interface IP address+port numbers, standby The IP address of network interface.
CN201110259333.2A 2011-09-05 2011-09-05 The service load balancing method and device of a kind of distributed system Active CN102984184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110259333.2A CN102984184B (en) 2011-09-05 2011-09-05 The service load balancing method and device of a kind of distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110259333.2A CN102984184B (en) 2011-09-05 2011-09-05 The service load balancing method and device of a kind of distributed system

Publications (2)

Publication Number Publication Date
CN102984184A CN102984184A (en) 2013-03-20
CN102984184B true CN102984184B (en) 2017-09-19

Family

ID=47857926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110259333.2A Active CN102984184B (en) 2011-09-05 2011-09-05 The service load balancing method and device of a kind of distributed system

Country Status (1)

Country Link
CN (1) CN102984184B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581048B (en) * 2013-11-08 2016-04-13 国家电网公司 A kind of distributed resource overload controlling method of powerline network
CN104023088B (en) * 2014-06-28 2017-04-19 山东大学 Storage server selection method applied to distributed file system
CN104580427B (en) * 2014-12-27 2018-09-04 北京奇虎科技有限公司 Principal and subordinate's balance method and device in a kind of distributed memory system
CN105376317A (en) * 2015-11-19 2016-03-02 网宿科技股份有限公司 Load balancing control method and load balancing control device
CN108307206A (en) * 2017-12-25 2018-07-20 北京奇艺世纪科技有限公司 A kind of distribution method and device of live streaming encoding tasks
CN108848479A (en) * 2018-07-19 2018-11-20 北京车联天下信息技术有限公司 Car networking service load balancing method, device and equipment
CN114785669A (en) * 2018-08-21 2022-07-22 华为技术有限公司 Message processing method and device
CN111158915A (en) * 2019-12-31 2020-05-15 厦门快商通科技股份有限公司 Master-slave relationship switching method, slave server, master server and system
CN114338688B (en) * 2021-12-28 2024-02-23 中国农业银行股份有限公司 Data management method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003048936A1 (en) * 2001-11-29 2003-06-12 Agami Systems, Inc. Fault tolerance using logical checkpointing in computing systems
US6704278B1 (en) * 1999-07-02 2004-03-09 Cisco Technology, Inc. Stateful failover of service managers
CN1744554A (en) * 2005-10-13 2006-03-08 华中科技大学 Expandable dynamic fault-tolerant method for cooperative system
CN101002177A (en) * 2004-06-30 2007-07-18 国际商业机器公司 Method for controlling a software process, method and system for redistributing or continuing operation in a multi-computer architecture
US20080046552A1 (en) * 2006-08-18 2008-02-21 Microsoft Corporation Service resiliency within on-premise products
CN101645918A (en) * 2009-03-20 2010-02-10 中国科学院声学研究所 Internode collaboration method in P2P system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6704278B1 (en) * 1999-07-02 2004-03-09 Cisco Technology, Inc. Stateful failover of service managers
WO2003048936A1 (en) * 2001-11-29 2003-06-12 Agami Systems, Inc. Fault tolerance using logical checkpointing in computing systems
CN101002177A (en) * 2004-06-30 2007-07-18 国际商业机器公司 Method for controlling a software process, method and system for redistributing or continuing operation in a multi-computer architecture
CN1744554A (en) * 2005-10-13 2006-03-08 华中科技大学 Expandable dynamic fault-tolerant method for cooperative system
US20080046552A1 (en) * 2006-08-18 2008-02-21 Microsoft Corporation Service resiliency within on-premise products
CN101645918A (en) * 2009-03-20 2010-02-10 中国科学院声学研究所 Internode collaboration method in P2P system

Also Published As

Publication number Publication date
CN102984184A (en) 2013-03-20

Similar Documents

Publication Publication Date Title
CN102984184B (en) The service load balancing method and device of a kind of distributed system
CN102891868B (en) The load-balancing method of a kind of distributed system and device
US8095935B2 (en) Adapting message delivery assignments with hashing and mapping techniques
CN110213371B (en) Message consumption method, device, equipment and computer storage medium
CN105468450B (en) Method for scheduling task and system
CN108712464A (en) A kind of implementation method towards cluster micro services High Availabitity
CN101815033B (en) Method, device and system for load balancing
CN103888277B (en) A kind of gateway disaster-tolerant backup method, device and system
CN103227838B (en) A kind of multi-load equilibrium treatment apparatus and method
CN109218355A (en) Load equalizing engine, client, distributed computing system and load-balancing method
CN110365748A (en) Treating method and apparatus, storage medium and the electronic device of business datum
CN104243337A (en) Method and device for cross-cluster load balancing
CN105656962A (en) Service calling method and device
CN105516347A (en) Method and device for load balance allocation of streaming media server
CN110809060B (en) Monitoring system and monitoring method for application server cluster
CN109951537A (en) A kind of load balance distribution method towards block chain
EP3019974B1 (en) Control of a distributed data grid layer in a federated database system
CN108933829A (en) A kind of load-balancing method and device
CN112866394B (en) Load balancing method, device, system, computer equipment and storage medium
CN105049509A (en) Cluster scheduling method, load balancer and clustering system
CN109491788A (en) A kind of virtual platform implementation of load balancing and device
CN106953926A (en) A kind of method for routing and device
CN103856337A (en) Resource occupation rate acquiring method, providing method, system and server thereof
CN109728981A (en) A kind of cloud platform fault monitoring method and device
CN105247834B (en) The distribution method of Internet resources, composer and manager in virtual network function

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: 201203 403d, building 5, No. 3000, Longdong Avenue, Pudong New Area, Shanghai

Patentee after: Shanghai Kelu Software Co.,Ltd.

Address before: 201203 Shanghai city Pudong New Area road 887 Lane 82 Zuchongzhi Building No. two North

Patentee before: Shanghai Kelu Software Co.,Ltd.

CP02 Change in the address of a patent holder
TR01 Transfer of patent right

Effective date of registration: 20231107

Address after: 201203 north, 2nd floor, No.82, Lane 887, Zuchongzhi Road, Pudong New Area, Shanghai

Patentee after: Shanghai Kelu Software Co.,Ltd.

Patentee after: Shanghai Left Bank Investment Management Co.,Ltd.

Address before: 201203 403D 5, 3000 Longdong Avenue, Pudong New Area, Shanghai.

Patentee before: Shanghai Kelu Software Co.,Ltd.

TR01 Transfer of patent right