2.7.2. Migrating a MySQL Cluster to MySQL Cluster Manager

MySQL Cluster Manager is designed primarily for managing MySQL Cluster deployments that are created by it, rather than introducing it into existing MySQL Cluster instances that are already in use. Currently, there is no integrated functionality for importing an existing MySQL Cluster into MySQL Cluster Manager, and it is not currently possible to perform this task without shutting down and restarting the cluster.

This section outlines a suggested procedure for importing an existing MySQL Cluster manually into MySQL Cluster Manager. It is in many ways similar to creating a new cluster in MySQL Cluster Manager, but differs in how initial configuration of the cluster is carried out. The importation procedure includes the following steps:

Workaround for non-sequential node IDs.  If the node IDs in the existing cluster are not strictly consecutive, beginning with 1, this causes problems when trying to import it into MySQL Cluster Manager because MySQL Cluster Manager's internal representation of the cluster requires them to be. One way to surmount this issue is to insert dummy ndbapi entries into the process hosts list used in the create cluster statement. The following example illustrates how this can be done.

Suppose the original cluster has 8 nodes that use the process types, the node IDs, and hosts shown in the following table:

Process typeNode IDHost
ndb_mgmd2192.168.10.2
ndb_mgmd4192.168.10.4
ndbd5192.168.10.10
ndbd6192.168.10.11
ndbd7192.168.10.10
ndbd8192.168.10.11
mysqld10192.168.10.20
mysqld12192.168.10.21

Assuming that a package named mypackage has already been registered, a cluster named mycluster having the preceding distribution of nodes on hosts can be created in the mcm client like this:

mcm> create cluster -P mypackage -R 
  -> ndb_mgmd@192.168.10.2,ndb_mgmd@192.168.10.4, 
  -> ndbd@192.168.10.10,ndbd@192.168.10.11,  
  -> ndbd@192.168.10.10,ndbd@192.168.10.11, 
  -> mysqld@192.168.10.20,mysqld@192.168.10.21 
  -> mycluster; 

However, the node IDs generated by this statement are the numbers 1, 2, 3, ..., 8. In order to preserve the original numbering, we need to account for the numbers 1, 3, 9, and 11. The following version of the command has been modified such that dummy ndbapi process entries have been inserted into the list of processes on hosts; the extra entries are shown in a contrasting style:

mcm> create cluster -P mypackage -R 
  -> ndbapi@196.168.0.2,ndb_mgmd@192.168.10.2,
  -> ndbapi@196.168.0.4,ndb_mgmd@192.168.10.4, 
  -> ndbd@192.168.10.10,ndbd@192.168.10.10  
  -> ndbd@192.168.10.11,ndbd@192.168.10.11,
  -> ndbapi@196.168.0.11,mysqld@192.168.10.20,
  -> ndbapi@196.168.0.20,mysqld@192.168.10.21 
  -> mycluster; 

Since MySQL Cluster Manager does not expect to execute ndbapi processes itself, the host names used with these dummy items are arbitrary; the only requirement for these is that they are names of hosts belonging to the cluster.