CN108810115A - A kind of load-balancing method, device and server suitable for distributed data base - Google Patents

A kind of load-balancing method, device and server suitable for distributed data base Download PDF

Info

Publication number
CN108810115A
CN108810115A CN201810530688.2A CN201810530688A CN108810115A CN 108810115 A CN108810115 A CN 108810115A CN 201810530688 A CN201810530688 A CN 201810530688A CN 108810115 A CN108810115 A CN 108810115A
Authority
CN
China
Prior art keywords
node
data base
distributed
distributed data
metadata
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
CN201810530688.2A
Other languages
Chinese (zh)
Other versions
CN108810115B (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201810530688.2A priority Critical patent/CN108810115B/en
Publication of CN108810115A publication Critical patent/CN108810115A/en
Application granted granted Critical
Publication of CN108810115B publication Critical patent/CN108810115B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Abstract

The present invention relates to a kind of load-balancing methods suitable for distributed data base, device and server, this method includes completing the election of distributed management node and the distributed management node initializing stage of metadata management and the load balancing stage that suitable distributed data base node is selected for client, each distributed data base node sends metadata when starting and gives distributed management node, distributed management node sorts according to the weighted value of each distributed data base node, the metadata of all distributed data base nodes is arranged in metadata array, and by metadata storage of array in distributed management node and each distributed data base node;Simultaneously by the current loading condition information storage of all distributed data base nodes to each distributed data base node, so when current distributed management node is offline, suitable next distributed management node can be chosen by the load balancing stage, avoid the problem that Single Point of Faliure and metadata are lost.

Description

A kind of load-balancing method, device and server suitable for distributed data base
Technical field
The present invention relates to distributed data base technique fields, specifically a kind of load suitable for distributed data base Equalization methods, device and server.
Background technology
Database Systems of today are mostly distributed data base systems, and multiple servers are disposed in a network cluster The data in database are stored, this just needs a kind of method to select suitable cluster server for client.Load is equal Weighing apparatus technology is exactly for the storage and processing resource of multiple servers in balancing cluster so that the overall performance of system is more increased Effect.How to realize that distributed data base load-balancing function has great significance.
Publication No. CN107783823A applies for the patent of a kind of entitled load-balancing method and device, provides one kind Load-balancing method and device realize the load balancing of host, have reached money by automatically controlling the dynamic migration of virtual machine Source scheduling in time, accurately and efficiently purpose, substantially increase host resource utilization rate.
Publication No. CN107480254A applies for the entitled online load balancing side suitable for distributed memory database The patent of method, provides a kind of online load-balancing method suitable for distributed memory database, and this method is first using being based on The greedy algorithm of data backup position calculates a new division to current database, so that every server receives under new division Request be uniformly distributed, then migrated by online data and new data divided into application in the database.With prior art phase Than the invention can complete load balancing faster, while the influence to the execution of transactions requests is very small.
Publication No. CN105787006A applies for the patent of entitled database server SiteServer LBS, is related to one Kind database server SiteServer LBS, can effectively reduce the load of database server, increase database server Handling capacity, improve operational efficiency, securely and reliably.
Publication No. CN107368575A applies for the special of the distributed NewSQL Database Systems of entitled kind of load balancing Profit discloses a kind of distributed NewSQL Database Systems of load balancing, and the invention can solve HBase to be occurred in operation Data distribution is uneven and the load imbalance problem that thus causes.
But there are the following problems and defect for above-mentioned patent institute's extracting method and system:
Load-balancing algorithm is run on a separate server, is susceptible to Single Point of Faliure problem.When operation load is equal When accounting the server failure of method, the function of entire distributed experiment & measurement system can all be affected, and cannot complete Load-balancing function, and the required metadata of load balancing is stored in separate server, is also susceptible to metadata and is lost The problem of mistake.
Invention content
In response to the problems existing in the prior art, the purpose of the present invention is to provide a kind of suitable for the negative of distributed data base Equalization methods, device and server are carried, load-balancing algorithm is run on a separate server for solving the prior art, is held Easily there is Single Point of Faliure problem and the required metadata of load balancing is stored in separate server, is susceptible to first number The problem of according to losing.
For achieving the above object, on the one hand, the present invention provides a kind of load balancing suitable for distributed data base Method, includes the distributed experiment & measurement system being made of more distributed data base nodes, and this method includes completing distributed pipes It manages the distributed management node initializing stage of election and the metadata initialization of node and selects suitable point for client In the load balancing stage of cloth database node, specifically comprise the following steps:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed Management node;
(2) distributed management node receives the metadata and each distributed data that each distributed data base node starts The weighted value P of library node, the metadata include the network address of each distributed data base node, the memory size of CPU and Processing capacity;
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed numbers It is arranged in metadata array according to the metadata of library node, and by metadata storage of array in distributed management node and each distribution In formula database node;
(4) the current loading condition information of each distributed data base node of distributed management node timing receipt, and will The current loading condition information storage of all distributed data base nodes is to each distributed data base node;
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each point The load state information of cloth database node is that client chooses suitable distributed data base node, reaches load balancing Effect.
Second aspect, the present invention also provides a kind of load balancing apparatus suitable for distributed data base, including by more The distributed experiment & measurement system of platform distributed data base node composition, specifically includes:
Management node chooses module, for choosing a distributed number from distributed experiment & measurement system according to preset rules According to library node as distributed management node;
Receiving module receives metadata that each distributed data base node starts and each for distributed management node The weighted value P of distributed data base node, metadata include the network address of each distributed data base node, CPU memory Capacity and processing capacity;
Metadata array module, for distributed management node according to the weighted value P rows of each distributed data base node The metadata of all distributed data base nodes is arranged in metadata array by sequence, and by metadata storage of array in distribution In management node and each distributed data base node;
Load update module, the current loading condition of each distributed data base node of distributed management node timing receipt Information, and by the current loading condition information storage of all distributed data base nodes to each distributed data base node;
Database node chooses module, for distributed management node according to each distributed data base in metadata array The metadata of node and the load state information of each distributed data base node are that client chooses suitable distributed data Library node, achievees the effect that load balancing.
The third aspect, the present invention also provides a kind of server, including memory, processor and storage are on a memory simultaneously The computer program that can be run on a processor, the processor realize following steps when executing described program:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed Management node;
(2) distributed management node receives the metadata and each distributed data that each distributed data base node starts The weighted value P of library node, metadatabase include the network address, the memory size of CPU and place of each distributed data base node Reason ability;
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed numbers It is arranged in metadata array according to the metadata of library node, and by metadata storage of array in distributed management node and each distribution In formula database node;
(4) the current loading condition information of each distributed data base node of distributed management node timing receipt, and will The current loading condition information storage of all distributed data base nodes is to each distributed data base node;
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each point The load state information of cloth database node is that client chooses suitable distributed data base node, reaches load balancing Effect.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
An embodiment of the present invention provides a kind of load-balancing method, device and server suitable for distributed data base, This method include complete distributed management node election and metadata initialization the distributed management node initializing stage with And the load balancing stage of suitable distributed data base node is selected for client, when distributed management node is offline It waits, a distributed data base node is chosen as distributed management section from distributed experiment & measurement system according to preset rules Point.Distributed management node is all a service in distributed experiment & measurement system as per distributed database node Device only chooses one and is used as management node.Each distributed data base node sends metadata to distribution when starting Management node, distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed datas The metadata of library node is arranged in metadata array, and by metadata storage of array in distributed management node and each distribution In database node;Simultaneously by the current loading condition information storage of all distributed data base nodes to each distributed data Library node can be chosen suitable next so when current distributed management node is offline by the load balancing stage A distributed management node, avoids the problem that Single Point of Faliure, while also avoiding the problem that metadata is lost.
In view of the processor and memory information of each distributed data base node, according to each distributed data base node Weighted value P be ranked up.All it is to be selected from next distributed data base node of metadata array when selection every time, The case where thus can all handling client request to avoid a distributed data base node.When processor and memory reach When certain, current distributed database node is just temporarily abandoned, better portfolio effect can be obtained in this way.
Description of the drawings
Fig. 1 is that the load-balancing method main-process stream suitable for distributed data base that the embodiment of the present invention one provides is illustrated Figure;
Fig. 2 is the load balancing stream for the load-balancing method suitable for distributed data base that the embodiment of the present invention one provides Journey schematic diagram;
Fig. 3 is the load balancing apparatus structural schematic diagram provided by Embodiment 2 of the present invention suitable for distributed data base;
Fig. 4 is the structural schematic diagram for the server that the embodiment of the present invention three provides.
Specific implementation mode
The specific implementation mode of the present invention is described below in conjunction with the accompanying drawings, preferably so as to those skilled in the art Understand the present invention.Requiring particular attention is that in the following description, when known function and the detailed description of design perhaps When can desalinate the main contents of the present invention, these descriptions will be ignored herein.
Load-balancing algorithm is run on a separate server in order to solve the prior art, Single Point of Faliure is susceptible to and asks Topic and the required metadata of load balancing are stored in separate server, are susceptible to the problem of metadata is lost.
Distributed data base node in the present invention is the server equipped with data, and distributed experiment & measurement system is by more points Cloth database node forms, and distributed management node is chosen from distributed experiment & measurement system.
An embodiment of the present invention provides a kind of load-balancing method, device and server suitable for distributed data base, Include the distributed experiment & measurement system being made of more distributed data base nodes, this method includes completing distributed management node Election and metadata initialization the distributed management node initializing stage and be the suitable distributed number of client selection According to the load balancing stage of library node, specifically comprise the following steps:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed Management node;
(2) distributed management node receives the metadata and each distributed data that each distributed data base node starts The weighted value P of library node, the metadata include the network address of each distributed data base node, the memory size of CPU and Processing capacity;
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed numbers It is arranged in metadata array according to the metadata of library node, and by metadata storage of array in distributed management node and each distribution In formula database node;
(4) the current loading condition information of each distributed data base node of distributed management node timing receipt, and will The current loading condition information storage of all distributed data base nodes is to each distributed data base node;
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each point The load state information of cloth database node is that client chooses suitable distributed data base node, reaches load balancing Effect.
When distributed management node is offline, one point is chosen from distributed experiment & measurement system according to preset rules Cloth database node is as distributed management node.Distributed management node is as per distributed database node, all It is a server in distributed experiment & measurement system, only chooses one and be used as management node.Each distributed data Metadata is sent when library node starts and gives distributed management node, and distributed management node is according to each distributed data base node Weighted value P sequence, the metadata of all distributed data base nodes is arranged in metadata array, and metadata array is deposited Storage is in distributed management node and each distributed data base node;Simultaneously by the current negative of all distributed data base nodes Status information storage is carried to each distributed data base node, it, can be with so when current distributed management node is offline Suitable next distributed management node is chosen by the load balancing stage, remaining node is as distributed data base section Point, for storing specific data, therefore, the problem of avoiding Single Point of Faliure, while also avoiding the problem that metadata is lost.
In view of the processor and memory information of each distributed data base node, according to each distributed data base node Weighted value P be ranked up.All it is to be selected from next distributed data base node of metadata array when selection every time, The case where thus can all handling client request to avoid a distributed data base node.When processor and memory reach When certain, current distributed database node is just temporarily abandoned, better portfolio effect can be obtained in this way.
In order to better understand the above technical scheme, in conjunction with appended figures and specific embodiments to upper Technical solution is stated to be described in detail.
Embodiment one
A kind of load-balancing method suitable for distributed data base, as shown in Figure 1 and Figure 2, including by more distributed numbers According to library node form distributed experiment & measurement system, this method include complete distributed management node election and metadata it is initial The distributed management node initializing stage of change and the load balancing that suitable distributed data base node is selected for client Stage specifically comprises the following steps:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed Management node;
In this step, distributed management node is the distributed data base node for running load-balancing algorithm, distributed pipes Why reason node can avoid Single Point of Faliure because it includes the initial phase of distributed management node and is selected for client Select the two stages of database node.It, can be by preset rules from distribution when distributed management node server is offline Select a distributed data base node as distributed management node from newly in formula data base set group node, preset rules are specific For:It is ranked up according to the distributed data base node startup time in distributed experiment & measurement system, the distribution that will start at first Formula database node is as distributed management node, when its is offline, time distributed data base node of startup is selected to make For new distributed management node.
(2) distributed management node receives the metadata and each distributed data that each distributed data base node starts The weighted value P of library node, the metadata include the network address of each distributed data base node, the memory size of CPU and Processing capacity;Wherein, the weighted value P of each distributed data base node, calculation formula are:
P=Lc × Lu,
Wherein, Lc is the number of distributed data base node cpu, and Lu is the total memory of distributed data base node.
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed numbers It is arranged in metadata array according to the metadata of library node, and by metadata storage of array in distributed management node and each distribution In formula database node;So when current distributed management node is offline, avoid the problem that metadata is lost.
(4) each distributed data base node sends current loading condition letter by heartbeat timing to distributed management node Breath;Load state information includes current CPU usage C and current distributed database node memory surplus R, unit million. Distributed load equalizing is just initialized and is completed in this way.
The detailed process of initial phase is as follows:
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each point The load state information of cloth database node is that client chooses suitable distributed data base node, reaches load balancing Effect, detailed process are:
(51) if setting C>0.9 or R<300, then S=1 is loaded, S=0 is otherwise loaded;
(52) metadata array is traversed, each distributed data base node is examined in, if do not had in metadata array Distributed data base node then returns to error message to client;If so, then checking current ergodic distribution formula database node Load S return to the network address of current distributed database node to client if S=0, traverse next time when Time is checked since next distributed data base node;If S=1, this distributed data base node is skipped, is examined in Next distributed data base node, until algorithm terminates or return error message.
Load balancing stage detailed process is as follows:
It after the completion of distributed management node initializing, needs to safeguard metadata, point in distributed experiment & measurement system Cloth database node sends load information by heartbeat timing to distributed management node.It is correct safeguard cluster metadata with Afterwards, so that it may to select suitable distributed data base node for client.Whenever client sends out connection request, distributed management Node will select the network address of suitable distributed data base node to client.Client is according to the network of selection Location is connected to specific distributed data base node, sends specific command request.
Distributed management node is all one in distributed experiment & measurement system as each distributed data base node Server only chooses one and is used as management node.Distributed load information is stored in inside Servers-all, so working as When preceding distributed management node is offline, next distributed management node can be elected by the load balancing stage, is kept away Exempt from Single Point of Faliure.
In view of the processor and memory information of each server, it is ranked up according to the weighted value P of each server.Often All it is to be selected from next distributed data base node of metadata array when secondary selection, it thus can be big to avoid one Server all handles the case where client request.When processor and memory reach certain, just temporarily abandon currently dividing Cloth database can obtain better portfolio effect in this way.
Based on same inventive concept, this application provides one corresponding device of embodiment, detailed in Example two.
Embodiment two
Corresponding to embodiment one, a kind of load balancing apparatus suitable for distributed data base is present embodiments provided, such as Shown in Fig. 3, includes the distributed experiment & measurement system being made of more distributed data base nodes, specifically include:
Management node chooses module, for choosing a distributed number from distributed experiment & measurement system according to preset rules According to library node as distributed management node;
Receiving module receives metadata that each distributed data base node starts and each for distributed management node The weighted value P of distributed data base node, metadata include the network address of each distributed data base node, CPU memory Capacity and processing capacity;
Metadata array module, for distributed management node according to the weighted value P rows of each distributed data base node The metadata of all distributed data base nodes is arranged in metadata array by sequence, and by metadata storage of array in distribution In management node and each distributed data base node;
Load update module, the current loading condition of each distributed data base node of distributed management node timing receipt Information, and by the current loading condition information storage of all distributed data base nodes to each distributed data base node;
Database node chooses module, for distributed management node according to each distributed data base in metadata array The metadata of node and the load state information of each distributed data base node are that client chooses suitable distributed data Library node, achievees the effect that load balancing.
Since the device that the present embodiment is introduced is to implement one kind in the embodiment of the present application one to be suitable for distributed data base Load-balancing method, so based on the method described in the embodiment of the present application one, those skilled in the art can be much of that The specific implementation mode and its various change form of the method for the present embodiment are solved, so how to realize this for this method herein Method in application embodiment is no longer discussed in detail.As long as those skilled in the art implement the method in the embodiment of the present application Used device belongs to the range to be protected of the application.
Based on same inventive concept, this application provides one corresponding server of embodiment, detailed in Example three.
Embodiment three
The present embodiment provides a kind of servers, as shown in figure 4, including memory, processor and storing on a memory simultaneously The server program that can be run on a processor, the processor realize following steps when executing described program:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed Management node;
(2) distributed management node receives the metadata and each distributed data that each distributed data base node starts The weighted value P of library node, the metadata include the network address of each distributed data base node, the memory size of CPU and Processing capacity;
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed numbers It is arranged in metadata array according to the metadata of library node, and by metadata storage of array in distributed management node and each distribution In formula database node;
(4) the current loading condition information of each distributed data base node of distributed management node timing receipt, and will The current loading condition information storage of all distributed data base nodes is to each distributed data base node;
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each point The load state information of cloth database node is that client chooses suitable distributed data base node, reaches load balancing Effect.
In specific implementation process, when processor execute server program, any embodiment party in embodiment one may be implemented Formula.
By the server that the present embodiment is introduced be implement the embodiment of the present application one in it is a kind of based on distributed algorithm Equipment used by database loads equalization methods, so based on the equipment described in the embodiment of the present application one, this field institute The specific implementation mode and its various change form of server of the present embodiment can be understood by belonging to technical staff, so right at this How to realize that the method in the embodiment of the present application is no longer discussed in detail in the server.As long as those skilled in the art implement Equipment used by system in the embodiment of the present application belongs to the range to be protected of the application.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, apparatus or server program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, the present invention can be used in one or more wherein include server usable program code server The server program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow chart of device and server program product and/or Block diagram describes.It should be understood that can by server program instructions implementation flow chart and/or block diagram each flow and/or The combination of flow and/or box in box and flowchart and/or the block diagram.These server program instructions can be provided to arrive Generic server, private server, Embedded Processor or other programmable data processing devices processor to generate one Machine so that the instruction executed by server or the processor of other programmable data processing devices generates flowing The device for the function of being specified in one flow of journey figure or multiple flows and/or one box of block diagram or multiple boxes.
These server program instructions may also be stored in energy Boot Server or other programmable data processing devices with spy Determine in the server readable memory that mode works so that the instruction generation being stored in the server readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These server program instructions can be also loaded into server or other programmable data processing devices so that taken Series of operation steps are executed on business device or other programmable devices to generate the processing of server realization, in server or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Although the illustrative specific implementation mode of the present invention is described above, in order to the technology of the art Personnel understand the present invention, it should be apparent that the present invention is not limited to the range of specific implementation mode, to the common skill of the art For art personnel, if various change the attached claims limit and determine the spirit and scope of the present invention in, these Variation is it will be apparent that all utilize the innovation and creation of present inventive concept in the row of protection.

Claims (10)

1. a kind of load-balancing method suitable for distributed data base, which is characterized in that including by more distributed data bases The distributed experiment & measurement system of node composition, this method include that the election of completion distributed management node and metadata initialize Distributed management node initializing stage and the load balancing stage that suitable distributed data base node is selected for client, Specifically comprise the following steps:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed management Node;
(2) distributed management node receives the metadata and each distributed data base section that each distributed data base node starts The weighted value P of point, the metadata includes the network address, the memory size of CPU and processing of each distributed data base node Ability;
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed data bases The metadata of node is arranged in metadata array, and by metadata storage of array in distributed management node and each distributed number According in the node of library;
(4) the current loading condition information of each distributed data base node of distributed management node timing receipt, and will own The current loading condition information storage of distributed data base node is to each distributed data base node;
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each distribution The load state information of database node is that client chooses suitable distributed data base node, reaches the effect of load balancing Fruit.
2. the load-balancing method according to claim 1 suitable for distributed data base, which is characterized in that the step (1) preset rules in are:It is ranked up according to the distributed data base node startup time in distributed experiment & measurement system, it will The distributed data base node started at first is as distributed management node, when it fails, selects time distribution of startup Formula database node is as new distributed management node.
3. the load-balancing method according to claim 1 suitable for distributed data base, which is characterized in that the step (2) the weighted value P of each distributed data base node, calculation formula are in:
P=Lc × Lu,
Wherein, Lc is the number of distributed data base node cpu, and Lu is the total memory of distributed data base node.
4. the load-balancing method according to claim 1 suitable for distributed data base, which is characterized in that the step (4) load state information includes current CPU usage C and current distributed database node memory surplus R in, and unit is Million.
5. the load-balancing method according to claim 4 suitable for distributed data base, which is characterized in that the step (5) detailed process is:
(51) if setting C>0.9 or R<300, then S=1 is loaded, S=0 is otherwise loaded;
(52) metadata array is traversed, each distributed data base node is examined in, if be not distributed in metadata array Formula database node then returns to error message to client;If so, then checking the negative of current ergodic distribution formula database node Carry S, if S=0, return current distributed database node network address arrive client, next time traversal when from Next distributed data base node starts to check;If S=1, this distributed data base node is skipped, is examined in next A distributed data base node, until algorithm terminates or return error message.
6. a kind of load balancing apparatus suitable for distributed data base, which is characterized in that including by more distributed data bases The distributed experiment & measurement system of node composition, specifically includes:
Management node chooses module, for choosing a distributed data base from distributed experiment & measurement system according to preset rules Node is as distributed management node;
Receiving module receives the metadata and each distribution that each distributed data base node starts for distributed management node The weighted value P of formula database node, metadata include the network address of each distributed data base node, the memory size of CPU And processing capacity;
Metadata array module will for distributed management node according to the weighted value P sequences of each distributed data base node The metadata of all distributed data base nodes is arranged in metadata array, and by metadata storage of array in distributed management section In point and each distributed data base node;
Load update module, the current loading condition letter of each distributed data base node of distributed management node timing receipt Breath, and by the current loading condition information storage of all distributed data base nodes to each distributed data base node;
Database node chooses module, for distributed management node according to each distributed data base node in metadata array Metadata and the load state information of each distributed data base node be that client chooses suitable distributed data base section Point, achievees the effect that load balancing.
7. the load balancing apparatus according to claim 6 suitable for distributed data base, which is characterized in that the management Node selection mould preset rules in the block are:According in distributed experiment & measurement system distributed data base node start the time into Row sequence, using the distributed data base node started at first as distributed management node, when it fails, selection time is opened Dynamic distributed data base node is as new distributed management node.
8. the load balancing apparatus according to claim 6 suitable for distributed data base, which is characterized in that the member number According to the weighted value P of each distributed data base node in array module, calculation formula is:
P=Lc × Lu,
Wherein, Lc is the number of distributed data base node cpu, and Lu is the total memory of distributed data base node.
9. the load balancing apparatus according to claim 6 suitable for distributed data base, which is characterized in that the data The specific selection process of library node selection module is:
(1) if setting C>0.9 or R<300, then S=1 is loaded, S=0 is otherwise loaded;Wherein, C is current distributed data Library node cpu utilization rate, R are current distributed database node memory surplus, unit million;
(2) metadata array is traversed, each distributed data base node is examined in, if without distribution in metadata array Database node then returns to error message to client;If so, then checking the load of current ergodic distribution formula database node S returns to the network address of current distributed database node to client, when traversal next time under if S=0 One distributed data base node starts to check;If S=1, this distributed data base node is skipped, is examined in next Distributed data base node, until algorithm terminates or return error message.
10. a kind of server, which is characterized in that on a memory and can be on a processor including memory, processor and storage The computer program of operation, the processor realize following steps when executing described program:
(1) a distributed data base node is chosen from distributed experiment & measurement system according to preset rules as distributed management Node;
(2) distributed management node receives the metadata and each distributed data base section that each distributed data base node starts The weighted value P of point, metadatabase include the network address, the memory size of CPU and processing energy of each distributed data base node Power;
(3) distributed management node sorts according to the weighted value P of each distributed data base node, by all distributed data bases The metadata of node is arranged in metadata array, and by metadata storage of array in distributed management node and each distributed number According in the node of library;
(4) the current loading condition information of each distributed data base node of distributed management node timing receipt, and will own The current loading condition information storage of distributed data base node is to each distributed data base node;
(5) distributed management node is according to the metadata of each distributed data base node in metadata array and each distribution The load state information of database node is that client chooses suitable distributed data base node, reaches the effect of load balancing Fruit.
CN201810530688.2A 2018-05-29 2018-05-29 Load balancing method and device suitable for distributed database and server Active CN108810115B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810530688.2A CN108810115B (en) 2018-05-29 2018-05-29 Load balancing method and device suitable for distributed database and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810530688.2A CN108810115B (en) 2018-05-29 2018-05-29 Load balancing method and device suitable for distributed database and server

Publications (2)

Publication Number Publication Date
CN108810115A true CN108810115A (en) 2018-11-13
CN108810115B CN108810115B (en) 2020-12-01

Family

ID=64090724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810530688.2A Active CN108810115B (en) 2018-05-29 2018-05-29 Load balancing method and device suitable for distributed database and server

Country Status (1)

Country Link
CN (1) CN108810115B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542874A (en) * 2018-11-15 2019-03-29 用友网络科技股份有限公司 Deriving method, guiding device, server, terminal and readable storage medium storing program for executing
CN109542352A (en) * 2018-11-22 2019-03-29 北京百度网讯科技有限公司 Method and apparatus for storing data
CN110196774A (en) * 2019-05-06 2019-09-03 平安科技(深圳)有限公司 To the dispatching method and relevant apparatus of the test of different data server
CN110740293A (en) * 2019-09-06 2020-01-31 武汉烽火众智数字技术有限责任公司 data transmission method, system, device and computer storage medium
CN111611228A (en) * 2020-05-27 2020-09-01 北京学之途网络科技有限公司 Load balance adjustment method and device based on distributed database
CN112115202A (en) * 2020-09-18 2020-12-22 北京人大金仓信息技术股份有限公司 Task distribution method and device in cluster environment
CN114143320A (en) * 2021-09-01 2022-03-04 浪潮云信息技术股份公司 Data gateway method and system based on distributed database

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697526A (en) * 2009-10-10 2010-04-21 中国科学技术大学 Method and system for load balancing of metadata management in distributed file system
CN103458013A (en) * 2013-08-21 2013-12-18 成都云鹰科技有限公司 Streaming media server cluster load balancing system and balancing method
US20150301839A1 (en) * 2014-04-17 2015-10-22 Oracle International Corporation Mft load balancer
CN106559263A (en) * 2016-11-17 2017-04-05 杭州沃趣科技股份有限公司 A kind of improved distributed consensus algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697526A (en) * 2009-10-10 2010-04-21 中国科学技术大学 Method and system for load balancing of metadata management in distributed file system
CN103458013A (en) * 2013-08-21 2013-12-18 成都云鹰科技有限公司 Streaming media server cluster load balancing system and balancing method
US20150301839A1 (en) * 2014-04-17 2015-10-22 Oracle International Corporation Mft load balancer
CN106559263A (en) * 2016-11-17 2017-04-05 杭州沃趣科技股份有限公司 A kind of improved distributed consensus algorithm

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542874A (en) * 2018-11-15 2019-03-29 用友网络科技股份有限公司 Deriving method, guiding device, server, terminal and readable storage medium storing program for executing
CN109542352A (en) * 2018-11-22 2019-03-29 北京百度网讯科技有限公司 Method and apparatus for storing data
CN109542352B (en) * 2018-11-22 2020-05-08 北京百度网讯科技有限公司 Method and apparatus for storing data
CN110196774A (en) * 2019-05-06 2019-09-03 平安科技(深圳)有限公司 To the dispatching method and relevant apparatus of the test of different data server
CN110740293A (en) * 2019-09-06 2020-01-31 武汉烽火众智数字技术有限责任公司 data transmission method, system, device and computer storage medium
CN111611228A (en) * 2020-05-27 2020-09-01 北京学之途网络科技有限公司 Load balance adjustment method and device based on distributed database
CN111611228B (en) * 2020-05-27 2024-03-08 北京明略昭辉科技有限公司 Load balancing adjustment method and device based on distributed database
CN112115202A (en) * 2020-09-18 2020-12-22 北京人大金仓信息技术股份有限公司 Task distribution method and device in cluster environment
CN114143320A (en) * 2021-09-01 2022-03-04 浪潮云信息技术股份公司 Data gateway method and system based on distributed database

Also Published As

Publication number Publication date
CN108810115B (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN108810115A (en) A kind of load-balancing method, device and server suitable for distributed data base
US11709843B2 (en) Distributed real-time partitioned MapReduce for a data fabric
US20200334117A1 (en) Implementing availability domain aware replication policies
CN104067260B (en) Dynamic construction is for undertaking the methods, devices and systems of one group of calculating node of amount of user effort
Campbell et al. Extreme scale with full sql language support in microsoft sql azure
CN104081354B (en) Subregion is managed in scalable environment
KR101959153B1 (en) System for efficient processing of transaction requests related to an account in a database
WO2012144647A1 (en) Virtual machine administration device, virtual machine administration method, and program
US10356150B1 (en) Automated repartitioning of streaming data
CN102882973A (en) Distributed load balancing system and distributed load balancing method based on peer to peer (P2P) technology
CN105979007A (en) Acceleration resource processing method and device and network function virtualization system
CN104850394B (en) The management method and distributed system of distributed application program
CN107346264A (en) A kind of method, apparatus and server apparatus of virtual machine load balance scheduling
US10802749B2 (en) Implementing hierarchical availability domain aware replication policies
CN107450855B (en) Model-variable data distribution method and system for distributed storage
CN106101213A (en) Information-distribution type storage method
EP4029197B1 (en) Utilizing network analytics for service provisioning
CN107124473A (en) The construction method and cloud platform of cloud platform
CN106936882A (en) A kind of electronic article transaction system
Wang et al. Trust: Real-time request updating with elastic resource provisioning in clouds
CN106254452A (en) The big data access method of medical treatment under cloud platform
CN105827744A (en) Data processing method of cloud storage platform
JP5914699B2 (en) Database workload balancing through migration
Gullhav et al. A branch and price approach for deployment of multi-tier software services in clouds
CN105471986B (en) A kind of Constructing data center Scale Revenue Ratio method and device

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