change process [--sequential-restart]old_proc_type[:proc-id]=new_proc_typecluster_nameold_proc_type |new_proc_type: {ndbd|ndbmtd} This command is used to change the process type for a given MySQL NDB Cluster process or group of MySQL NDB Cluster processes from one process type (old-process-type) to another process type (new-process-type).
Currently, the only two process types available for use with this command arendbd andndbmtd. This means thatchange process can be used to change the data node process running on one or more data nodes from the single-threaded data node daemon (ndbd) to the multithreaded data node daemon (ndbmtd) or vice versa.
By default,change process affects all data nodes running theold-process-type. By specifying an optionalprocess_id, its action can be restricted to the data node having that process ID.
Suppose you have a cluster that is namedmycluster and has two data nodes usingndbd processes, as reflected in the output of the followingshow status command:
mcm> show status --process mycluster;+--------+----------+----------+----------+-----------+| NodeId | Process | Host | Status | Nodegroup |+--------+----------+----------+----------+-----------+| 49 | ndb_mgmd | flundra | running | || 1 | ndbd | tonfisk | running | n/a || 2 | ndbd | grindval | running | n/a || 50 | mysqld | haj | running | || 51 | mysqld | torsk | running | || 52 | ndbapi | * | running | |+--------+----------+----------+----------+-----------+6 rows in set (0.06 sec) To change both data nodes to so that they use multithreaded (ndbmtd) processes, issue the command shown here, without anyprocess_id specifier:
mcm> change process ndbd=ndbmtd mycluster;+------------------------------+| Command result |+------------------------------+| Process changed successfully |+------------------------------+1 row in set (2 min 17.51 sec) After the command has executed, you can verify that both data nodes are now usingndbmtd by checking the output of the appropriateshow status command, as shown here:
mcm> show status --process mycluster;+--------+----------+----------+----------+-----------+| NodeId | Process | Host | Status | Nodegroup |+--------+----------+----------+----------+-----------+| 49 | ndb_mgmd | flundra | running | || 1 | ndbmtd | tonfisk | running | n/a || 2 | ndbmtd | grindval | running | n/a || 50 | mysqld | haj | running | || 51 | mysqld | torsk | running | || 52 | ndbapi | * | running | |+--------+----------+----------+----------+-----------+6 rows in set (0.09 sec) A rolling restart for the cluster is performed at the end of thechange process command. Use the--sequential-restart option to make the rolling restart asequential one.
Thechange process command can be used whether or not the cluster or the data node or data nodes to be changed are running. However, the command executes much more quickly if the data node or data nodes to be changed are not running. The next set of examples illustrates this.
It is possible (and sometimes desirable) to usendbd andndbmtd data node processes concurrently; thus, it is also possible using thechange process command to change a single data node process from single-threaded to multithreaded, or from multithreaded to single-threaded. To do this, you must specify the data node process using its process ID.
First, we stop the cluster and verify that all processes are no longer running, as shown here:
mcm> stop cluster mycluster;+------------------------------+| Command result |+------------------------------+| Cluster stopped successfully |+------------------------------+1 row in set (22.93 sec)mcm> show status --process mycluster;+--------+----------+----------+----------+-----------+| NodeId | Process | Host | Status | Nodegroup |+--------+----------+----------+----------+-----------+| 49 | ndb_mgmd | flundra | stopped | || 1 | ndbmtd | tonfisk | stopped | n/a || 2 | ndbmtd | grindval | stopped | n/a || 50 | mysqld | haj | stopped | || 51 | mysqld | torsk | stopped | || 52 | ndbapi | * | stopped | |+--------+----------+----------+----------+-----------+6 rows in set (0.05 sec) The following command changes only the node having the process ID2 from using the multithreaded data node daemon to the single-threaded version:
mcm> change process ndbmtd:2=ndbd mycluster;+------------------------------+| Command result |+------------------------------+| Process changed successfully |+------------------------------+1 row in set (6.52 sec) As you can see,change process operates much more quickly when the process to be changed is not running. As before, you can verify that the command succeeded usingshow status:
mcm> show status --process mycluster;+--------+----------+----------+----------+-----------+| NodeId | Process | Host | Status | Nodegroup |+--------+----------+----------+----------+-----------+| 49 | ndb_mgmd | flundra | stopped | || 1 | ndbmtd | tonfisk | stopped | n/a || 2 | ndbd | grindval | stopped | n/a || 50 | mysqld | haj | stopped | || 51 | mysqld | torsk | stopped | || 52 | ndbapi | * | stopped | |+--------+----------+----------+----------+-----------+6 rows in set (0.07 sec) To complete the example, we start the cluster again, usingstart cluster, then change node number 2 back fromndbd (single-threaded) tondbmtd (multithreaded) usingchange process, then verify the change usingshow status:
mcm> start cluster mycluster;+------------------------------+| Command result |+------------------------------+| Cluster started successfully |+------------------------------+1 row in set (36.43 sec)mcm> change process ndbd:2=ndbmtd mycluster;+------------------------------+| Command result |+------------------------------+| Process changed successfully |+------------------------------+1 row in set (2 min 10.41 sec)mcm> show status --process mycluster;+--------+----------+----------+----------+-----------+| NodeId | Process | Host | Status | Nodegroup |+--------+----------+----------+----------+-----------+| 49 | ndb_mgmd | flundra | running | || 1 | ndbmtd | tonfisk | running | n/a || 2 | ndbmtd | grindval | running | n/a || 50 | mysqld | haj | running | || 51 | mysqld | torsk | running | || 52 | ndbapi | * | running | |+--------+----------+----------+----------+-----------+6 rows in set (0.11 sec)You can see that it can require much less time to stop the cluster, change a data node process, and then start the cluster again than it is to change the process while the cluster is running. However, if you do this, the cluster is not available while it is stopped.
As noted previously,change process works only withndbd andndbmtd processes; attempting to use any other process type causes the command to fail with an error, as shown here:
mcm> change process ndb_mgmd=mysqld mycluster;ERROR 7009 (00MGR): Processes ndb_mgmd and mysqld are not interchangeable in this packagemcm> change process ndbd=mysqld mycluster;ERROR 7009 (00MGR): Processes ndbd and mysqld are not interchangeable in this package