The ability to add MySQL Cluster data nodes while the cluster is still up and running is known as performing an “online” addition of nodes. This became available in MySQL Cluster starting with the 6.4.0 release version. Performing an online addition to the cluster allows for increased availability since there is no downtime and also allows a more flexible management of the cluster resources.
Certain changes of the Cluster configuration will require a complete restart of the Cluster and even a backup/restore of the data. Such configuration changes would include NoOfReplicas and any of the underlying network configuration such as hostname/ip address etc.
The steps required to add a new node to a running cluster are:
- Edit the config.ini file to add new [ndbd] sections corresponding to the new nodes that will be added. If using more than one management server, make sure to update the config.ini file on each of the management servers.
- Perform a rolling restart of all the MySQL Cluster management servers. Make sure you use the –reload or –initial option to force the new configuration to be read.
- Perform a rolling restart of all the existing data nodes. It is not required to use –initial here and doing so is usually not desirable.
- Perform a rolling restart of any SQL or API nodes.
- Perform an initial start of the new data nodes that are being added to the cluster.
- If new node groups are being added, then execute the CREATE NODEGROUP command in the management client for the new nodes.
- Redistribute the cluster’s data amongst all the data nodes by issuing an ALTER ONLINE TABLE … REORGANIZE PARTITION statement for each of the NDB tables in your databases.
- Reclaim the space by issue an OPTIMIZE TABLE statement for each NDB table or using a NULL alter table statement such as ALTER TABLE t1 ENGINE=NDB.
This can also be done in a more structured manner using the MySQL Cluster Manager software using the “add process” and “start process” commands.