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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

How to Add New Nodes To an Existing MySQL Cluster Setup

By admin

There are three types of nodes that you might want to add to an existing MySQL Cluster: mysqld (API) nodes, management server nodes, and data nodes.

Adding a new mysqld (API) node

In order to add a new mysqld node, you simply need to add the new [mysqld] section to the config.ini and then perform a rolling upgrade. After you have done this, then you can start up the new mysqld node and it will have all of the cluster data available. To do this, following you would follow these steps:

  • Edit the config.ini to add the new [mysqld] section.
  • Perform a rolling restart.
  • Start up the new mysqld node.

Note that you don’t have to shut down the entire server in order to add a new mysqld node.

While the steps above do work, it is often a good practice to have a few extra [mysqld] and/or [api] sections in the config.ini that are not used. The reason you can safely have extra unused slots is because you do not have to have all mysqld nodes running in order to start the cluster. In the case where you have one of these empty slots, you only need to start up the mysqld to fill it. There is no need to do a rolling upgrade if you already have the extra slot available.

Adding a new management server node

Adding a new management server is very similar to adding a new mysqld node. To add a new one follow this process:

  • Edit the config.ini file to add a new [MGM] group.
  • Edit all of the nodes to have a new connect-string parameter including the extra management node information.
  • Shut down the existing management node(s)
  • Start the existing management node(s) with –initial. This is one of the cases where –initial is required for the management node. If you try –reload, the new management node will not have the same configuration version as the old and will be refused to connect to the cluster.
  • Start up the new management node with –initial.
  • Complete the rolling restart for the data and api/mysqld nodes to get the new connection string information and config.ini information loaded into each node.

Again, you do not need to completely shutdown the cluster. While MySQL Cluster supports three and more ndb_mgmd nodes there are generally little reasons to have more than two.

Adding a new data node (ndbd or ndbmtd)

The procedure to add a new data node depends on the version of MySQL Cluster.

MySQL Cluster 6.4.0 and Later

You can add a data node online. Refer the post below for the detailed steps:

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

MySQL Cluster 6.3 and Earlier

In these versions, you cannot add a complete new data node without interrupting service on the cluster. To add a new data node you have to do the following:

  • Take a backup of the data in MySQL Cluster either using mysqldump or with the hot online backup tool.
  • Change the config.ini file to the new specified setup.
  • Do a full initial restart of the MySQL Cluster.
    • Shutdown every single node in the cluster.
    • Startup the data nodes (ndbd) using the –initial flag. This will remove all existing data in the cluster.
  • Re-import your data into MySQL Cluster using the appropriate tool depending on how you took your backup.

This will cause all of the data to be redistributed amongst the new nodes added into the cluster. Note that this does require a full restart, so you will have shutdown time in order to implement it. While you can not add a new node on the fly, it is possible to replace a down node with another node. Meaning, if you lose one node permanently, it is possible to replace it with a new server without causing any downtime.

To replace a node, you just start it up as if it was the other node. That means you need to give it the appropriate node-id and make sure that the hostname is the same as the previous one. The node will then synchronize off of the other members of the node group like a crash recovery.

Filed Under: mysql, MySQL Cluster

Some more articles you might also be interested in …

  1. How to Restore a Specific Database or Table (MySQL)
  2. mysqldump – How to Restore a Specific Database From a Backup of All Databases
  3. MySQL : how to set (change) user password
  4. How To Install MySQL RPM packages in a different location to allow multiple versions (versions < 5.6.10)
  5. How to Change the Default Character Set and Collation for a Database in MySQL
  6. How to backup and restore MySQL database
  7. How to Migrate from Oracle to MySQL
  8. How To Purge Audit Logs in MySQL
  9. How to Set Space limits for MySQL for database/schema/table
  10. Counting Rows Of A Table In MySQL Server

You May Also Like

Primary Sidebar

Recent Posts

  • Basics of client connectivity in Oracle Data Guard configuration
  • ORA-354 ORA-353 and ORA-312: Possible corruption in Online Redo Log File Members in a Redo Log Group
  • How to relocate the redo log files to a different location on disk
  • Oracle Database: Redo log operations (Add/Drop/Change Location)
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary