CN104767794A - Node election method in distributed system and nodes in distributed system - Google Patents

Node election method in distributed system and nodes in distributed system Download PDF

Info

Publication number
CN104767794A
CN104767794A CN201510113095.2A CN201510113095A CN104767794A CN 104767794 A CN104767794 A CN 104767794A CN 201510113095 A CN201510113095 A CN 201510113095A CN 104767794 A CN104767794 A CN 104767794A
Authority
CN
China
Prior art keywords
node
controlling vertex
identification information
target data
database
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
CN201510113095.2A
Other languages
Chinese (zh)
Other versions
CN104767794B (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.)
Juhaokan Technology Co Ltd
Original Assignee
Qingdao Hisense Media Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Media Network Technology Co Ltd filed Critical Qingdao Hisense Media Network Technology Co Ltd
Priority to CN201810124907.7A priority Critical patent/CN108183971B/en
Priority to CN201510113095.2A priority patent/CN104767794B/en
Publication of CN104767794A publication Critical patent/CN104767794A/en
Application granted granted Critical
Publication of CN104767794B publication Critical patent/CN104767794B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a node election method in a distributed system and nodes in the distributed system. The method includes the steps that the nodes, taking part in node election, in the distributed system are in first connection with a database and access target data in the database through the first connection; the node which successfully accesses the target data serves as a control node and executes corresponding operation in the distributed system, wherein the control node is a node elected in the mode that the database adopts the concurrence transaction processing strategy. As the number of the accessing nodes supported by the database is much larger than the number of the nodes in the distributed system, when the nodes, taking part in node election, in the distributed system access the database, the database can also elect the control node, and therefore normal work of the system is guaranteed.

Description

