CN109246250A - The method for adjusting dummy node quantity according to the change of number of servers - Google Patents

The method for adjusting dummy node quantity according to the change of number of servers Download PDF

Info

Publication number
CN109246250A
CN109246250A CN201811327654.XA CN201811327654A CN109246250A CN 109246250 A CN109246250 A CN 109246250A CN 201811327654 A CN201811327654 A CN 201811327654A CN 109246250 A CN109246250 A CN 109246250A
Authority
CN
China
Prior art keywords
server
dummy node
hash
newly
increased
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.)
Withdrawn
Application number
CN201811327654.XA
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201811327654.XA priority Critical patent/CN109246250A/en
Publication of CN109246250A publication Critical patent/CN109246250A/en
Withdrawn legal-status Critical Current

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
    • 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/1031Controlling of the operation of servers by a load balancer, e.g. adding or removing servers that serve requests
    • 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/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The method for adjusting dummy node quantity according to the change of number of servers, comprising: step 1: it obtains in big data network, the quantity n of the server of initial setting up;Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;Preferably, lowest service device quantity therein is equal to any one integer in 5-9.

Description

The method for adjusting dummy node quantity according to the change of number of servers
Technical field
The invention belongs to the load balancing fields of big data.
Background technique
Consistency hash algorithm (Consistent Hashing Algorithm) is a kind of distributed algorithm, is usually used in bearing It carries balanced.Memcached client also selects this algorithm, solves key-value being evenly distributed to numerous Memcached Problem on server.It can replace traditional modulo operation, and additions and deletions Memcached can not be coped with by solving modulo operation The problem of Server, (additions and deletions server will lead to the same key, and in get operation, distribution is really stored less than data Server, hit rate can sharply decline).
But in the prior art, when the cryptographic Hash of the hash algorithm of initial setting up consistency Hash, uses regular length and breathe out The method of uncommon value.
Such method has certain value at the initial stage that big data develops, because of the method for fixed setting, convenient for subsequent Processing, all processing modes all can be carried out corresponding setting as long as keeping a close watch on the fixed value.But there is also many for fixed setting Limitation.If maximum problem is that the length of cryptographic Hash is too long, overhead will increase, and if too short, it will lead to It can not will be on server equiblibrium mass distribution all hash space ring.
Therefore, it is badly in need of a kind of new method, the method that cryptographic Hash length can be adjusted according to number of servers dynamic.
Summary of the invention
The method for adjusting dummy node quantity according to the change of number of servers, comprising:
Step 1: obtaining in big data network, the quantity n of the server of initial setting up;
Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;It is excellent Choosing, lowest service device quantity therein is equal to any one integer in 5-9;
Step 3: it needs that dummy node is arranged for server, m dummy node is arranged in each server, and m is greater than 1 integer, Wherein,, N is the pre-set integer of system;Preferably, N therein, any one that can be in 50-75 are whole Number;
Step 4: if n < 75, setting 16 for cryptographic Hash length K, otherwise K=16+;
Step 5: the value space of hash function be 0-() hash space ring on, server or server are set Dummy node;
Step 6: monitoring whether to have increased server newly, step 6 is repeated if not monitored newly-increased server, otherwise Execute step 7;
Step 7: judging that on hash space ring be server or dummy node, if it is server then directly in hash space Newly-increased server addition is got on ring, if it is dummy node, then any one dummy node of random erasure, then at this The newly-increased server is arranged on position;And repeat step 6.
The method for adjusting dummy node quantity according to the change of number of servers, comprising:
Step 1: obtaining in big data network, the quantity n of the server of initial setting up;
Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;It is excellent Choosing, lowest service device quantity therein is equal to 10;
Step 3: it needs that dummy node is arranged for server, m dummy node is arranged in each server, and m is greater than 1 integer, Wherein,, N is the pre-set integer of system;Preferably, N therein, any one that can be in 50-75 are whole Number;
Step 4: if n < 75, setting 16 for cryptographic Hash length K, otherwise K=16+
Step 5: the value space of hash function be 0-() hash space ring on, server or server are set Dummy node;
Step 6: monitoring whether to have increased server newly, step 6 is repeated if not monitored newly-increased server, otherwise Execute step 7;
Step 7: judging that on hash space ring be server or dummy node, if it is server then directly in hash space Newly-increased server addition is got on ring, if it is dummy node, then any one dummy node of random erasure, then at this The newly-increased server is arranged on position;And repeat step 6.
It is an advantage of the invention that cryptographic Hash length is arranged, according to the quantity of server or dummy node so as to dynamic Adjust cryptographic Hash length, it is too long or too short to avoid cryptographic Hash length, and can service carry out during, according to server Increase adjust dummy node so that total node is in the reasonable range.
Detailed description of the invention
Fig. 1 is schematic diagram 1 according to an embodiment of the present invention;
Fig. 2 is schematic diagram 2 according to an embodiment of the present invention;
Fig. 3 is schematic diagram 3 according to an embodiment of the present invention;
Fig. 4 is schematic diagram 4 according to an embodiment of the present invention.
Specific embodiment
Consistency Hash principle
In simple terms, entire hash-value space is organized into a virtual annulus by consistency Hash, such as assumes certain hash function H Value space be 0-() (i.e. cryptographic Hash is one K without symbol shaping).It is illustrated below with K=32.
Entire hash space ring is as shown in Figure 1, entire space is organized in the direction of the clock.0 and () in zero point Direction is overlapped.
Each server is subjected to a Hash using H in next step, specifically can choose the ip or host masterpiece of server Hash is carried out for keyword, every machine so just can determine that its position on hash space ring, it is assumed here that will above Three servers use as shown in Figure 2 in the position of annular space after ip Address-Hash.
Next respective server is accessed using following algorithm location data: data key is counted using identical function H Cryptographic Hash h is calculated, logical to determine position of this data on ring according to h, " walking " clockwise along ring from this position, First encounters Server be exactly server that it should be navigated to.
Such as we have tetra- data objects of A, B, C, D, position such as Fig. 3 institute after Hash calculation, on annular space Show: according to consistency hash algorithm, data A can be decided to be on Server 1, and D is decided to be on Server 3, and B, C distinguish It is decided to be on Server 2.
Dummy node principle
In order to solve the problems, such as that this data skew, consistency hash algorithm introduce dummy node mechanism, i.e., to each service Node calculates multiple Hash, this service node, referred to as dummy node are placed in each calculated result position.Specific practice can It is realized with increasing number behind server ip or host name.Such as situation above, we are determined as every server Three dummy nodes are calculated, " Memcached Server 1#1 ", " Memcached Server 1# can be then calculated separately 2”、“Memcached Server 1#3”、“Memcached Server 2#1”、“Memcached Server 2#2”、 The cryptographic Hash of " Memcached Server 2#3 " then forms six dummy nodes, as shown in Figure 4.
Embodiment 1
The setting of cryptographic Hash length will follow following several principles:
Principle 1: excessively long cryptographic Hash can bring two harm, and one is that the calculation amount of Hash calculation can become larger, and increase and be It unites expense, the other is being easy to lead to follow-up storage data so that server is unevenly distributed weighing apparatus on entire hash space ring It is unbalanced.Therefore, cryptographic Hash cannot be too long.
Principle 2: if cryptographic Hash is too short, since in present big data system, the quantity of server is continuous Increase, it is not enough that too short cryptographic Hash will lead to hash space ring.When not enough, need to recalculate whole network data Kazakhstan It is uncommon, and storage is rearranged, this is unacceptable.
Principle 3: if number of servers is very little, can have data skew, need that dummy node is arranged, but if clothes Device quantity of being engaged in is enough, then there is no data skew problems.
In 4: one big data systems of principle, the quantity of the server of initial setting up is generally possible to embody this big data The scale of construction of project, even if having increasing for server during subsequent running, but generally or identical in initial number Number of levels on.
Principle 5: when number of servers increases, the sum of newly-increased server and initial dummy node is controlled, otherwise Quantity is too many, and the probability that will lead to cryptographic Hash conflict rises, and needs constantly to modify server name to avoid cryptographic Hash conflict, this Sample will lead to the decline of system effectiveness.
The method for adjusting dummy node quantity according to the change of number of servers, comprising:
Step 1: obtaining in big data network, the quantity n of the server of initial setting up;
Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;It is excellent Choosing, lowest service device quantity therein is equal to any one integer in 5-9;
Step 3: it needs that dummy node is arranged for server, m dummy node is arranged in each server, and m is greater than 1 integer, Wherein,, N is the pre-set integer of system;Preferably, N therein, any one that can be in 50-75 are whole Number;
Step 4: if n < 75, setting 16 for cryptographic Hash length K, otherwise K=16+;
Step 5: the value space of hash function be 0-() hash space ring on, server or server are set Dummy node;
Step 6: monitoring whether to have increased server newly, step 6 is repeated if not monitored newly-increased server, otherwise Execute step 7;
Step 7: judging that on hash space ring be server or dummy node, if it is server then directly in hash space Newly-increased server addition is got on ring, if it is dummy node, then any one dummy node of random erasure, then at this The newly-increased server is arranged on position;And repeat step 6.
Embodiment 2
The method for adjusting dummy node quantity according to the change of number of servers, comprising:
Step 1: obtaining in big data network, the quantity n of the server of initial setting up;
Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;It is excellent Choosing, lowest service device quantity therein is equal to 10;
Step 3: it needs that dummy node is arranged for server, m dummy node is arranged in each server, and m is greater than 1 integer, Wherein,, N is the pre-set integer of system;Preferably, N therein, any one that can be in 50-75 are whole Number;
Step 4: if n < 75, setting 16 for cryptographic Hash length K, otherwise K=16+
Step 5: the value space of hash function be 0-() hash space ring on, server or server are set Dummy node;
Step 6: monitoring whether to have increased server newly, step 6 is repeated if not monitored newly-increased server, otherwise Execute step 7;
Step 7: judging that on hash space ring be server or dummy node, if it is server then directly in hash space Newly-increased server addition is got on ring, if it is dummy node, then any one dummy node of random erasure, then at this The newly-increased server is arranged on position;And repeat step 6.

Claims (4)

1. the method for adjusting dummy node quantity according to the change of number of servers, comprising:
Step 1: obtaining in big data network, the quantity n of the server of initial setting up;
Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;It is excellent Choosing, lowest service device quantity therein is equal to any one integer in 5-9;
Step 3: it needs that dummy node is arranged for server, m dummy node is arranged in each server, and m is greater than 1 integer, Wherein,, N is the pre-set integer of system;Preferably, N therein, any one that can be in 50-75 are whole Number;
Step 4: if n < 75, setting 16 for cryptographic Hash length K, otherwise K=16+;
Step 5: the value space of hash function be 0-() hash space ring on, server or server are set Dummy node;
Step 6: monitoring whether to have increased server newly, step 6 is repeated if not monitored newly-increased server, otherwise Execute step 7;
Step 7: judging that on hash space ring be server or dummy node, if it is server then directly in hash space Newly-increased server addition is got on ring, if it is dummy node, then any one dummy node of random erasure, then at this The newly-increased server is arranged on position;And repeat step 6.
2. the method for adjusting dummy node quantity according to the change of number of servers, comprising:
Step 1: obtaining in big data network, the quantity n of the server of initial setting up;
Step 2: judging whether n is less than lowest service device quantity, if it is less, executing step 3, otherwise, execute step 4;It is excellent Choosing, lowest service device quantity therein is equal to 10;
Step 3: it needs that dummy node is arranged for server, m dummy node is arranged in each server, and m is greater than 1 integer, Wherein,, N is the pre-set integer of system;Preferably, N therein, any one that can be in 50-75 are whole Number;
Step 4: if n < 75, setting 16 for cryptographic Hash length K, otherwise K=16+
Step 5: the value space of hash function be 0-() hash space ring on, server or server are set Dummy node;
Step 6: monitoring whether to have increased server newly, step 6 is repeated if not monitored newly-increased server, otherwise Execute step 7;
Step 7: judging that on hash space ring be server or dummy node, if it is server then directly in hash space Newly-increased server addition is got on ring, if it is dummy node, then any one dummy node of random erasure, then at this The newly-increased server is arranged on position;And repeat step 6.
3. a kind of computer program, for executing any one method in method 1-2.
4. the system for adjusting dummy node quantity according to the change of number of servers, comprising: central processing unit, memory, institute State includes computer program, the computer program, for executing any one method in method 1-2 on memory.
CN201811327654.XA 2018-11-08 2018-11-08 The method for adjusting dummy node quantity according to the change of number of servers Withdrawn CN109246250A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811327654.XA CN109246250A (en) 2018-11-08 2018-11-08 The method for adjusting dummy node quantity according to the change of number of servers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811327654.XA CN109246250A (en) 2018-11-08 2018-11-08 The method for adjusting dummy node quantity according to the change of number of servers

Publications (1)

Publication Number Publication Date
CN109246250A true CN109246250A (en) 2019-01-18

Family

ID=65077448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811327654.XA Withdrawn CN109246250A (en) 2018-11-08 2018-11-08 The method for adjusting dummy node quantity according to the change of number of servers

Country Status (1)

Country Link
CN (1) CN109246250A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113112193A (en) * 2020-01-13 2021-07-13 北京京东振世信息技术有限公司 Method, apparatus, server and medium for determining package location

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677736A (en) * 2015-12-29 2016-06-15 曙光信息产业(北京)有限公司 Method and apparatus for increasing and deleting server nodes
CN105721532A (en) * 2014-12-26 2016-06-29 乐视网信息技术(北京)股份有限公司 Node management method and device
CN106789175A (en) * 2016-11-30 2017-05-31 武汉长江通信智联技术有限公司 It is a kind of that redis methods extending transversely are carried out based on uniformity hash algorithm
CN107197035A (en) * 2017-06-21 2017-09-22 中国民航大学 A kind of compatibility dynamic load balancing method based on uniformity hash algorithm
CN108124012A (en) * 2017-12-21 2018-06-05 中通服公众信息产业股份有限公司 A kind of distributed caching computational methods based on hash algorithm
CN108551474A (en) * 2018-03-26 2018-09-18 南京邮电大学 A kind of load-balancing method of server cluster
CN108600321A (en) * 2018-03-26 2018-09-28 中国科学院计算技术研究所 A kind of diagram data storage method and system based on distributed memory cloud

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105721532A (en) * 2014-12-26 2016-06-29 乐视网信息技术(北京)股份有限公司 Node management method and device
CN105677736A (en) * 2015-12-29 2016-06-15 曙光信息产业(北京)有限公司 Method and apparatus for increasing and deleting server nodes
CN106789175A (en) * 2016-11-30 2017-05-31 武汉长江通信智联技术有限公司 It is a kind of that redis methods extending transversely are carried out based on uniformity hash algorithm
CN107197035A (en) * 2017-06-21 2017-09-22 中国民航大学 A kind of compatibility dynamic load balancing method based on uniformity hash algorithm
CN108124012A (en) * 2017-12-21 2018-06-05 中通服公众信息产业股份有限公司 A kind of distributed caching computational methods based on hash algorithm
CN108551474A (en) * 2018-03-26 2018-09-18 南京邮电大学 A kind of load-balancing method of server cluster
CN108600321A (en) * 2018-03-26 2018-09-28 中国科学院计算技术研究所 A kind of diagram data storage method and system based on distributed memory cloud

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHENG ZHIYUN等: "Consistent Hash Based Flexible Redundant Data Partition Strategy", 《2017 FIFTH INTERNATIONAL CONFERENCE ON ADVANCED CLOUD AND BIG DATA》 *
裴沛等: "一种改进的分布式存储系统节点动态扩展策略", 《广西民族大学学报(自然科学版)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113112193A (en) * 2020-01-13 2021-07-13 北京京东振世信息技术有限公司 Method, apparatus, server and medium for determining package location
CN113112193B (en) * 2020-01-13 2024-05-24 北京京东振世信息技术有限公司 Method, apparatus, server and medium for determining package location

Similar Documents

Publication Publication Date Title
US20200167366A1 (en) Data processing method and device
Zhou et al. Cold filter: A meta-framework for faster and more accurate stream processing
CN110489059B (en) Data cluster storage method and device and computer equipment
JP6716727B2 (en) Streaming data distributed processing method and apparatus
US9210219B2 (en) Systems and methods for consistent hashing using multiple hash rings
Xie et al. Pandas: robust locality-aware scheduling with stochastic delay optimality
CN104298541A (en) Data distribution algorithm and data distribution device for cloud storage system
CN105279258B (en) File storage method and system with balanced distribution
CN109191287A (en) A kind of sharding method, device and the electronic equipment of block chain intelligence contract
CN106775470B (en) Data storage method and system
CN111597054B (en) Information processing method, system, electronic equipment and storage medium
CN109800236A (en) Support the distributed caching method and equipment of multinode
KR101708236B1 (en) Local processing apparatus and method for transmitting/receiving data thereof
CN113596094A (en) Load balancing method and device based on cloud cluster
CN109246250A (en) The method for adjusting dummy node quantity according to the change of number of servers
WO2014139424A1 (en) System and method for adaptive vector size selection for vectorized query execution
US9684668B1 (en) Systems and methods for performing lookups on distributed deduplicated data systems
CN104219163B (en) The load-balancing method that a kind of node based on dynamic copies method and dummy node method dynamically moves forward
US10387578B1 (en) Utilization limiting for nested object queries
KR102142767B1 (en) Method and system for dara clustering using relative distance rate and distance between cluster&#39;s medoids
US8595239B1 (en) Minimally disruptive hash table
US10122789B1 (en) Log information transmission integrity
Huang et al. Optimizing data partition for scaling out NoSQL cluster
CN108833156A (en) A kind of appraisal procedure and system of the simulation performance index for power telecom network
CN104468823B (en) A kind of cluster load balance dispatching method and system

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20190118