Selection of leader nodes in distributed data services
An aspect of the present disclosure facilitates selection of leader nodes in distributed data services. In one embodiment, a distributed data service is provided operative based on multiple nodes. Upon receiving from a user a selection of a set of nodes that are preferred as leader nodes, a node contained in the set of nodes is set as a leader node in the distributed data service in view of the selection by the user. Accordingly, a user is provided control over the selection of leader nodes in the distributed data service.
1. A method of operating distributed data services, said method being performed in an orchestration server, said method comprising:
receiving from a user, a selection of a set of nodes that are preferred as leader nodes of a cluster, said cluster being comprised in a plurality of clusters together providing a distributed data service, said cluster comprises a plurality of nodes including said set of nodes,
each of said set of nodes being identified by a corresponding unique identifier of a set of identifiers; and
performing determination of a leader node by combined operation of said plurality of nodes, wherein said determination comprises:
receiving data indicating that a second node has been elected as said leader node at a first time instance;
checking whether said second node is contained in said set of nodes;
if said second node is not contained in said set of nodes, sending commands to initiate election of said leader node iteratively until one of said set of nodes is elected as said leader node, wherein said election is performed by combined operation of said plurality of nodes,
wherein said performing is performed after said selection being received from said user, wherein said set of nodes are identified in said distributed data service prior to said performing in view of said corresponding unique identifiers.
2. The method of claim 1 , wherein said election is performed by said plurality of nodes based on a distributed consensus algorithm.
3. The method of claim 2 , wherein said distributed consensus algorithm is Raft consensus algorithm.
4. The method of claim 3 , wherein said distributed data service is a distributed database.
5. The method of claim 1 , wherein said selection comprises indicating unique identifiers of individual ones of specific nodes of said plurality of nodes to specify said set of nodes.
6. The method of claim 1 , wherein each unique identifier is a corresponding Internet Protocol (IP) address of a respective node of the plurality of nodes.
7. A non-transitory machine readable storage medium storing one or more sequences of instructions for causing an orchestration server to operate distributed data services, wherein execution of said one or more instructions by one or more processors contained in a system causes said system to perform the actions of:
receiving, by said orchestration server, from a user a selection of a set of nodes that are preferred as leader nodes of a cluster, said cluster being comprised in a plurality of clusters together providing a distributed data service, said cluster comprises a plurality of nodes including said set of nodes,
each of said set of nodes being identified by a corresponding unique identifier of a set of identifiers; and
performing determination of a leader node by combined operation of said plurality of nodes, wherein said determination comprises:
receiving data indicating that a second node has been elected as said leader node at a first time instance;
checking whether said second node is contained in said set of nodes;
if said second node is not contained in said set of nodes, sending commands to initiate election of said leader node iteratively until one of said set of nodes is elected as said leader node, wherein said election is performed by combined operation of said plurality of nodes,
wherein said performing is performed after said selection being received from said user, wherein said set of nodes are identified in said distributed data service prior to said performing in view of said corresponding unique identifiers.
8. The non-transitory machine readable storage medium of claim 7 , wherein said election is performed by said plurality of nodes based on a distributed consensus algorithm.
9. The non-transitory machine readable storage medium of claim 8 , wherein said distributed consensus algorithm is Raft consensus algorithm.
10. The non-transitory machine readable storage medium of claim 9 , wherein said distributed data service is a distributed database.
11. The non-transitory machine readable storage medium of claim 7 , wherein said selection comprises indicating unique identifiers of individual ones of specific nodes of said plurality of nodes to specify said set of nodes.
12. The non-transitory machine readable storage medium of claim 7 , wherein each unique identifier is a corresponding Internet Protocol (IP) address of a respective node of the plurality of nodes.
13. A digital processing system for operating a distributed data service, said digital processing system comprising:
one or more processors; and
a random access memory (RAM) to store instructions, wherein said one or more processors retrieve said instructions and execute said instructions, wherein execution of said instructions causes said digital processing system to perform the actions of:
receiving from a user a selection of a set of nodes that are preferred as leader nodes of a cluster, said cluster being comprised in a plurality of clusters together providing a distributed data service, said cluster comprises a plurality of nodes including said set of nodes,
each of said set of nodes being identified by a corresponding unique identifier of a set of identifiers; and
performing determination of a leader node by interfacing with said plurality of nodes, wherein said determination comprises:
receiving data indicating that a second node has been elected as said leader node at a first time instance;
checking whether said second node is contained in said set of nodes;
if said second node is not contained in said set of nodes, sending commands to initiate election of said leader node iteratively until one of said set of nodes is elected as said leader node, wherein said election is performed by combined operation of said plurality of nodes,
wherein said performing is performed after said selection being received from said user, wherein said set of nodes are identified in said distributed data service prior to said performing in view of said corresponding unique identifiers.
14. The digital processing system of claim 13 , wherein said election is performed by said plurality of nodes based on a distributed consensus algorithm.
15. The digital processing system of claim 14 , wherein said distributed consensus algorithm is Raft consensus algorithm, wherein said distributed data service is a distributed database.
16. The method of claim 13 , wherein said selection comprises indicating unique identifiers of individual ones of specific nodes of said plurality of nodes to specify said set of nodes.
17. The method of claim 13 , wherein each unique identifier is a corresponding Internet Protocol (IP) address of a respective node of the plurality of nodes.