Node electoral machinery in a kind of distributed system and node
Technical field
The present invention relates to distributed technical field, particularly relate to the node electoral machinery in a kind of distributed system and node.
Background technology
The developing direction of distributed computing technology is decentralization, namely can not predefine distributed system (such as cluster) host node or needed the XM of certain task, but the XM (below host node and XM being referred to as Controlling vertex) of dynamically election host node or task.
At present, in distributed system, the election of Controlling vertex can realize by sharing storage mode.
Share storage mode election Controlling vertex refer to, the shared partition in the equal access system of multiple nodes of distributed system, wherein successful access to the node of this shared partition (namely obtaining the file lock of shared partition) as Controlling vertex.After Controlling vertex exits distributed system, its file lock had can discharge, and can initiate the election of a new round after all the other node perceived.
Wherein, the nodes of shared partition support is limited.When needing the number of nodes participating in election to exceed the nodes of shared partition support in distributed system, the nodes that shared partition is supported can be exceeded due to the nodes of accessing shared partition, shared partition is caused normally to work, and then the election of Controlling vertex cannot be completed, distributed system cannot normally work.
Summary of the invention
The object of this invention is to provide the node electoral machinery in a kind of distributed system and node, when carrying out node election to solve with shared storage mode, limited because being limited to the supported nodes of shared partition, and the problem of the distributed system cisco unity malfunction caused.
The object of the invention is to be achieved through the following technical solutions:
A node electoral machinery in distributed system, comprising:
The each node participating in the election of described node in distributed system is all connected with Database first, and described each node is by the target data in database described in described first connected reference;
Successful access as Controlling vertex, performs corresponding operating to the node of described target data in described distributed system;
Wherein, described Controlling vertex is the node that described database employing concurrent transaction processing policy elects.
Wherein, described successful access as Controlling vertex to the node of described target data, performs corresponding operating and at least comprises in described distributed system: described successful access keeps described first to connect to the node of described target data.
Based on above-mentioned any means embodiment, optionally, successful access to the node of described target data as Controlling vertex, in described distributed system, perform corresponding operating also comprise: by being connected with second of described Database, a record is inserted in the Controlling vertex table of described database, described record comprises the identification information of described Controlling vertex and the timestamp of described identification information, and periodically connects the described record of renewal by described second.
Accordingly, the unsuccessful node having access to described target data obtains the identification information of described Controlling vertex from described Controlling vertex table, and connects according to the identification information obtained and described Controlling vertex.
Optionally, the unsuccessful node having access to described target data obtains the identification information of described Controlling vertex from described Controlling vertex table, comprising:
The described unsuccessful node determination current time having access to described target data;
The time that the described unsuccessful node having access to described target data searches timestamp mark at least one times from described Controlling vertex table is later than the identification information of the Controlling vertex of the described current time determined;
The described unsuccessful node acquisition having access to described target data finds, and the identification information of the time Controlling vertex the latest of timestamp mark.
Wherein, described in the described unsuccessful node checks having access to described target data, the number of times of the identification information of Controlling vertex is no more than pre-determined number; Described successful access to described target data node updates described in cycle of recording be determine in time interval of the identification information of Controlling vertex according to the described unsuccessful node checks having access to described target data.
Based on above-mentioned any means embodiment, optionally, the target data in described database is the identification information of described distributed system, or the identification information of task corresponding to node election.
Based on the inventive concept identical with method, the node in a kind of distributed system is also provided, comprises:
Connection establishment unit, for being connected with Database first;
Election unit, for by with the target data in database described in described first connected reference;
First processing unit, after successful access to described target data, performs corresponding operating as Controlling vertex in described distributed system;
Wherein, described Controlling vertex is the node that described database employing concurrent transaction processing policy elects.
Wherein, described first processing unit is used for:
Described first is kept to connect.
Optionally, described connection establishment unit also for: be connected with described Database second.
Accordingly, described first processing unit also for: by described second connect in the Controlling vertex table of described database insert a record, described record comprises the identification information of described Controlling vertex and the timestamp of described identification information, and periodically connects the described record of renewal by described second;
Accordingly, described node also comprises the second processing unit, for: the identification information obtaining described Controlling vertex from described Controlling vertex table, and connect according to the identification information obtained and described Controlling vertex.
Optionally, when obtaining the identification information of described Controlling vertex from described Controlling vertex table, described second processing unit is used for:
Determine current time;
The time of searching timestamp mark at least one times from described Controlling vertex table is later than the identification information of the Controlling vertex of the described current time determined;
Acquisition finds, and the identification information of the time Controlling vertex the latest of timestamp mark.
Wherein, described in the described unsuccessful node checks having access to described target data, the number of times of the identification information of Controlling vertex is no more than pre-determined number; Described successful access to described target data node updates described in cycle of recording be determine in time interval of the identification information of Controlling vertex according to the described unsuccessful node checks having access to described target data
Based on above-mentioned arbitrary node embodiment, optionally, the target data in described database is the identification information of described distributed system, or the identification information of task corresponding to node election.
The technical scheme that the embodiment of the present invention provides, the each node participating in electing in distributed system all accesses the target data in this database, utilize the concurrent transaction disposal ability of database to carry out decision-making, allow one of them node successful access target data, thus elect Controlling vertex.The database of different configuration all can support that the node of more than 10,000 connects, and the nodes of large scale distributed system is usually about 1,000.Because the nodes of database support access is far longer than nodes in distributed system, therefore, during the equal accessing database of the node needing in distributed system to participate in election, database also can elect Controlling vertex, thus ensure that system worked well.
Accompanying drawing explanation
A kind of method flow diagram that Fig. 1 provides for the embodiment of the present invention;
The Controlling vertex process chart that Fig. 2 provides for the embodiment of the present invention;
Fig. 3 for the embodiment of the present invention provide from node processing flow chart;
The node schematic diagram that Fig. 4 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the technical scheme that the embodiment of the present invention provides is described in detail.
As shown in Figure 1, the node electoral machinery in the distributed system that provides of the embodiment of the present invention specifically comprises following operation:
The each node participating in the election of described node in step 100, distributed system is all connected with Database first.
Step 110, above-mentioned each node are by the target data in the above-mentioned database of above-mentioned first connected reference.
Existing database all possesses concurrent transaction disposal ability, the ability that detection and handling dead connect.
Because database has concurrent transaction disposal ability, therefore, when multiple node is all by the first connected reference target data with Database, database can allow one of them this target data of node successful access by decision-making, then the node of this target data of successful access is Controlling vertex.And other nodes can receive the failed feedback of access.
Step 120, successful access as Controlling vertex, perform corresponding operating to the node of above-mentioned target data in a distributed system.
Wherein, successful access is the node that database employing concurrent transaction processing policy elects to the node of above-mentioned target data.
The technical scheme that the embodiment of the present invention provides, the each node participating in electing in distributed system all accesses the target data in this database, utilize the concurrent transaction disposal ability of database to carry out decision-making, allow one of them node successful access target data, thus elect Controlling vertex.The database of different configuration all can support that the node of more than 10,000 connects, and the nodes of large scale distributed system is usually about 1,000.Because the nodes of database support access is far longer than nodes in distributed system, therefore, during the equal accessing database of the node needing in distributed system to participate in election, database also can elect Controlling vertex, thus ensure that system worked well.
In addition, utilize the ability that the detection of database and handling dead connect, after Controlling vertex lost efficacy, the access rights of the Controlling vertex after inefficacy to target data can also be discharged in time, again initiate election to make other nodes.
In the embodiment of the present invention, if the host node of election distributed system, the target data in above-mentioned database can be the identification information of node place distributed system.If elect the XM of certain task, the target data in above-mentioned database can the identification information of task corresponding to node election.
Wherein, multiple different target data can be preserved in a database.Such as, preserve the identification information of different distributions formula system, preserve the identification information of different task.Accordingly, database can support that the host node of multiple distributed system is elected simultaneously, and the XM election of multiple task.
In the embodiment of the present invention, the operation of above-mentioned steps 120 at least comprises: keep above-mentioned first to connect.
In addition, the operation of above-mentioned steps 120 also comprises provides host node service as host node, or performs certain task as XM.
Wherein, providing as host node in the process of host node service or when performing certain task as XM, keeping above-mentioned first to connect, until no longer continue as host node or until tasks carrying completes, then not needing to continue to keep above-mentioned first to connect.
Wherein, the implementation that the Controlling vertex maintenance above-mentioned first elected connects can be specifically: do not submit the affairs in the first connection to, and lasting (regular or irregular) is carried out with database by the first connection alternately.Such as, use first to connect and perform SQL statement, to keep the first connection to enliven, avoid the first connection to disconnect.Wherein, to connect by first and database carries out the mutual time interval and is no more than database and judges that first is connected the cycle (also claiming the time limit) disconnected.
Wherein, the Controlling vertex elected regularly connects by first and database carries out the mutual cycle and is no more than database and judges that first is connected the cycle disconnected.Be preferably less than database and judge that first connects the cycle disconnected.
In the embodiment of the present invention, the Controlling vertex elected can also insert a record by being connected with second of Database in the Controlling vertex table of database, this record comprises the identification information of above-mentioned Controlling vertex and the timestamp of this identification information, and periodically upgrades above-mentioned record by being connected with second of Database.
Wherein, carry out alternately if regularly connected by first with database, so connect by first and carry out the mutual cycle with database, and upgrade the cycle of the above-mentioned record in Controlling vertex table, can be identical, also can be different.
Wherein, the timestamp in above-mentioned record both can be that Controlling vertex generates, and also can be that Controlling vertex trigger data storehouse generates.
Wherein, upgrading above-mentioned record can be the timestamp upgrading identification information.Such as, insert a new record, this record comprises the timestamp after the identification information of above-mentioned Controlling vertex and the renewal of this identification information; Again such as, in above-mentioned record, the timestamp after upgrading is increased; Again such as, the timestamp in above-mentioned record is replaced with the timestamp after renewal.Etc..
Accordingly, the unsuccessful node having access to target data obtains the identification information of above-mentioned Controlling vertex from above-mentioned Controlling vertex table, connects according to the identification information obtained and Controlling vertex.
After connecting with Controlling vertex, the unsuccessful node (now conduct is from node) having access to above-mentioned target will keep heartbeat with Controlling vertex.
Wherein, the unsuccessful node having access to target data obtains the identification information of above-mentioned Controlling vertex from above-mentioned Controlling vertex table, and its implementation can be:
The unsuccessful node determination current time having access to target data;
The time that this unsuccessful node having access to target data searches timestamp mark at least one times from above-mentioned Controlling vertex table is later than the identification information of the Controlling vertex of the above-mentioned current time determined;
This unsuccessful node acquisition having access to target data finds, and the identification information of the time Controlling vertex the latest of timestamp mark.
Wherein, search, are all the identification informations time of searching the mark of timestamp in Controlling vertex table being later than the Controlling vertex of the current time that first time is determined at every turn.
Wherein, the number of times searching the identification information of Controlling vertex is no more than pre-determined number, and this pre-determined number can configure according to actual motion demand.
It should be pointed out that the unsuccessful node having access to target data is except obtaining the identification information of above-mentioned Controlling vertex according to above-mentioned implementation, can also adopt other implementations to obtain the identification information of Controlling vertex.Such as, by intercepting the identification information of the Controlling vertex that Controlling vertex sends.
On this basis, successful access upgrades the cycle of above-mentioned record to the node (i.e. Controlling vertex) of target data, is determine in the unsuccessful time interval having access to the identification information of the above-mentioned Controlling vertex of node checks of target data.
Concrete, successful access upgrades the cycle of above-mentioned record to the node (i.e. Controlling vertex) of target data, is no more than (or being less than) the unsuccessful time interval having access to the identification information of the above-mentioned Controlling vertex of node checks of target data.
Due to once the unsuccessful node checks having access to target data to be later than the identification information of the Controlling vertex of the current time determined to the time that timestamp identifies, corresponding node can be defined as Controlling vertex, and using the identification information of its identification information as Controlling vertex.Therefore, the time finding timestamp mark is later than the time interval of the identification information of the node of the current time determined, namely searches the time interval of the identification information of Controlling vertex.
Wherein, if there is following situation arbitrarily, node need re-start single election flow process.The situation re-starting single election flow process is needed to comprise: the unsuccessful node having access to target data does not get the identification information of above-mentioned Controlling vertex, or the unsuccessful node having access to target data does not have success and above-mentioned Controlling vertex to connect, or unsuccessful have access to target data node and above-mentioned Controlling vertex keep heartbeat failure, or above-mentioned Controlling vertex is connected with first of above-mentioned database and disconnects, or above-mentioned Controlling vertex fails and insert record in the Controlling vertex table in above-mentioned database, or after above-mentioned Controlling vertex success inserts record in the Controlling vertex table in above-mentioned database, fail and upgrade this record.
Based on above-mentioned any means embodiment, node can also mark the state of this node.Accordingly, the embodiment of the present invention defines three kinds of node states, is respectively:
Master state, node, as Controlling vertex, provides Controlling vertex service;
Slave state, node, as from node, provides from node serve;
Unknown state, node does not know the role of this node, does not know the state of distributed system yet, does not externally provide service.
Node is bound to belong to certain state at run duration.
Concrete, after the os starting of node or after re-starting single election flow process, upgrading this node state is Unknown state.Node is after successful access target data, and upgrading this node state is Master state.Node is after connecting with Controlling vertex, and upgrading this node state is Slave state.
Elect host node to be example in cluster in a distributed manner below, the method that the embodiment of the present invention provides is described in detail.
Distributed type assemblies interior joint elects host node by the target data in accessing database.On server outside each node that this database can be deployed in distributed type assemblies, also can be deployed on certain node in distributed type assemblies.
For the method adopting the embodiment of the present invention to provide carries out host node election, node and database have following prerequisite:
1, cluster each node by NTP or other mode retention times synchronous.
2, the network availability between all nodes of cluster to the network and each node of cluster of database (hereinafter referred to as center DB) is consistent.
3, center DB supports the ACID attribute of common RDBMS.
4, center DB possesses the ability of detection and handling dead connection.
5, center DB itself can ensure availability.
In addition, file lock table and Controlling vertex table (in group system, also claiming host node table) is at least comprised in the DB of center.Wherein, file lock table is as shown in table 1, and the data wherein stored are the identification information (being specially the identification information of cluster in the present embodiment) of distributed system.Host node table is as shown in table 2, wherein stores Controlling vertex data, specifically comprises the identification information of cluster, and the timestamp of the identification information of host node corresponding to the identification information of each cluster and the identification information of every bar host node.
Table 1
Table 2
This programme realizes mainly being divided into following two parts:
Part I: election and Master flow process
As shown in Figure 2, handling process is:
Before starting election, all nodes are Unknown state.
All nodes are set up one and are connected C1 to first of database, and pass through the identification information of this cluster in the file lock table of C1 accessing database.Specifically send the statement of similar " identification information of Select*from cluster_lock wherecluster_name=' cluster ' for update ".
As the identification information of this cluster in successful access to file lock table, then illustrate and taken the file lock representing Master, do not submit the affairs on C1 to.Then the timestamp registration Master data of current time are used, namely create second of a Ge Dao center DB in addition and connect C2, use C2 in host node table, insert record corresponding to the identification information of this cluster, this record is the identification information of this node and the timestamp of current time, then submits the affairs on C2 to.
In successful access to file lock table, the Status Change of this node is also Master state by the node of the identification information of this cluster, starts the service externally providing Master.
Master stabs information on backstage by individual threads update time.This renewal comprises 2 step contents:
Use C1 to perform SQL statement, to keep enlivening of C1 to center DB, avoid C1 to break.
Use C2 to insert a record in host node table, node_name uses the identification information of this node, and timestamp uses current time information, submits affairs to.
The time interval of background update need consider that DB judges that Client connects the time limit disconnected, and the retry interval of Slave.(as renewal per second once)
As upgraded failure, then stop Master service.
The identification information of this cluster in the file table that release C1 obtains, namely discharges the target data of locking, and accordingly, center DB utilizes the ability that it detects and handling dead connects to detect that Master is abnormal, and disconnect C1, the affairs that Master does not complete are fallen in rollback.
Enter Master failure handling flow process, be set to Unknown state by this node state, and reenter node election flow process by the identification information of this cluster in access file lock table.
As locked failure, then enter Slave flow process.
Part II: Slave flow process
As shown in Figure 3, handling process is as follows:
Unsuccessful access file enters Slave flow process after locking the identification information of this cluster in table.Obtain the time stamp T 1 of current time.
According to T1, obtain the information of Master:
The identification information of Select*from cluster_master where cluster_name=' cluster ' andtimestamp=(identification information of select max (timestamp) from cluster_master where cluster_name=' cluster ' and timestamp>T1)
Namely timestamp field is obtained larger than T1, and those Master data that timestamp field is maximum.
As failure, retry n time, retry interval gets 1 second, all unsuccessfully, enters Master failure procedures.Consider the time delay of Master lastest imformation, n>5.
As success, then connect Master, confirm the availability of Master.Availability comprises 2 parts: Master node can connect; Show it oneself is Master in the return information of Master node.
As connection failure, retry n time, all unsuccessfully, enters Master failure procedures.
After checking Master, this node state is changed to Slave state, externally provide Slave to serve.
Keep heartbeat with Master, as heartbeat failure, enter Master failure procedures.
Whether Slave needs to keep heartbeat can use to detect Master with Master, needs the role comprising Master, to confirm whether Master can provide service in heartbeat message.
Based on the inventive concept same with method, the embodiment of the present invention also provides the node in a kind of distributed system, as shown in Figure 4, comprising:
Connection establishment unit 401, for being connected with Database first;
Election unit 402, for by with the target data in database described in described first connected reference;
First processing unit 403, after successful access to described target data, performs corresponding operating as Controlling vertex in described distributed system.
Wherein, described Controlling vertex is the node that described database employing concurrent transaction processing policy elects.
The technical scheme that the embodiment of the present invention provides, the each node participating in electing in distributed system all accesses the target data in this database, utilize the concurrent transaction disposal ability of database to carry out decision-making, allow one of them node successful access target data, thus elect Controlling vertex.The database of different configuration all can support that the node of more than 10,000 connects, and the nodes of large scale distributed system is usually about 1,000.Because the nodes of database support access is far longer than nodes in distributed system, therefore, during the equal accessing database of the node needing in distributed system to participate in election, database also can elect Controlling vertex, thus ensure that system worked well.
In addition, utilize the ability that the detection of database and handling dead connect, after Controlling vertex lost efficacy, the access rights to target data can also be discharged in time, again initiate election to make other nodes.
Wherein, described first processing unit may be used for: keep described first to connect.
Based on above-mentioned arbitrary node embodiment, described first processing unit also for: by described second connect in the Controlling vertex table of described database insert a record, described record comprises the identification information of described Controlling vertex and the timestamp of described identification information, and periodically connects the described record of renewal by described second;
Described node also comprises the second processing unit, for: the identification information obtaining described Controlling vertex from described Controlling vertex table, and connect according to the identification information obtained and described Controlling vertex.
Wherein, when obtaining the identification information of Controlling vertex from described Controlling vertex table, described second processing unit is used for:
Determine current time;
The time of searching timestamp mark at least one times from described Controlling vertex table is later than the identification information of the Controlling vertex of the described current time determined;
Acquisition finds, and the identification information of the time Controlling vertex the latest of timestamp mark;
Wherein, described in the described unsuccessful node checks having access to described target data, the number of times of the identification information of Controlling vertex is no more than pre-determined number; Described successful access to described target data node updates described in cycle of recording be determine in time interval of the identification information of Controlling vertex according to the described unsuccessful node checks having access to described target data.
Based on above-mentioned arbitrary node embodiment, the target data in described database can be the identification information of described distributed system, also can the identification information of task corresponding to node election.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (10)

1. the node electoral machinery in distributed system, is characterized in that, comprising:
The each node participating in the election of described node in distributed system is all connected with Database first, and described each node is by the target data in database described in described first connected reference;
Successful access as Controlling vertex, performs corresponding operating to the node of described target data in described distributed system;
Wherein, described Controlling vertex is the node that described database employing concurrent transaction processing policy elects.
2. method according to claim 1, it is characterized in that, described successful access as Controlling vertex to the node of described target data, performs corresponding operating and comprises in described distributed system: described successful access keeps described first to connect to the node of described target data.
3. method according to claim 1 and 2, is characterized in that, described successful access as Controlling vertex to the node of described target data, performs corresponding operating and also comprises in described distributed system:
By being connected with second of described Database, a record is inserted in the Controlling vertex table of described database, described record comprises the identification information of described Controlling vertex and the timestamp of described identification information, and periodically connects the described record of renewal by described second;
Described method also comprises: the unsuccessful node having access to described target data obtains the identification information of described Controlling vertex from described Controlling vertex table, and connects according to the identification information obtained and described Controlling vertex.
4. method according to claim 3, is characterized in that, the described unsuccessful node having access to described target data obtains the identification information of Controlling vertex from described Controlling vertex table, comprising:
The described unsuccessful node determination current time having access to described target data;
The time that the described unsuccessful node having access to described target data searches timestamp mark at least one times from described Controlling vertex table is later than the identification information of the Controlling vertex of the described current time determined;
The described unsuccessful node acquisition having access to described target data finds, and the identification information of the time Controlling vertex the latest of timestamp mark;
Wherein, described in the described unsuccessful node checks having access to described target data, the number of times of the identification information of Controlling vertex is no more than pre-determined number; Described successful access to described target data node updates described in cycle of recording be determine in time interval of the identification information of Controlling vertex according to the described unsuccessful node checks having access to described target data.
5. the method according to any one of Claims 1 to 4, is characterized in that, the target data in described database is the identification information of described distributed system, or the identification information of task corresponding to node election.
6. the node in distributed system, is characterized in that, comprising:
Connection establishment unit, for being connected with Database first;
Election unit, for by with the target data in database described in described first connected reference;
First processing unit, after successful access to described target data, performs corresponding operating as Controlling vertex in described distributed system;
Wherein, described Controlling vertex is the node that described database employing concurrent transaction processing policy elects.
7. node according to claim 6, is characterized in that, described first processing unit is used for:
Described first is kept to connect.
8. the node according to claim 6 or 7, is characterized in that, described connection establishment unit also for: be connected with described Database second;
Described first processing unit also for: by described second connect in the Controlling vertex table of described database insert a record, described record comprises the identification information of described Controlling vertex and the timestamp of described identification information, and periodically connects the described record of renewal by described second;
Described node also comprises the second processing unit, for: the identification information obtaining described Controlling vertex from described Controlling vertex table, and connect according to the identification information obtained and described Controlling vertex.
9. node according to claim 8, is characterized in that, when obtaining the identification information of described Controlling vertex from described Controlling vertex table, described second processing unit is used for:
Determine current time;
The time of searching timestamp mark at least one times from described Controlling vertex table is later than the identification information of the Controlling vertex of the described current time determined;
Acquisition finds, and the identification information of the time Controlling vertex the latest of timestamp mark;
Wherein, described in the described unsuccessful node checks having access to described target data, the number of times of the identification information of Controlling vertex is no more than pre-determined number; Described successful access to described target data node updates described in cycle of recording be determine in time interval of the identification information of Controlling vertex according to the described unsuccessful node checks having access to described target data.
10. the node according to any one of claim 6 ~ 9, is characterized in that, the target data in described database is the identification information of described distributed system, or the identification information of task corresponding to node election.
CN201510113095.2A 2015-03-13 2015-03-13 Node electoral machinery and node in a kind of distributed system Active CN104767794B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810124907.7A CN108183971B (en) 2015-03-13 2015-03-13 Node election method in distributed system
CN201510113095.2A CN104767794B (en) 2015-03-13 2015-03-13 Node electoral machinery and node in a kind of distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510113095.2A CN104767794B (en) 2015-03-13 2015-03-13 Node electoral machinery and node in a kind of distributed system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201810124907.7A Division CN108183971B (en) 2015-03-13 2015-03-13 Node election method in distributed system

