Forums/Knowledge Base/MySQL Galera Replication

Adding a new node to a Galera Replication cluster

Vinay Joosery
posted this on October 20, 2011 15:44

Adding a new node is automatic with Galera. It follows the same process as recovering a failed node. When the node is introduced, ClusterControl™ will select a ‘donor’ and do a full state snapshot transfer from that node.

During the synchronization process, any incoming transactions are cached in a slave queue. Once the node is SYNCED, it is ready to accept client connections.

 

Comments

User photo
Mark Rose

How is this actually done?

November 09, 2011 21:22
User photo
Alex

@Mark,

Short answer:

  1. A node connects to one of the cluster members, membership protocol is initiated, after which node is connected to all members of the cluster
  2. The node receives cluster state ID (global transaction ID of the last committed transaction) and compares with its own
  3. If it is different, it sends state transfer request to cluster. Cluster chooses one of the members as a state transfer donor. Donor connects to the new node (that's an important difference from established practice) and transfers the state. There are several ways it can happen. While state transfer is happening the joining node is queueing replication events arriving from the cluster.
  4. The node sends JOIN message and is considered a full-fledged member. It then starts to apply replication events.
  5. When the replication events queue goes down to 0, the node becomes SYNCED and is allowed to process client queries.

Long answer:

http://www.codership.com/wiki/doku.php?id=info#adding_another_node_... and around.

November 10, 2011 14:08