...
- Initial set of nodes is started, providing the following properties:
- A subset of nodes (minimum 1, more can be specified to increase startup reliability) in the initial cluster setup, provided by an IP Finder. Concrete IP Finder implementations are used to obtain the seed members from different environments and are specified either via the configuration or the CLI.
- The nodes assemble into a physical topology using a network discovery protocol (e.g. SWIM), bootstrapped with the provided seed members.
- An init command is sent by a user to a single node in the cluster, providing the following information:
- Consistent IDs (names) of the nodes that will host the Meta Storage;
- Consistent IDs (names) of the nodes that will comprise the Cluster Management Group. It is possible for both of these address sets to be the same.
- The node, that has received the command, propagates it to all members of the physical topology that were specified in the init command. These members should start the corresponding Raft groups and, after the group leaders are elected, the initial node should return a response to the user. In case of errors, Raft groups should be removed and an error response will be returned to the user. If no response has been received, the user should retry sending the command with the same parameters to a different node.
- As soon as the CMG leader is elected, the leader initializes the CMG state by applying a Raft command (e.g.
ClusterInitCommand
), which includes:- A generated Cluster Tag;
- Ignite product version.
- After the command has been applied, the leader sends a message to all nodes in the physical topology, containing the location of the CMG nodes. At this point the cluster can be considered as running.
- Upon receiving the message, each node sends a join request to the CMG leader, which consists of:
- Protocol version (an integer which is increased every time the join procedure is changed, needed to support backwards compatibility);
- Ignite product version;
- Information from the join requests gets validated on the leader and, if the properties are equal to the CMG state (in case of the protocol version, a different comparison algorithm might be used), a successful response is sent, containing:
- Consistent IDs (names) of the Meta Storage nodes;
- Cluster Tag.
If the properties do not match, an error response is sent and the joining node is rejected.
- If the joining node has passed the validation and received the validation response, it starts some local recovery procedures (if necessary) and sends a response to the CMG leader, indicating that it is ready to be added to the logical topology.
- The CMG leader issues a Raft command (e.g.
AddNodeCommand
), which adds the node to the logical topology.
An example of this flow can be found on the diagram below. Some initialization steps are omitted for Node C as they are identical to the corresponding steps on Node B.
Image Added
Adding a new node to a running cluster
...