Wednesday, March 18, 2009

MySQL Cluster 7.0.4 - online add node scripts

MySQL Cluster 7.0.4 (beta, a and formerly known as 6.4) was released yesterday in source format. The new versions fixes a number of bugs in e.g the areas of online add node and parition pruning for some index scans.

Morveover Configurator has been updated (and all the scripts have got improved error handling and usability) to support add nodes with a procedure according to the docs.

To add a new node group using the Configurator you do like this:
  1. Make sure you have a MySQL Cluster 7.0 running.
  2. cd mysqlcluster-70/cluster/scripts
  3. Add the two new data nodes to the config.ini
    • vi ../config/config.ini
    • There are already two empty data nodes with Id=5, and Id=6 (if you have defined a two ndb node cluster in the Configurator).
    • Remove the # at the start of the line.
    • Fill in the hostname in Hostname=
      e.g, you have added the two hostnames "A" and "B"
  4. sh ./ A,B
    • The script will restart all the nodes (management servers, mysql servers, and data nodes) , copy out binaries to the added nodes, start them, and finally create a new node group.
    • For a two node cluster you have to wait about 4 minutes and 50 seconds now.
  5. Now you have to do ALTER ONLINE TABLE table_name REORGANIZE PARTITION on all you NDB tables.

No comments: