• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Add Data Nodes to MySQL Cluster without Restarting the Cluster (version 6.4 and later)

by admin

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:

  1. 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.
  2. 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.
  3. 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.
  4. Perform a rolling restart of any SQL or API nodes.
  5. Perform an initial start of the new data nodes that are being added to the cluster.
  6. If new node groups are being added, then execute the CREATE NODEGROUP command in the management client for the new nodes.
  7. 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.
  8. 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.
Note: If you have API nodes that dynamically allocate ID’s then be careful when assigning ID’s for the new data nodes to make sure they are not already used. If they are, then all API/SQL nodes much be restarted before any data node is modified in any way. This is why have groups of numbers associated with the different node types can be useful for future scaling.

This can also be done in a more structured manner using the MySQL Cluster Manager software using the “add process” and “start process” commands.

Filed Under: mysql, MySQL Cluster

Some more articles you might also be interested in …

  1. How to find location of MySQL configuration file(s)
  2. What’s a good process to find and eliminate slow queries in MySQL
  3. MySQL – How to undo (rollback) a set of SQL statements
  4. How to reset MySQL database root password
  5. mysqldump – How to Restore a Specific Database From a Backup of All Databases
  6. MySQL Shell: Using External Python Modules
  7. Understanding the Different Configuration files used for MySQL Server
  8. How to use mysqldump without CREATE TABLE statements
  9. How to Use External Python modules in MySQL Shell
  10. Beginners Guide to MySQL Data Types

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright