add process {--processhosts=|-R }process_host_list [--set=attribute_assignment_list] [--verbose | -v] [--sequential-restart]cluster_nameprocess_host_list:process_name[:node_id]@host[,process_name@host[,...]]process_name: {ndb_mgmd|ndbd|ndbmtd|mysqld|ndbapi}attribute_assignment_list:attribute_assignment[,attribute_assignment][,...]attribute_assignment:attribute_name:process_name[=value] This command adds to an existing cluster one or more processes, which are specified using aprocess_host_list with the--processhosts option, the format of which is the same as that used with thecreate cluster command. Any hosts referenced in the list must be members of the site to which the cluster belongs. In addition, all hosts must be resolvable.
For example, the followingadd process command adds twomysqld processes on hoststonfisk andflundra to the cluster namedmycluster:
mcm> add process --processhosts=mysqld@tonfisk,mysqld@flundra mycluster;+------------------------------+| Command result |+------------------------------+| Processes added successfully |+------------------------------+1 row in set (2 min 10.39 sec) With the--verbose option, the command shows an updated process list, after the new processes have been added:
mcm> add process --processhosts=ndbmtd@tonfisk,ndbmtd@flundra --verbose mycluster;+--------+----------+---------+| NodeId | Name | Host |+--------+----------+---------+| 49 | ndb_mgmd | tonfisk || 53 | ndb_mgmd | flundra || 1 | ndbmtd | tonfisk || 2 | ndbmtd | flundra || 3 | ndbmtd | tonfisk || 4 | ndbmtd | flundra || 50 | mysqld | tonfisk || 51 | mysqld | flundra || 52 | ndbapi | * |+--------+----------+---------+9 rows in set (2 min 7.57 sec) You can also manually assign a node ID to the new process you are adding to the cluster by adding“:” after thenode_ID.process_name. You are still recommended to follow the best practice of reserving node ID 1 to 144 for data nodes. The following command adds twondbd processes with node IDs 10 and 11 on hoststonfisk andflundra, respectively, tomycluster:
mcm> add process --processhosts=ndbd:10@tonfisk,ndbd:11@flundra mycluster;+------------------------------+| Command result |+------------------------------+| Processes added successfully |+------------------------------+1 row in set (2 min 13.40 sec) If the cluster is not running when you run theadd process command, it is recommended that you start all the new processes added by this command together using thestart process--added command or start them together with the whole cluster using thestart cluster command—besides starting the nodes, either of the two commands also initializes the added nodes and causes new cluster nodegroups to be formed by issuing aCREATE NODEGROUP command to the cluster. If the added nodes are started withstart process--initial instead, you are then required to runCREATE NODEGROUP manually via thendb_mgm client.
If the cluster is running when you run theadd process command, a rolling restart for the cluster is performed at the end of theadd process command. Use the--sequential-restart option to make the rolling restart asequential one.
Adding Free Processes
Using theadd process command, you can add unmanagedmysqld processes, orndbapi slots forndbapi applications such asndb_restore. To add an unmanagedmysqld process, prefix the hostname with the wildcard * (asterisk character):
mcm> add process --processhosts=mysqld@*tonfisk,mysqld@*flundra mycluster;+------------------------------+| Command result |+------------------------------+| Processes added successfully |+------------------------------+1 row in set (2 min 3.14 sec) To allow the unmanagedmysqld nodes to connect from any host, use the wildcard* (asterisk character) in place of the hostname or IP address:
mcm> add process --processhosts=mysqld@*,mysqld@* mycluster;+------------------------------+| Command result |+------------------------------+| Processes added successfully |+------------------------------+1 row in set (2 min 3.14 sec) The same applies tondbapi slots forndbapi applications such asndb_restore: prefix the hostname with the wildcard character to limit connectivity to a specific host, or use only a wildcard, without hostname, to allowndbapi applications from any host:
mcm> add process --processhosts=ndbapi@*tonfisk,ndbapi@* mycluster;+------------------------------+| Command result |+------------------------------+| Processes added successfully |+------------------------------+1 row in set (2 min 8.13 sec) Because“free” processes are not managed by MySQL Cluster Manager, there is no need to run thestart process command after they have been successfully added to the cluster.--added
Usingadd process to Simplifycreatecluster Commands
Processes added before the cluster is started for the first time are started with the cluster. This makes it possible to use this command to break down what would otherwise be very longcreate cluster commands. Consider the following set of commands that creates and then starts a cluster namedmycluster:
create cluster --processhosts=ndb_mgmd@host1,ndbd@host1,ndbd@host2, \ mysqld@host3,mysqld@host4 mycluster;start cluster mycluster; The longcreate cluster command can be divided into a shorter (and more manageable) version of itself, plus severaladd process commands. This set of commands performs the same task as the previous set, creatingmycluster with exactly the same processes and hosts as before, and then starting it:
create cluster --processhosts=ndb_mgmd@host1 mycluster;add process --processhosts=ndbd@host1,ndbd@host2 mycluster;add process --processhosts=mysqld@host3,mysqld@host4 mycluster;start cluster mycluster; Notice that a process that is added to a cluster that was created usingcreate cluster--import and before the import takes place is added with statusimport, which means it cannot be started or stopped usingstart process orstop process before an import has taken place.
Configuring a New Process when Adding it
A newly added process inherits its configuration attribute settings from those in effect for its process type on the parent cluster, or assume the default settings for that process type if none apply. Existing attribute settings in the cluster must have process-level scope to be inherited by new processes added later; instance-level settings set for existing process instances prior to adding any new ones do not apply to any of the added processes. (SeeConfiguration attributes, for more information about the scope of attribute settings.)
Inherited attribute settings can be overridden when adding processes; to do this, use theadd process command's--set option. This option takes as its argument an attribute assignment list similar in format to that used with theget andset commands. Suppose that the currentndbd process-level setting in the cluster namedmycluster for theDataDir attribute is/home/users/ndb/cluster-data, but you wish to add two newndbd processes that use/tmp/cluster/data instead. You can do this using the following command:
mcm> add process --set=ndbd:DataDir=/tmp/cluster/data > --processhosts=mysqld@tonfisk,mysqld@flundra > mycluster; Unlike the way you use theset command, an equal sign (=) immediately following the--set option is required.
When setting attributes this way, which involves specifying paths for processes running on Windows, you must replace any backslashes (\) used with forward slashes (/), just as with theset command. SeeSetting Attributes Containing Paths on Windows, for more information.
After a process has been added usingadd process, you can also use theset command to modify its configuration attribute settings (or specify additional ones) as you would with any other cluster process being managed with MySQL Cluster Manager.
When IPv6-enabled Windows systems are used as MySQL NDB Cluster hosts under MySQL Cluster Manager, you must reference these hosts using IPv4 addresses. Otherwise, MySQL Cluster Manager is unable to connect to the agent processes on those hosts. SeeSection 6.1, “MySQL Cluster Manager Usage and Design Limitations”.