Publications (2)

Publication Number Publication Date
CN104767794A true CN104767794A (en) 2015-07-08
CN104767794B CN104767794B (en) 2018-05-01

Family

ID=53649393

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810124907.7A Active CN108183971B (en) 2015-03-13 2015-03-13 Node election method in distributed system
CN201510113095.2A Active CN104767794B (en) 2015-03-13 2015-03-13 Node electoral machinery and node in a kind of distributed system

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201810124907.7A Active CN108183971B (en) 2015-03-13 2015-03-13 Node election method in distributed system

Country Status (1)

Country Link
CN (2) CN108183971B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203420A (en) * 2016-03-18 2017-09-26 北京京东尚科信息技术有限公司 The master-slave switching method and device of task scheduling example
CN107800733A (en) * 2016-08-31 2018-03-13 阿里巴巴集团控股有限公司 The generation method and equipment of session identification in distributed system
WO2019061384A1 (en) * 2017-09-30 2019-04-04 麦格创科技(深圳)有限公司 Method and system for electing task manager in distributed crawler system
CN110321199A (en) * 2019-07-09 2019-10-11 成都卫士通信息产业股份有限公司 A kind of notification method, device, electronic equipment and the medium of shared data change
CN110798499A (en) * 2018-08-03 2020-02-14 高新兴科技集团股份有限公司 Distributed service coordination system and method

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110708177B (en) * 2018-07-09 2022-08-09 阿里巴巴集团控股有限公司 Exception handling method, system and device in distributed system
CN110764690B (en) * 2018-07-28 2023-04-14 阿里云计算有限公司 Distributed storage system and leader node election method and device thereof
CN113742417A (en) * 2020-05-29 2021-12-03 同方威视技术股份有限公司 Multi-level distributed consensus method and system, electronic device and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120124100A1 (en) * 2010-11-15 2012-05-17 Sas Institute Inc. Grid Computing System Alongside a Distributed Database Architecture
CN102904752A (en) * 2012-09-25 2013-01-30 新浪网技术(中国)有限公司 Node selection method, node equipment and node system
CN103118084A (en) * 2013-01-21 2013-05-22 浪潮(北京)电子信息产业有限公司 Host node election method and node
CN103491168A (en) * 2013-09-24 2014-01-01 浪潮电子信息产业股份有限公司 Cluster election design method
CN103607297A (en) * 2013-11-07 2014-02-26 上海爱数软件有限公司 Fault processing method of computer cluster system
WO2014101424A1 (en) * 2012-12-28 2014-07-03 华为技术有限公司 Method and system for synchronizing distributed database

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267345B (en) * 2008-03-10 2010-12-08 中兴通讯股份有限公司 Service node backup method and distributed system
CN101854373B (en) * 2009-04-01 2013-10-09 华为技术有限公司 Target switching method, server node and colony system
CN102929696B (en) * 2012-09-28 2015-09-09 北京搜狐新媒体信息技术有限公司 A kind of distributed system Centroid structure, submission, method for supervising and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120124100A1 (en) * 2010-11-15 2012-05-17 Sas Institute Inc. Grid Computing System Alongside a Distributed Database Architecture
CN102904752A (en) * 2012-09-25 2013-01-30 新浪网技术(中国)有限公司 Node selection method, node equipment and node system
WO2014101424A1 (en) * 2012-12-28 2014-07-03 华为技术有限公司 Method and system for synchronizing distributed database
CN103118084A (en) * 2013-01-21 2013-05-22 浪潮(北京)电子信息产业有限公司 Host node election method and node
CN103491168A (en) * 2013-09-24 2014-01-01 浪潮电子信息产业股份有限公司 Cluster election design method
CN103607297A (en) * 2013-11-07 2014-02-26 上海爱数软件有限公司 Fault processing method of computer cluster system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203420A (en) * 2016-03-18 2017-09-26 北京京东尚科信息技术有限公司 The master-slave switching method and device of task scheduling example
CN107800733A (en) * 2016-08-31 2018-03-13 阿里巴巴集团控股有限公司 The generation method and equipment of session identification in distributed system
CN107800733B (en) * 2016-08-31 2021-01-15 阿里巴巴集团控股有限公司 Method and equipment for generating session identifier in distributed system
WO2019061384A1 (en) * 2017-09-30 2019-04-04 麦格创科技(深圳)有限公司 Method and system for electing task manager in distributed crawler system
CN110798499A (en) * 2018-08-03 2020-02-14 高新兴科技集团股份有限公司 Distributed service coordination system and method
CN110798499B (en) * 2018-08-03 2023-01-24 高新兴科技集团股份有限公司 Distributed service coordination system and method
CN110321199A (en) * 2019-07-09 2019-10-11 成都卫士通信息产业股份有限公司 A kind of notification method, device, electronic equipment and the medium of shared data change
CN110321199B (en) * 2019-07-09 2022-04-12 成都卫士通信息产业股份有限公司 Method and device for notifying common data change, electronic equipment and medium

Also Published As

Publication number Publication date
CN108183971A (en) 2018-06-19
CN108183971B (en) 2021-08-10
CN104767794B (en) 2018-05-01

Similar Documents

Publication Publication Date Title
CN104767794A (en) Node election method in distributed system and nodes in distributed system
US10560315B2 (en) Method and device for processing failure in at least one distributed cluster, and system
US9984140B1 (en) Lease based leader election system
EP2790112B1 (en) Method and system for data synchronization and data access apparatus
US11516072B2 (en) Hybrid cluster recovery techniques
EP2434729A2 (en) Method for providing access to data items from a distributed storage system
CN106062717A (en) Distributed storage replication system and method
US20120179798A1 (en) Autonomous primary node election within a virtual input/output server cluster
EP3561694B1 (en) Management method, system, and device for master and standby databases
KR20040015223A (en) Resource action in clustered computer system incorporating prepare operation
CN103152434A (en) Leader node replacing method of distributed cloud system
CN113987064A (en) Data processing method, system and equipment
US20130346790A1 (en) Non-disruptive controller replacement in network storage systems
EP3291487B1 (en) Method for processing virtual machine cluster and computer system
CN105915391B (en) The distributed key assignments storage method of self-recovering function is submitted and had based on single phase
US20220253363A1 (en) Distributed database remote backup
EP3953818A2 (en) Iot partition management and load balancing
CN116107828A (en) Main node selection method, distributed database and storage medium
CN105323271B (en) Cloud computing system and processing method and device thereof
CN107291575B (en) Processing method and equipment for data center fault
CN104052799A (en) Method for achieving high availability storage through resource rings
CN116346588A (en) Management node switching method, device, equipment and medium
CA2619778C (en) Method and apparatus for sequencing transactions globally in a distributed database cluster with collision monitoring
CN112527561B (en) Data backup method and device based on Internet of things cloud storage
JP5956940B2 (en) Redundant system and working machine determination method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20170109

Address after: 266000 Shandong Province, Qingdao city Laoshan District Songling Road No. 399

Applicant after: Poly Polytron Technologies Inc

Address before: 266061 Laoshan, Qingdao province Hongkong District No. East Road, room 248, room 131

Applicant before: Hisense Media Networks Co., Ltd.

GR01 Patent grant
GR01 Patent grant