CN110445725A - It is new that method, the storage medium that load node shunts is added - Google Patents

It is new that method, the storage medium that load node shunts is added Download PDF

Info

Publication number
CN110445725A
CN110445725A CN201910609417.0A CN201910609417A CN110445725A CN 110445725 A CN110445725 A CN 110445725A CN 201910609417 A CN201910609417 A CN 201910609417A CN 110445725 A CN110445725 A CN 110445725A
Authority
CN
China
Prior art keywords
node
newly added
added
utilization rate
load
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
CN201910609417.0A
Other languages
Chinese (zh)
Other versions
CN110445725B (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.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology 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 Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN201910609417.0A priority Critical patent/CN110445725B/en
Publication of CN110445725A publication Critical patent/CN110445725A/en
Application granted granted Critical
Publication of CN110445725B publication Critical patent/CN110445725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5022Workload threshold

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multi Processors (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of method of new addition load node shunting, storage medium, and method includes: the disk utilization rate that each node encloses local server in the heartbeat packet for being periodically sent to central node;Newly added node is slowly write data to pre-set velocity, until the corresponding disk utilization rate of newly added node reaches the first preset value;After the corresponding disk utilization rate of the newly added node reaches the first preset value, the flow of distribution to the newly added node is calculated according to 1/ toatl proportion number * maximum ratio of formula.The present invention can not only overcome the problems, such as that new node switch-time load pressure is excessive and collapses;And the load relative equilibrium of each node of system can be reached as early as possible after new node addition, to significantly improve the availability of cluster.

Description

It is new that method, the storage medium that load node shunts is added
Technical field
The present invention relates to distributed node fields, and in particular to new that method, the storage medium that load node shunts is added.
Background technique
In many projects because data volume it is big situation it is very much, have in many system or software now The deployment of project or the deployment of system are carried out using the mode of distributed deployment.Wherein, need to carry out distributed deployment Software, the most frequently used is exactly that trunking mode is disposed, and cluster internal realizes multiple service nodes, each service node It is provided which same function, and there is a unified traffic ingress in outside, and point of flow is realized by certain tactful mode Stream, such as a node is specifically arrived in some request, is arrived b node according to certain rule next time.
In this case, when inadequate if it is service node, it is necessary to newly increase service node to provide more streams Amount is handled up.There is a central node function in general each cluster, it, all can be to this after a new service node is added Central node is registered, and the relevant information of itself is provided, and when subsequent request comes, central node can be by routing plan It slightly transmit a request on this new node.
At this point, generally using two kinds of strategies in old mode: (1) poll, each node send request in turn.(2) it weighs Weight, the weighted value of each node is set according to configuration file, the transmission made requests according to weight.Using polling mode It will lead to request to be all evenly distributed on each node, and the flow that the node being newly added is undertaken is consistently lower than old section Point, it is unbalanced so as to cause the request distribution of each node;And weight mode, although new node can be made to reach equal in a short time Weighing apparatus, it is still, subsequent also to need frequent power of amendment double recipe formula, less intelligently, meanwhile, if the setting of newly added node weight is excessive, The node being newly added may then be directly resulted in short term, can be collapsed because switch-time load is excessive, cause to service unavailable.
Therefore, it is necessary to provide a kind of new shunting mode, can make as far as possible each for the situation after newly added node The load relative equilibrium of service node, so that the problem for avoiding switch-time load pressure excessive occurs.
Summary of the invention
The technical problems to be solved by the present invention are: a kind of method of new addition load node shunting, storage medium are provided, It can make the load relative equilibrium of each service node, to improve the availability of cluster.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention are as follows:
A kind of new method that load node is added and shunts, comprising:
Each node encloses the disk utilization rate of local server in the heartbeat packet for being periodically sent to central node;
Newly added node is slowly write data to pre-set velocity, until the corresponding disk utilization rate of newly added node reaches First preset value;
After the corresponding disk utilization rate of the newly added node reaches the first preset value, according to 1/ toatl proportion number * of formula Maximum ratio calculates the flow of distribution to the newly added node.
Another technical solution provided by the invention are as follows:
A kind of computer readable storage medium, is stored thereon with computer-readable program, and described program is held by processor When row, the step of a kind of above-mentioned method that newly addition load node shunts is included can be realized.
The beneficial effects of the present invention are: central node will appreciate that the disk utilization rate of each node, and new section is being added When point, first data mode processing request is slowly written, it effectively prevent that much data volumes are written in a short time and lead to load pressure Cross crash;And when the disk utilization rate of new node reaches the first preset value, according to 1/ toatl proportion number * maximum ratio of formula The flow for distributing to new node is recalculated, i.e., assignment of traffic is carried out using maximum ratio mode, new section is slowly improved with this The disk utilization rate of point, improves the flow handling capacity of system;It can make the load relative equilibrium of each node again simultaneously, on the whole Improve the availability of cluster.
Detailed description of the invention
Fig. 1 is a kind of new flow diagram that the method that load node shunts is added of the embodiment of the present invention;
Fig. 2 is the flow diagram for the method that the new addition load node of the embodiment of the present invention one shunts.
Specific embodiment
To explain the technical content, the achieved purpose and the effect of the present invention in detail, below in conjunction with embodiment and cooperate attached Figure is explained.
The most critical design of the present invention is:, data mode processing request is slowly written, being prevented when new node is just added Load pressure is excessive and collapse in a short time;When the disk utilization rate of new node reaches the first preset value, using maximum ratio side Formula carries out assignment of traffic, slowly improves the disk utilization rate of new node.
Fig. 1 is please referred to, the present invention provides a kind of new method that load node is added and shunts, comprising:
Each node encloses the disk utilization rate of local server in the heartbeat packet for being periodically sent to central node;
Newly added node is slowly write data to pre-set velocity, until the corresponding disk utilization rate of newly added node reaches First preset value;
After the corresponding disk utilization rate of the newly added node reaches the first preset value, according to 1/ toatl proportion number * of formula Maximum ratio calculates the flow of distribution to the newly added node.
It is further, described that newly added node is write data to slowly with pre-set velocity, specifically:
Flow according to first preset value distribution corresponding proportion is slowly written with pre-set velocity to newly added node Data are to newly added node.
Seen from the above description, assignment of traffic standard when the first preset value being just added as new node has rationally Property, it can be ensured that the flow distributed is moderate, is unlikely to excessive, and slowly write-in is supported to request treatment effeciency without influencing.
Further, described to calculate distribution to the newly added node according to 1/ toatl proportion number * maximum ratio of formula Flow, later, further includes:
Residual flow is using polling mode mean allocation into other nodes.
Seen from the above description, other original nodes in system still use existing assignment of traffic mode, without Change, can reduce and realize difficulty, improve the simplicity of implementation.
Further, when the gap between the disk utilization rate that central node determines each node local server is second When within preset value, the residual flow is executed using step of the polling mode mean allocation into other nodes.
Seen from the above description, it when the disk utilization rate of each node is all suitable in system, directlys adopt existing Assignment of traffic mode be allocated, be able to achieve the load relative equilibrium of each node in system.
Further, further includes:
After distributed system is added in the newly added node, the resource information of local server, the resource information are obtained Including CPU usage, memory usage and disk utilization rate;
When newly added node is registered to central node, while sending the resource information.
Seen from the above description, new node needs to report the resource information of local server in registration, so as to centromere Point carries out more accurate assignment of traffic accordingly.
Further, first preset value is 3-10%.
Seen from the above description, number setting rationally, has higher feasibility.
Another technical solution provided by the invention are as follows:
A kind of computer readable storage medium, is stored thereon with computer-readable program, and described program is held by processor When row, can be realized it is above-mentioned it is various it is new be added load node shunt method it is included the step of.
As can be seen from the above description, corresponding those of ordinary skill in the art will appreciate that realizing the whole in above-mentioned technical proposal Or part process, relevant hardware can be instructed to realize by computer program, the program can be stored in one In computer-readable storage medium, the program is when being executed, it may include such as the process of above-mentioned each method.Meanwhile it is above-mentioned each A process after execution, is equally able to achieve the beneficial effect that corresponding method has.
Wherein, the storage medium can be disk, optical disc, read-only memory (Read-Only Memory, ) or random access memory (Random Access Memory, RAM) etc. ROM.
Embodiment one
Referring to figure 2., the present embodiment is directed to the case where distributed system newly added node, provides a kind of new addition load section The shunt method of point, each node load relative equilibrium in realization system improve cluster availability.The present embodiment is suitable for mongo Either software as cassandra or other database purchases can be disposed multiple when carrying out clustered deploy(ment) Distributed node.
The present embodiment specifically includes the following steps:
S1: after group system is added in new node, can be registered to the central node of cluster, provide the related letter of itself Breath, the information includes the other configurations information such as local server title, Intranet IP and port, and after registration, new node will be with Central node establishes association, and central node can transmit a request to this new node accordingly;
Particularly, in the present embodiment, the information further includes resource information, and the resource information includes new node itself CPU usage, memory usage and the disk utilization rate of system.Corresponding, each node in group system will be provided with energy Enough obtain the ability of local server associated resource information.
S2: timing is sent out the communication channel by establishing after being associated with central node by each node in group system It send heartbeat packet to central node, to confirm whether each node survives, i.e., whether can normally provide service.
Particularly, in the present embodiment, each node will enclose the resource of local server in heartbeat packet each time Information optionally need to only enclose disk utilization rate.
S3: the heartbeat packet that central node will be collected each node and be regularly sent, the disk for monitoring each node use Rate;
S4: the route assignment made requests according to preset routing policy.
Specifically, all solicited messages are all sent to the node when a freely node in group system;
It when being greater than a node, is then allocated according to disk utilization rate ratio, in the following, expansion is carried out specifically It is bright:
For the new node that group system is added, at this point, the disk utilization rate of new node is generally 0, it is default lower than first Value, therefore using slowly write-in data mode, newly added node is write data to slowly with pre-set velocity;Described first is default Value, is chosen as 3-10%, preferably 5%.By the way of slowly write-in data, can prevent from being written big data quantity in a short time and Lead to that node switch-time load is excessive and collapses, causes to service unavailable.
Preferably, before the disk utilization rate of new node reaches the first preset value, divide according to first preset value Flow with corresponding proportion is to newly added node, for example, the proportional diverting according to configured 5% is requested.For example, current system In have 2 nodes: a and b, corresponding average disk utilization rate is 50%;A node c is newly increased again later;At this point, section The utilization rate of point c is 0;Then the utilization rate of system predicate node c is lower than preset 5%, by the way of slowly write-in data, one Some requests are sent within the section time gives node c.
And after the corresponding disk utilization rate of new node reaches preset value, then it is maximum according to 1/ toatl proportion number * of formula Ratio will be distributed to the flow of the newly added node after calculating.It is shunted again i.e. by the way of maximum ratio.Than Such as, the disk utilization rate ratio of above-mentioned node a:b:c is 60:50:5, at this point, the resources occupation rate for newly receiving your c has been more than 5%, then the ratio 60:50:5 abbreviation is 11:10:1, then carries out new node c flow with flow proportional as 1/22*11 Distribution, i.e. the data according to maximum ratio (11) are that flow proportional so that flow is oriented to node c allows section with this at leisure The resource of point c improves and the resource occupation ratio of existing node a and b approaches at leisure, finally reaches a balance.
For remaining flow, optionally, be averagely written in other nodes using polling mode.It is of course also possible to use Other modes are allocated.
Preferably, pre- second when the gap between the disk utilization rate that central node determines each node local server If when within value, then using all flows of polling mode mean allocation system to each node.Wherein, the second preset value preferably with First preset value is identical, i.e., and 5%.
By the combination of above-mentioned distributing strategy and polling schemas for new node, the resource for realizing newly added node is accounted for With rate and other nodes quite after, the respectively mode that reuses distributes flow, to guarantee the load phase of each node in system To equilibrium.
The present embodiment realizes the load relative equilibrium of each node in system, and after new node addition, will not both go out The much problems of existing switch-time load pressure, will not destroy the load balancing of system, but can reach load balancing again, with aobvious Write the availability for improving cluster.
Embodiment two
The present embodiment corresponding embodiment one provides a kind of computer readable storage medium, is stored thereon with computer-readable Program, described program can be realized one kind described in above-described embodiment one and load node point are newly added when being executed by processor The step of method of stream is included, specific step content without repeating, for further details, please refer to the record of embodiment one herein.
In conclusion a kind of new method that load node shunting is added provided by the invention, storage medium, can not only overcome New node switch-time load pressure is excessive and the problem of collapse;And the negative of each node of system can be reached as early as possible after new node addition Relative equilibrium is carried, to significantly improve the availability of cluster;Further, it is also equipped with practicability height, realizes the advantages such as difficulty is low.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalents made by bright specification and accompanying drawing content are applied directly or indirectly in relevant technical field, similarly include In scope of patent protection of the invention.

Claims (7)

1. a kind of new method that load node is added and shunts characterized by comprising
Each node encloses the disk utilization rate of local server in the heartbeat packet for being periodically sent to central node;
Newly added node is slowly write data to pre-set velocity, until the corresponding disk utilization rate of newly added node reaches first Preset value;
It is maximum according to 1/ toatl proportion number * of formula after the corresponding disk utilization rate of the newly added node reaches the first preset value Ratio calculates the flow of distribution to the newly added node.
2. a kind of new method that load node is added and shunts as described in claim 1, which is characterized in that described with pre-set velocity Newly added node slowly is write data to, specifically:
Data are slowly written with pre-set velocity to newly added node in flow according to first preset value distribution corresponding proportion To newly added node.
3. a kind of new method that load node is added and shunts as described in claim 1, which is characterized in that described according to formula 1/ Toatl proportion number * maximum ratio calculates the flow of distribution to the newly added node, later, further includes:
Residual flow is using polling mode mean allocation into other nodes.
4. a kind of new method that load node is added and shunts as claimed in claim 3, which is characterized in that
When the gap between the disk utilization rate that central node determines each node local server is within the second preset value, The residual flow is executed using step of the polling mode mean allocation into other nodes.
5. a kind of new method that load node is added and shunts as described in claim 1, which is characterized in that further include:
After distributed system is added in the newly added node, the resource information of local server is obtained, the resource information includes CPU usage, memory usage and disk utilization rate;
When newly added node is registered to central node, while sending the resource information.
6. a kind of new method that load node is added and shunts as described in claim 1, which is characterized in that first preset value For 3-10%.
7. a kind of computer readable storage medium, is stored thereon with computer-readable program, which is characterized in that described program is in quilt When processor executes, it can be realized one kind described in the claims 1-6 any one and the side that load node shunts newly be added The step of method is included.
CN201910609417.0A 2019-07-08 2019-07-08 Method and storage medium for shunting newly-added load node Active CN110445725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910609417.0A CN110445725B (en) 2019-07-08 2019-07-08 Method and storage medium for shunting newly-added load node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910609417.0A CN110445725B (en) 2019-07-08 2019-07-08 Method and storage medium for shunting newly-added load node

Publications (2)

Publication Number Publication Date
CN110445725A true CN110445725A (en) 2019-11-12
CN110445725B CN110445725B (en) 2022-07-26

Family

ID=68429588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910609417.0A Active CN110445725B (en) 2019-07-08 2019-07-08 Method and storage medium for shunting newly-added load node

Country Status (1)

Country Link
CN (1) CN110445725B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080117824A1 (en) * 2006-11-21 2008-05-22 Samita Chakrabarti Topological approach for improving network and system utilization in a non-uniform network
WO2016165242A1 (en) * 2015-04-14 2016-10-20 中兴通讯股份有限公司 Method of adjusting number of nodes in system and device utilizing same
CN106416173A (en) * 2014-05-30 2017-02-15 华为技术有限公司 Resource allocation method and device
CN107800744A (en) * 2016-09-06 2018-03-13 北京金山云网络技术有限公司 A kind of service request retransmission method, apparatus and system
US20180352023A1 (en) * 2017-06-01 2018-12-06 Salesforce.Com, Inc. Decentralized, resource aware load distribution in a distributed system
CN109167699A (en) * 2018-08-20 2019-01-08 众安信息技术服务有限公司 The method and apparatus for handling the state of the node of block chain
CN109803024A (en) * 2019-01-28 2019-05-24 北京中科晶上科技股份有限公司 A method of for cluster node network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080117824A1 (en) * 2006-11-21 2008-05-22 Samita Chakrabarti Topological approach for improving network and system utilization in a non-uniform network
CN106416173A (en) * 2014-05-30 2017-02-15 华为技术有限公司 Resource allocation method and device
WO2016165242A1 (en) * 2015-04-14 2016-10-20 中兴通讯股份有限公司 Method of adjusting number of nodes in system and device utilizing same
CN107800744A (en) * 2016-09-06 2018-03-13 北京金山云网络技术有限公司 A kind of service request retransmission method, apparatus and system
US20180352023A1 (en) * 2017-06-01 2018-12-06 Salesforce.Com, Inc. Decentralized, resource aware load distribution in a distributed system
CN109167699A (en) * 2018-08-20 2019-01-08 众安信息技术服务有限公司 The method and apparatus for handling the state of the node of block chain
CN109803024A (en) * 2019-01-28 2019-05-24 北京中科晶上科技股份有限公司 A method of for cluster node network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
谭莉,陶宏才: "一种基于负载均衡的Kubernetes调度改进算法", 《成都信息工程大学学报》 *
陈伟: "一种改进的HDFS副本放置策略", 《长春师范大学学报》 *

Also Published As

Publication number Publication date
CN110445725B (en) 2022-07-26

Similar Documents

Publication Publication Date Title
US6898635B2 (en) Mobile communication system and method of selecting server in mobile communication system
Long et al. LABERIO: Dynamic load-balanced routing in OpenFlow-enabled networks
US7382726B2 (en) Node system, dual ring communication system using node system, and communication method thereof
US20030236887A1 (en) Cluster bandwidth management algorithms
US7403476B2 (en) Adaptive bandwidth throttling for network services
CN108712464A (en) A kind of implementation method towards cluster micro services High Availabitity
US10027760B2 (en) Methods, systems, and computer readable media for short and long term policy and charging rules function (PCRF) load balancing
CN107026907A (en) A kind of load-balancing method, load equalizer and SiteServer LBS
EP2789147B1 (en) Method and apparatus for load balancing in communication system
JPH0293836A (en) Distributed data base controller
CN110365748A (en) Treating method and apparatus, storage medium and the electronic device of business datum
JP2008536409A (en) Method and apparatus for enhanced content delivery over a data network
CN110855741B (en) Service self-adaptive access method and device, storage medium and electronic device
CN109392013A (en) A kind of method of adjustment and communication device of service quality QoS
JP2002057699A (en) Packet transmission system, packet transmission method and recording medium
US20160212052A1 (en) Methods, systems, and computer readable media for balancing diameter message traffic received over long-lived diameter connections
CN109218217B (en) Load sharing method, device, routing equipment and storage medium
CN110445725A (en) It is new that method, the storage medium that load node shunts is added
CN116455817A (en) Software-defined cloud network fusion architecture and route implementation method
CN108200185A (en) A kind of method and device for realizing load balancing
CN106302226B (en) A kind of service dynamic dispatching method of QoS perception
CN108270857A (en) A kind of cloud computing operating system load-balancing method and system
US10834652B2 (en) Electronic communication node load balancing system and method
CN102025609A (en) Packet message-based load balancing distribution system and method thereof
JP6511006B2 (en) Resource allocation management apparatus and allocation destination server determination method

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