Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you want to change the configurations for MySQL Cluster, we recommend that you do it off peak. Even though it is generally safe to increase and decrease parameters, but decreasing a parameter such as DataMemory may have the effect that the memory will not be able to store all data.

Updating MySQL Cluster Configurations Without Downtime

If you need to update the cluster by, for example, adding new data nodes or changing other configuration you can perform a so called rolling restart to do this without data loss.

To perform a rolling restart:

...

Update the config.ini file, for example to include the new node, or with any other changes you might want to make.

Restart the management nodes by first shutting them down with the following commands:

Code Block
$ ps -ef | grep ndb_mgmd
$ kill -15 <pid>

and then starting them up again with the following command:

Code Block
ndb_mgmd -f /etc/config.ini --configdir=/etc/ --reload

Restart each data node by first shutting them down with the following commands:

Code Block
$ ps -ef | grep ndbmtd
kill -15 <pid>
Note
titleNote

There will be two processes on each data node, and the one that has the other as its parent pid, the process with the highest process id, should be killed.

and then starting them up again with the following command:

Code Block
$ ndbmtd --ndb-connectstring=<IP address of the data node>:1186 --ndb-nodeid=<node id>
Note
titleNote

In order to keep traffic running, make sure to kill only one data node at the time, start it up, and wait for the message "Node started" to appear in the logs before restarting the next data node.

If any new nodes have been added, start these when all existing data nodes have been restarted with the following command:

Code Block
$ ndbmtd --ndb-connectstring=<IP address of the data node>:1186 --ndb-nodeid=<node id> --initial

Restart the MySQL server with the following command:

Code Block
$ mysqld --defaults-file=/etc/my.cnf &

If any new nodes have been added, reorganize the partitions to take the new data nodes into account by using the following command:

Code Block
$ mysql -uroot -ppassword -h <IP address of the MySQL server>

and altering the table TABLE_NAME REORGANIZE PARTITION.

Note
titleNote

Since this will take a while and will have impact on the performance, it is recommended to perform this procedure at low traffic during a maintenance window.

If a data node seems corrupt even though the other data nodes are running, you can recreate the corrupt node by killing the old process and restoring the data node with the following command:

Code Block
$ ndbmtd --ndb-connectstring=<IP address of the data node>:1186 --ndb-nodeid=<node id> --initial

This will mean that the data node starts as a new node and will replicate all the existing data from the other data nodes without data loss.

Note
titleNote!

Ensure that you DO NOT shut down any other nodes since all nodes must start successfully on a restart for the start to be successful.

...

See the official documentation provided by Oracle, https://docs.oracle.com/cd/E37745_01/html/E38170/toc.html for information about how to change the MySQL Cluster configurations.