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

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@,ndb_mgmd@, 
  -> ndbd@,ndbd@,  
  -> ndbd@,ndbd@, 
  -> mysqld@,mysqld@ 
  -> 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@,ndb_mgmd@,
  -> ndbapi@,ndb_mgmd@, 
  -> ndbd@,ndbd@  
  -> ndbd@,ndbd@,
  -> ndbapi@,mysqld@,
  -> ndbapi@,mysqld@ 
  -> 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.