CN109032854A - Elect request processing method, device, management node and storage medium - Google Patents
Elect request processing method, device, management node and storage medium Download PDFInfo
- Publication number
- CN109032854A CN109032854A CN201810770164.0A CN201810770164A CN109032854A CN 109032854 A CN109032854 A CN 109032854A CN 201810770164 A CN201810770164 A CN 201810770164A CN 109032854 A CN109032854 A CN 109032854A
- Authority
- CN
- China
- Prior art keywords
- election
- management node
- time
- abnormal restoring
- management
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/2053—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
- G06F11/2089—Redundant storage control functionality
- G06F11/2092—Techniques of failing over between control units
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to technical field of distributed memory; a kind of election request processing method, device, management node and storage medium are provided, which comprises receive the management node record for the abnormal restoring that the management node of abnormal restoring is sent election version number and the last election time;When electing version number to be greater than local version, judge whether to ignore election request according to present system time and the last election time;When the difference of the last election time and present system time are less than or equal to preset threshold, then ignore election request;When the difference of the last election time and present system time are greater than preset threshold, then receive election request to start to elect.The present invention realizes shielding, isolating problem management node reduces the election frequency of management cluster, to guarantee that business can normally be provided by managing cluster, and then improves the reliability of entire distributed memory system by conditionally ignoring to election request.
Description
Technical field
The present invention relates to technical field of distributed memory, in particular to a kind of election request processing method, device,
Management node and storage medium.
Background technique
In distributed memory system, status information of the management node to safeguard distributed memory system, client is read
Before writing the data stored in distributed memory system, it is necessary to first pass through the state letter that management node obtains distributed memory system
Breath, then just can be carried out normal read-write operation, and therefore, the reliability of management node is for distributed memory system to pass
It is important, in order to avoid Single Point of Faliure, the reliability of management node is improved, and then improve the reliability of distributed memory system, point
Multiple management nodes are usually formed into a management cluster in cloth storage system, manage the angle of each management node in cluster
Color is determined by electing.In the prior art, when the state of the management node in management cluster changes or manage cluster
In management node have increase or delete when will trigger a new round election, since in entire election process, distribution is deposited
Storage system can not externally provide service, lead if the network state of one of management node in management cluster is unstable
It causes management node abnormal, management cluster will be caused and frequently elected, will affect normal business continuance under serious conditions, and then drop
The reliability of low entire distributed memory system.
Summary of the invention
Be designed to provide a kind of election request processing method, device, management node and the storage of the embodiment of the present invention are situated between
Matter, in the case where there is exception in single management node, by conditionally ignoring to election request, realization shielding, every
From issue management node, the election frequency of management cluster is reduced, to guarantee that business, Jin Erti can normally be provided by managing cluster
The reliability of high entire distributed memory system.
To achieve the goals above, technical solution used in the embodiment of the present invention is as follows:
In a first aspect, being applied to distributed memory system the embodiment of the invention provides a kind of election request processing method
In management cluster management node, the management node is stored with local version number, the management cluster further include with it is described
The management node of the abnormal restoring of management node communication, which comprises receive the choosing that the management node of abnormal restoring is sent
Lift request, wherein the management of the management node including abnormal restoring records in election request election version number and abnormal restoring
The last election time of nodes records;When the election version number that the management node of abnormal restoring records is greater than local version number
When, the last election time according to the management node of present system time and abnormal restoring record judges whether to ignore election
Request;When the difference of the last election time and present system time that the management node of abnormal restoring records are less than or equal in advance
If when threshold value, then ignoring election request;Time and current system are elected when the last time that the management node of abnormal restoring records
When the difference of time is greater than preset threshold, then receive election request to start to elect.
Second aspect, the embodiment of the invention also provides a kind of elections to request processing unit, is applied to distributed storage system
The management node of management cluster in system, the management node are stored with local version number, and the management cluster further includes and manages
Manage the management node of the abnormal restoring of node communication, described device includes receiving module, judgment module, first ignores module and the
One election module.Wherein, the election request that the management node that receiving module is used to receive abnormal restoring is sent, wherein election is asked
The last time of the management node record for the election version number and abnormal restoring that management node in asking including abnormal restoring records
Elect the time;Judgment module is used for when the election version number that the management node of abnormal restoring records is greater than local version, according to
Judge whether to ignore election request according to the last election time of the management node of present system time and abnormal restoring record;
First ignores module, the difference for the last election time and present system time that the management node when abnormal restoring records
When less than or equal to preset threshold, then ignore election request;First election module, records for the management node when abnormal restoring
The last election time and the difference of present system time when being greater than preset threshold, then receive election and request to start to elect.
The third aspect, the embodiment of the invention also provides a kind of management node, the management node includes: one or more
Processor;Memory, for storing one or more programs, when one or more of programs are by one or more of processing
When device executes, so that one or more of processors realize above-mentioned election request processing method.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer
Program, the computer program realize above-mentioned election request processing method when being executed by processor.
Compared with the prior art, it a kind of election request processing method provided in an embodiment of the present invention, device, management node and deposits
Storage media, firstly, the management node of abnormal restoring sends election request to management node, wherein including abnormal extensive in election request
The last election time of the management node record of the election version number and abnormal restoring of multiple management node record;Then,
Management node receives election request, and when the election version number that the management node of abnormal restoring records is greater than local version number
When, the last election time according to the management node of present system time and abnormal restoring record judges whether to ignore election
Request;When the difference of the last election time and present system time that the management node of abnormal restoring records are less than or equal in advance
If when threshold value, then ignoring election request;Time and current system are elected when the last time that the management node of abnormal restoring records
When the difference of time is greater than preset threshold, then receive election request to start to elect.Compared with prior art, the embodiment of the present invention is logical
It crosses and election request is conditionally ignored, realize shielding, isolating problem management node reduces the election frequency of management cluster
Rate reduces the influence elected to regular traffic to the greatest extent, to guarantee that business can normally be provided by managing cluster, and then improves entire
The reliability of distributed memory system.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, special embodiment below, and appended by cooperation
Attached drawing is described in detail below.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair
The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this
A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows the application scenarios schematic diagram of election request processing method provided in an embodiment of the present invention.
Fig. 2 shows the block diagrams of management node provided in an embodiment of the present invention.
Fig. 3 shows the first pass figure of election request processing method provided in an embodiment of the present invention.
Fig. 4 shows the second flow chart of election request processing method provided in an embodiment of the present invention.
Fig. 5 shows the block diagram of election request processing unit provided in an embodiment of the present invention.
Icon: 100- management node;101- memory;102- communication interface;103- processor;104- bus;200- choosing
Lift request processing unit;201- receiving module;202- judgment module;203- first ignores module;204- first elects module;
205- obtains module;206- second ignores module;207- second elects module;208- update module.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete
Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist
The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause
This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below
Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention
In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Fig. 1 is please referred to, Fig. 1 shows the application scenarios signal of election request processing method provided in an embodiment of the present invention
Figure, distributed memory system include the management node group of client, the storage cluster of multiple memory nodes composition and multiple communications
At management cluster, client, storage cluster, management cluster be in communication with each other, memory node be responsible for store user data, management
Node is for safeguarding relevant topology information and status information in storage cluster and management cluster distributed storage system.
User issues reading and writing data request by client, and client gets the status information of memory node from management cluster, so
It is calculated afterwards according to the status information, obtains the storage location information of read-write data, correspondence is found according to storage location information
Memory node, read and write the data stored on the memory node.When storage cluster is newly added in memory node or find itself or
The status information of memory node is reported when other memory node exceptions of person to management cluster, management cluster is reported according to memory node
Status information recorded and updated, and by updated diffusion of information to storage cluster and client.In Fig. 1, management collection
Group includes 3 management nodes: management node 1, management node 2 and management node 3, the management node of abnormal restoring can be management
Any one of cluster management node, the management node other than the management node of abnormal restoring can be normal management section
Point 100 sends election request, management node 2 and pipe to management node 2 and management node 3 after 1 abnormal restoring of management node
Manage node 3 according to election request and local version number determine using it is corresponding strategy handle the election request.
Referring to figure 2., Fig. 2 shows the block diagrams of management node 100 provided in an embodiment of the present invention.In the present invention
In embodiment, management node 100 criticizes normal management node, i.e., normal in addition to the management node of abnormal restoring in management cluster
Management node 100, management node 100 may be, but not limited to, PC (personal computer, PC), server etc.
Deng.The operating system of management node 100 may be, but not limited to, Windows system, linux system etc..The management node
100 include memory 101, communication interface 102, processor 103 and bus 104, the memory 101, communication interface 102 and place
Reason device 103 is connected by bus 104, and processor 103 is used to execute the executable module stored in memory 101, such as calculates
Machine program.
Wherein, memory 101 may include high-speed random access memory (RAM:Random Access Memory),
It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.By extremely
A few communication interface 102 (can be wired or wireless) realizes the management node 100 and at least one other management node
Communication connection between 100 and External memory equipment.
Bus 104 can be isa bus, pci bus or eisa bus etc..It is only indicated with a four-headed arrow in Fig. 2, but
It is not offered as only a bus or a type of bus.
Wherein, memory 101 is for storing program, such as election shown in fig. 5 request processing unit 200.The election is asked
Seeking processing unit 200 includes that at least one can be stored in the memory 101 in the form of software or firmware (firmware)
Or it is solidificated in the software function module in the operating system (operating system, OS) of the server host 100.It is described
Processor 103 executes described program after receiving and executing instruction to realize election request that the above embodiment of the present invention discloses
Processing method.
Processor 103 may be a kind of IC chip, the processing capacity with signal.It is above-mentioned during realization
Each step of method can be completed by the integrated logic circuit of the hardware in processor 103 or the instruction of software form.On
The processor 103 stated can be general processor, including central processing unit (Central Processing Unit, abbreviation
CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (DSP), dedicated
Integrated circuit (ASIC), ready-made programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor
Logical device, discrete hardware components.
First embodiment
Referring to figure 3. and Fig. 4, Fig. 3 show election request processing method first pass figure provided in an embodiment of the present invention,
Fig. 4 shows election request processing method second flow chart provided in an embodiment of the present invention.Election request processing method is applied to
In distributed memory system management cluster management node 100, election request processing method the following steps are included:
Step S101 receives the election request that the management node of abnormal restoring is sent, wherein includes abnormal in election request
The last election time of the management node record of the election version number and abnormal restoring of the management node record of recovery.
In embodiments of the present invention, management node refers to that management node can no longer propose client or storage cluster extremely
For the inquiry, update or maintenance function of safe and effective status information or topology information.The exception can be but
Be not limited to management node is caused by abnormal power-down, and the process run in management node goes wrong and causes, management node communication
Module, which goes wrong, leads to network flash etc..
In embodiments of the present invention, there are two types of the roles for managing the management node in cluster: main management node and spare pipe
Node is managed, the data in main management node and spare management node are consistent by specific algorithm, when client needs obtain
When taking status information relevant to read command, main management node and spare management node can return to corresponding shape to client
State information, when client needs to update status information relevant to write order, update message issues main management node first, so
Spare management node is distributed to by main management node afterwards.Main management node and spare management node are that management cluster passes through voting machine
System determination.
It should be noted that safeguarding relevant topology in distributed memory system in different distributed memory systems
Structural information and status information are essential, but specific title can be different, for example, in one embodiment, point
Cloth storage system can be Ceph system (distributed memory system of an open source), and management node cluster can be
Monitor cluster.For an alternative embodiment, distributed memory system can be a kind of FusionStorage system (distribution
Storage system), management node cluster can be metadata set group.In the similar different management clusters of realization mechanism, for
Management node, main management node, the title of spare management node can be different, in embodiments of the present invention, with Ceph distribution
It is illustrated for storage system.In Ceph distributed memory system, management node is known as monitor node, main management section
Point is known as leader, and spare management node is known as peon, passes through paxos between all monitor nodes in monitor cluster
Algorithm guarantees the consistency of data, and determines that respective role is leader or peon, monitor collection by election mechanism
Group can determine a priority in deployment for each monitor node, and the monitor of highest priority can be at by election
For leader.Version number is known as epoch in Ceph, and epoch takes on very important role in election process, there is following two
The effect of a aspect:
(1) logical time is represented, under normal circumstances, the epoch value for externally providing each monitor node of normal service is answered
This be it is equal, after one of monitor node exception, the epoch value of abnormal monitor node is saved in data
In library, after exception monitor restores again, the epoch value of the monitor of the abnormal restoring is more normal than other
Monitor node it is small, therefore, can be judged by the value of epoch it is corresponding election request whether be the latest round of election;
(2) for judging whether monitor node is currently in election state, when epoch is odd number, illustrate this
Monitor node is in election state, and after election, epoch value can be incremented by even number and be synchronized to all normal
Monitor node.
In embodiments of the present invention, each monitor node saves a local version number, under normal circumstances, each
After wheel election, the local version number of all normal monitor in monitor cluster is all the same, if one of them
Monitor is abnormal, and before the monitor abnormal restoring, in monitor cluster except exception monitor it
Other outer monitor complete the election of a new round, at this point, the local version number of exception monitor just and other
The local version number of monitor is inconsistent, for example, having 3 monitor nodes: monitor node in current monitor cluster
1, the local version number of monitor node 2, monitor node 3 and this 3 monitor nodes is 2, at this point, monitor
Node 1 is abnormal, and monitor node 2, monitor node 3 have carried out a wheel election, monitor node 2 after the completion of election,
It is 2 that the local version number of monitor node 3, which becomes the local version number after 4, monitor node, 1 abnormal restoring,.When different
When the monitor node often restored initiates election request, local version number plus 1 are obtained into election version number first, it then will choosing
It lifts version number and is sent to other monitor nodes to initiate election request, for example, the local of the monitor node of abnormal restoring
Version number is 2, then is first that 2 plus 1 are selected by local version number when the monitor node of the abnormal restoring initiates election request
Version number is lifted, at this point, election version number is 3.
Step S102, when the election version number that the management node of abnormal restoring records is greater than local version, foundation is worked as
The last election time of the management node of preceding system time and abnormal restoring record judges whether to ignore election request.
In embodiments of the present invention, after the election request that the management node that management node 100 receives abnormal restoring is sent, from
The election version number of the management node record of abnormal restoring and the management node record of abnormal restoring are got in election request
The last election time, the election version number that the management node of abnormal restoring records is compared with local version number first
Compared with when the election version number that the management node of the abnormal restoring records is greater than the local version, it is meant that abnormal extensive
Multiple management node takes part in nearest wheel election, that is to say, that before abnormal management node is restored, manages and removes in cluster
Management node 100 except the exception management node not yet carried out election.Management node 100 is obtained from election request first
The last election time that the management node of abnormal restoring records is taken, then according to present system time and the abnormal restoring
The last election time of management node record judge whether to ignore election request, when the management node of abnormal restoring records
The last election time and the difference of present system time when being less than or equal to preset threshold, then ignore the election and request,
Step S103 is executed, when the difference of the last election time and present system time that the management node of abnormal restoring records are big
When preset threshold, then receives election request to start election and execute step S104.
It will do it time synchronization between multiple management nodes in cluster it should be noted that managing, i.e., multiple management sections
The system time of point is consistent substantially, therefore, when participating in the current system of the acquisition of multiple management nodes 100 of same wheel election
Between be not much different, therefore, multiple management nodes 100 judge whether to ignore according to present system time and the last election time
The judging result of election request is also consistent.
Step S103, when the difference for the last election time and present system time that the management node of abnormal restoring records
When less than or equal to preset threshold, then ignore election request.
In embodiments of the present invention, preset threshold can be preset according to specific application scenarios, for example, default
Threshold value is 20s, and election time the last time is 10:00:00, present system time 10:00:15, then when the last election
Between and present system time difference be 15s, be less than preset threshold 20s, then ignore this election request.
Step S104, when the difference for the last election time and present system time that the management node of abnormal restoring records
When greater than preset threshold, then receive election request to start to elect.
In embodiments of the present invention, preset threshold can be preset according to specific application scenarios, for example, default
Threshold value is 20s, and election time the last time is 10:00:00, present system time 10:00:25, then when the last election
Between and present system time difference be 25s, be greater than preset threshold 20s, then receive this election request.
In embodiments of the present invention, the election version number of the management node record of abnormal restoring might be less that local version
Number when, therefore, after executing the step S101, when abnormal restoring management node record election version number be less than local version
Number when, execute step S105-S107.
Step S105, when the election version number that the management node of abnormal restoring records is less than local version, acquisition is worked as
The number and management node total number of preceding system time, the current management node that service is provided.
In embodiments of the present invention, election version number is less than local version number, it is meant that the management node of abnormal restoring is not
Participate in nearest wheel election, that is to say, that before abnormal management node is restored, manage and remove the exception management node in cluster
Except management node 100 carried out at least one wheel election.
In embodiments of the present invention, by taking Ceph distributed memory system as an example, the current management node for providing service is known as
Quorum is that those support leader node to be elected as the monitor node of leader, and leader node is excellent in quorum
The first highest monitor node of grade, for example, there is 5 monitor nodes: monitor node 1, monitor in monitor cluster
Node 2, monitor node 3, monitor node 4 and monitor node 5, the highest priority of monitor node 5,
Monitor node 5 has initiated election request, and monitor node 2, monitor node 3, monitor node 4 receive the choosing
Request is lifted, and has replied and has confirmed message to monitor node 5, at this point, monitor5 is exactly leader, includes in quorum
Monitor node 2, monitor node 3, monitor node 4 and monitor node 5, then it is current that the management node of service is provided
Number be 4.
Management node 100 is getting present system time, the number of the current management node for providing service and management section
Point total number after, first determine whether currently provide service management node number whether be greater than management node total number half and
Less than management node total number, if so, S106 is thened follow the steps, if it is not, thening follow the steps S107.
Step S106, when the number of the current management node for providing service is greater than the half of management node total number and is less than
When management node total number, determine whether to ignore the election request according to present system time and the last election time.
In embodiments of the present invention, the number of the current management node for providing service is greater than the half of management node total number
And it is less than management node total number, it is meant that even if the current management node for providing service is it is also ensured that just without election
Normal function, is normally carried out business, therefore, if the last election time gap present system time be less than or
Person is equal to preset threshold, so that it may temporarily ignore this election request, without electing herein, in case election influences currently herein
Business can reduce the influence elected to current business as a result, by reducing election frequency.
Step S107, when the number of the current management node for providing service is less than or equal to the half of management node total number
Or when being equal to management node total number, receive election request to start to elect.
In embodiments of the present invention, the number of the current management node for providing service is less than or equal to management node total number
Half, it is meant that current management cluster cannot normally provide function, and business can not be also normally carried out, at this point, when abnormal
Recovery nodes initiate election request, and in order to guarantee entirely to manage the reliability of cluster, management node 100 should receive the choosing at once
Request is lifted, is conducted an election, so that management cluster restores as early as possible, provides function, thus business can also be restored as early as possible therewith.Currently
When providing the number of the management node of service equal to management node total number, it is meant that there is new management node to be added to management collection
In group, at this point, in order to be added to new management node as early as possible in management cluster, it should receive election request at once, carry out
Election.
In embodiments of the present invention, after receiving that request is elected to conduct an election, election time the last time should be current
The end time specifically elected, therefore, it is necessary to update the last election time of local record according to local system time, with
Just judged when election next time using the newest the last election time, therefore, present invention implementation further includes step S108,
Step S108 can be executed after step s 104, can also be executed after step S107.
Step S108 updates the last election time of local record after election according to local system time.
In embodiments of the present invention, by taking Ceph distributed memory system as an example, management node 100 can be leader,
It can be peon, either leader or peon, as long as taking part in election, require after the election according to local system
The the last of time update local record of uniting elects the time, since each management node 100 detects the time of election end
There may be difference, therefore the local system time that each management node 100 is got at the end of election can also be different, most
Making each management node 100 be recorded in the local the last election time eventually can also be not quite identical, but when from one section
Between from the point of view of, this have no effect on the embodiment of the present invention realize reduce election frequency effect, for example, there is 3 in monitor cluster
Monitor node: monitor node 1, monitor node 2, monitor node 3, monitor node 1 detect that election terminates
When the local system time that gets be 10:00:01, the local system that monitor node 2 is got at the end of detecting election
Time is 10:00:02, and the local system time that monitor node 3 is got at the end of detecting election is 10:00:01, then
When the last election time that monitor node 1 records is the last election that 10:00:01, monitor node 2 records
Between be the last election time that 10:00:02, monitor node 3 records be 10:00:01.
It should be noted that do not need to update the last election time in the case where ignored situation is requested in election,
It should also be noted that, have the last election time since the management node of abnormal restoring also records, election terminates
When, the management node for participating in the abnormal restoring of election is also required to update the last choosing of local record according to local system time
Lift the time.
In embodiments of the present invention, single management node occur network state it is unstable etc. under abnormal conditions, according to
Management node line duration and the case where can currently providing the management node of service, judge whether to initiate to elect, and have ready conditions
Election is ignored on ground, compared with prior art, has the advantages that
First, it by conditionally ignoring election, can shield, exception management node is isolated, reduce the choosing of management cluster
Frequency is lifted, reduces the influence elected to regular traffic to the greatest extent, and then improve the reliability of entire distributed memory system.
Second, when the number of the current management node for providing service in management cluster is greater than the one of management node sum
Half, i.e., in the case that management cluster normally can provide function, just ignores than more frequently electing request, asked so that ignoring election
Seek the reliability that will not reduce entire management cluster.
Second embodiment
Referring to figure 5., Fig. 5 shows the block diagram of election request processing unit 200 provided in an embodiment of the present invention.
Election request processing unit 200 is applied to management node 100 comprising receiving module 201;Judgment module 202;First ignores mould
Block 203;First election module 204;Obtain module 205;Second ignores module 206;Second election module 207;Update module
208。
Receiving module 201, the election request that the management node for receiving abnormal restoring is sent, wherein in election request
The last election of the management node record of the election version number and abnormal restoring of management node record including abnormal restoring
Time.
In embodiments of the present invention, receiving module 201 is for executing step S101.
Judgment module 202, when the election version number for recording when the management node of abnormal restoring is greater than local version,
The last election time according to the management node of present system time and abnormal restoring record judges whether that ignoring election asks
It asks.
In embodiments of the present invention, judgment module 202 is for executing step S102.
First ignores module 203, the last election time and current system that the management node for abnormal restoring records
When the difference of system time is less than or equal to preset threshold, then ignore election request.
In embodiments of the present invention, Second processing module 203 is for executing step S103.
First election module 204, the last election time recorded for the management node when abnormal restoring and current
When the difference of system time is greater than preset threshold, then receive election request to start to elect.
In embodiments of the present invention, the first election module 204 is for executing step S104.
Module 205 is obtained, when the election version number for recording when the management node of abnormal restoring is less than local version,
Obtain the number and management node total number of present system time, the current management node that service is provided.
In embodiments of the present invention, module 205 is obtained for executing step S105.
Second ignores module 206, is greater than management node total number for ought currently provide the number of management node of service
Half and when being less than management node total number, nearest one of the management node record according to present system time and abnormal restoring
The secondary election time determines whether to ignore election request.
In embodiments of the present invention, second ignores module 206 for executing step S106.
In embodiments of the present invention, second ignores module 206 and is specifically used for:
When the difference of the last election time and present system time that the management node of abnormal restoring records are less than or wait
When preset threshold, ignore election request;
It is preset when the difference of the last election time and present system time that the management node of abnormal restoring records are greater than
When threshold value, receive election request to start to elect.
Second election module 207 is less than or equal to management node for ought currently provide the number of management node of service
The half of total number or be equal to management node total number when, receive election request to start to elect.
In embodiments of the present invention, the second election module 207 is for executing step S107.
Update module 208, for updating the last choosing of local record according to local system time after election
Lift the time.
In embodiments of the present invention, update module 208 is for executing step S108.
The embodiment of the present invention further discloses a kind of computer readable storage medium, is stored thereon with computer program, described
The election request processing method that present invention discloses is realized when computer program is executed by processor 103.
In conclusion a kind of election request processing method, device, management node and storage medium provided by the invention, institute
State the normal management node for the management cluster that election request processing method is applied in distributed memory system, the normal management
Node is stored with local version number, and the management cluster further includes the management of the abnormal restoring communicated with the normal management node
Node, the election request processing method include: the election request for receiving the management node of abnormal restoring and sending, wherein election
It include election version number in request;When electing version number to be greater than local version, asked according to the processing election of the first processing strategie
It asks;When electing version number to be less than local version, according to the processing election request of second processing strategy.Compared with prior art,
The present invention realizes shielding, isolating problem management node reduces management cluster by conditionally ignoring to election request
Frequency is elected, reduces the influence elected to regular traffic to the greatest extent, to guarantee that business, Jin Erti can normally be provided by managing cluster
The reliability of high entire distributed memory system.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through
Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing
Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product,
Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code
Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held
Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement
The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes
It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart
The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement
It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the present invention can integrate one independent portion of formation together
Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module
It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.It needs
Illustrate, herein, relational terms such as first and second and the like be used merely to by an entity or operation with
Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities
The relationship or sequence on border.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability
Contain, so that the process, method, article or equipment for including a series of elements not only includes those elements, but also including
Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device.
In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element
Process, method, article or equipment in there is also other identical elements.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist
Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing
It is further defined and explained.
Claims (10)
1. a kind of election request processing method, applied to the management node of the management cluster in distributed memory system, the pipe
Reason node is stored with local version number, and the management cluster further includes the management section of the abnormal restoring communicated with the management node
Point, which is characterized in that the described method includes:
Receive the election request that the management node of the abnormal restoring is sent, wherein include the exception in the election request
The last election time of the management node record of the election version number and abnormal restoring of the management node record of recovery;
When the election version number that the management node of the abnormal restoring records is greater than the local version, according to current system
The last election time of the management node of time and abnormal restoring record judges whether to ignore the election request;
When the difference of the last election time and the present system time that the management node of the abnormal restoring records are less than
Or when being equal to preset threshold, then ignore the election request;
When the difference of the last election time and the present system time that the management node of the abnormal restoring records are greater than
When preset threshold, then receive the election request to start to elect.
2. election request processing method as described in claim 1, which is characterized in that the method also includes:
When the election version number that the management node of the abnormal restoring records is less than the local version, current system is obtained
The number and management node total number for the management node that time, current offer service;
When the number of the current management node for providing service is greater than the half of management node total number and always a less than management node
When number, the last election time determination according to the management node of the present system time and abnormal restoring record is
It is no to ignore the election request;
When the number of the current management node for providing service is less than or equal to the half of management node total number or is equal to management
When node total number, receive the election request to start to elect.
3. election request processing method as claimed in claim 2, which is characterized in that it is described according to the present system time and
The last election time of the management node record of the abnormal restoring determines whether the step of ignoring election request, packet
It includes:
When the difference of the last election time and the present system time that the management node of the abnormal restoring records are less than
Or when being equal to preset threshold, ignore the election request;
When the difference of the last election time and the present system time that the management node of the abnormal restoring records are greater than
When preset threshold, receive the election request to start to elect.
4. election request processing method as described in claim 1, which is characterized in that the method also includes:
The last election time of local record is updated according to local system time after election.
5. processing unit is requested in a kind of election, applied to the management node of the management cluster in distributed memory system, the pipe
Reason node is stored with local version number, and the management cluster further includes the management section of the abnormal restoring communicated with the management node
Point, which is characterized in that described device includes:
Receiving module, the election request that the management node for receiving the abnormal restoring is sent, wherein in the election request
The election version number of management node record and the management node of the abnormal restoring including the abnormal restoring record nearest
The single election time;
Judgment module, the election version number recorded for the management node when the abnormal restoring are greater than the local version number
When, the last election time according to the management node of present system time and abnormal restoring record judges whether to ignore
The election request;
First ignores module, the last election time for recording for the management node when the abnormal restoring and described current
When the difference of system time is less than or equal to preset threshold, then ignore the election request;
First election module, the last election time recorded for the management node when the abnormal restoring and described current
When the difference of system time is greater than preset threshold, then receive the election request to start to elect.
6. election request processing unit as claimed in claim 5, which is characterized in that described device further include:
Module is obtained, the election version number recorded for the management node when the abnormal restoring is less than the local version number
When, obtain the number and management node total number of present system time, the current management node that service is provided;
Second ignores module, for ought currently provide service management node number be greater than management node total number half and
When less than management node total number, according to the management node of the present system time and the abnormal restoring record nearest one
The secondary election time determines whether to ignore the election request;
Second election module is less than or equal to management node total number for ought currently provide the number of management node of service
Half or when being equal to management node total number, receives the election and requests to start to elect.
7. election request processing unit as claimed in claim 6, which is characterized in that described second, which ignores module, is specifically used for:
When the difference of the last election time and the present system time that the management node of the abnormal restoring records are less than
Or when being equal to preset threshold, ignore the election request;
When the difference of the last election time and the present system time that the management node of the abnormal restoring records are greater than
When preset threshold, receive the election request to start to elect.
8. election request processing unit as claimed in claim 5, which is characterized in that described device further include:
Update module, for updating the last election time of local record according to local system time after election.
9. a kind of management node, which is characterized in that the management node includes:
One or more processors;
Memory, for storing one or more programs, when one or more of programs are by one or more of processors
When execution, so that one or more of processors realize such as method of any of claims 1-4.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt
Such as method of any of claims 1-4 is realized when processor executes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810770164.0A CN109032854B (en) | 2018-07-13 | 2018-07-13 | Election request processing method and device, management node and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810770164.0A CN109032854B (en) | 2018-07-13 | 2018-07-13 | Election request processing method and device, management node and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109032854A true CN109032854A (en) | 2018-12-18 |
CN109032854B CN109032854B (en) | 2021-10-12 |
Family
ID=64642470
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810770164.0A Active CN109032854B (en) | 2018-07-13 | 2018-07-13 | Election request processing method and device, management node and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109032854B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020134713A1 (en) * | 2018-12-25 | 2020-07-02 | 电信科学技术研究院有限公司 | Network node election method and node device |
CN115378799A (en) * | 2022-10-21 | 2022-11-22 | 北京奥星贝斯科技有限公司 | Election method and device in equipment cluster based on PaxosLease algorithm |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5862348A (en) * | 1996-02-09 | 1999-01-19 | Citrix Systems, Inc. | Method and apparatus for connecting a client node to a server node based on load levels |
CN102929696A (en) * | 2012-09-28 | 2013-02-13 | 北京搜狐新媒体信息技术有限公司 | Method and apparatus for constructing, submitting and monitoring center node of distributed system |
CN105471995A (en) * | 2015-12-14 | 2016-04-06 | 山东省农业机械科学研究院 | High-availability implementation method for large-scale Web server cluster based on SOA |
CN105915391A (en) * | 2016-06-08 | 2016-08-31 | 国电南瑞科技股份有限公司 | Distributed key value storage method possessing self-recovery function based on one-phase submission |
CN107995029A (en) * | 2017-11-28 | 2018-05-04 | 紫光华山信息技术有限公司 | Elect control method and device, electoral machinery and device |
-
2018
- 2018-07-13 CN CN201810770164.0A patent/CN109032854B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5862348A (en) * | 1996-02-09 | 1999-01-19 | Citrix Systems, Inc. | Method and apparatus for connecting a client node to a server node based on load levels |
CN102929696A (en) * | 2012-09-28 | 2013-02-13 | 北京搜狐新媒体信息技术有限公司 | Method and apparatus for constructing, submitting and monitoring center node of distributed system |
CN105471995A (en) * | 2015-12-14 | 2016-04-06 | 山东省农业机械科学研究院 | High-availability implementation method for large-scale Web server cluster based on SOA |
CN105915391A (en) * | 2016-06-08 | 2016-08-31 | 国电南瑞科技股份有限公司 | Distributed key value storage method possessing self-recovery function based on one-phase submission |
CN107995029A (en) * | 2017-11-28 | 2018-05-04 | 紫光华山信息技术有限公司 | Elect control method and device, electoral machinery and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020134713A1 (en) * | 2018-12-25 | 2020-07-02 | 电信科学技术研究院有限公司 | Network node election method and node device |
CN115378799A (en) * | 2022-10-21 | 2022-11-22 | 北京奥星贝斯科技有限公司 | Election method and device in equipment cluster based on PaxosLease algorithm |
CN115378799B (en) * | 2022-10-21 | 2023-02-28 | 北京奥星贝斯科技有限公司 | Election method and device in equipment cluster based on PaxosLease algorithm |
Also Published As
Publication number | Publication date |
---|---|
CN109032854B (en) | 2021-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102265277B (en) | Operation method and device for data memory system | |
CN101719165B (en) | Method for realizing high-efficiency rapid backup of database | |
US20080168218A1 (en) | Backup system with continuous data protection | |
EP2439640A1 (en) | Method and device for deadlock detection of database transaction lock mechanism | |
CN103593266A (en) | ot standby method based on arbitration disk mechanism | |
US20230041089A1 (en) | State management methods, methods for switching between master application server and backup application server, and electronic devices | |
US20150261626A1 (en) | Data restoration method and system | |
US20150007183A1 (en) | Method, Apparatus, and System for Issuing Partition Balancing Subtask | |
CN108153804B (en) | Metadata log updating method for symmetric distributed file system | |
CN112039970B (en) | Distributed business lock service method, server, system and storage medium | |
US9996599B2 (en) | Using access count of the remote site to optimize file transfer order for asynchronous replication | |
US12045137B2 (en) | Data backup method, apparatus, and system | |
CN109032854A (en) | Elect request processing method, device, management node and storage medium | |
WO2018000191A1 (en) | Method and device for data processing | |
US20080281954A1 (en) | Capability requirements for group membership | |
CN108646987B (en) | File volume management method and device, storage medium and terminal | |
EP3570169B1 (en) | Method and system for processing device failure | |
CN108243031A (en) | The implementation method and device of a kind of two-node cluster hot backup | |
US11829334B2 (en) | Per row database resynchronization | |
CN113420082A (en) | Data synchronization anomaly detection method and device | |
US9043274B1 (en) | Updating local database and central database | |
CN106354830B (en) | Method and device for data synchronization between database cluster nodes | |
CN112256201B (en) | Distributed block storage system and volume information management method thereof | |
CN109344011B (en) | Data backup method and device | |
CN113485872A (en) | Fault processing method and device and distributed storage 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |