4.6.1 The add process Command

add process --processhosts=process_host_list 
    [--set=attribute_assignment_list] cluster_name

process_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 a process_host_list, the format of which is the same as that used with the create 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.

Any new processes added by this command must be started explicitly using the command start process --added.

For example, the following add process command adds two mysqld processes on hosts tonfisk and flundra to the cluster named mycluster:

mcm> add process --processhosts=mysqld@tonfisk,mysqld@flundra mycluster;
+------------------------------+
| Command result               |
+------------------------------+
| Processes added successfully | 
+------------------------------+
1 row in set (2 min 10.39 sec)

You can also manually assign a node ID to the new process you are adding to the cluster by adding :node_ID. after the process_name. For MySQL Cluster Manager 1.3.3 and earlier, trying to manually assign node IDs less than 49 for ndb_mgmd, mysqld, or ndbapi fails with an error; the restriction, however, has been lifted since MySQL Cluster Manager 1.3.4. Nevertheless, you are still recommended to follow the best practice of reserving node ID 1 to 48 for data nodes. The following command adds two ndbd processes with node IDs 10 and 11 on hosts tonfisk and flundra, respectively, to mycluster:

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)

Adding Free Processes

Using the add process command, you can add unmanaged mysqld processes, or ndbapi slots for ndbapi applications such as ndb_restore. To add an unmanaged mysqld 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 unmanaged mysqld 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 to ndbapi slots for ndbapi applications such as ndb_restore: prefix the hostname with the wildcard character to limit connectivity to a specific host, or use only a wildcard, without hostname, to allow ndbapi 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 the start process --added command after they have been successfully added to the cluster.

Using add process to Simplify create cluster 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 long create cluster commands. Consider the following set of commands which creates and then starts a cluster named mycluster:

create cluster --processhosts=ndb_mgmd@host1,ndbd@host1,ndbd@host2, \
  mysqld@host3,mysqld@host4 mycluster;
start cluster mycluster;

The long create cluster command can be divided into a shorter (and more manageable) version of itself, plus several add process commands. This set of commands performs the same task as the previous set, creating mycluster 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;

Because mycluster was never started before the ndbd and mysqld processes were added to it using the add process commands shown, it is not necessary to use the --added option with the start cluster command in this case; all 5 processes are started.

A process that is added to a cluster that was created using create cluster --import and before the import takes place is added with status import, which means it cannot be started or stopped using start process or stop 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. (See Configuration attributes, for more information about the scope of attribute settings.)

Inherited attribute settings can be overridden when adding processes; to do this, use the add process command's --set option. This option takes as its argument an attribute assignment list similar in format to that used with the get and set commands. Suppose that the current ndbd process-level setting in the cluster named mycluster for the DataDir attribute is /home/users/ndb/cluster-data, but you wish to add two new ndbd 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;
Note

Unlike the way you use the set command, a equals sign (=) immediately following the --set option is required.

When setting attributes in this way which contain paths for processes running on Windows, you must replace any backslashes (\) used with forward slashes (/), just as with the set command. See Setting Attributes Containing Paths on Windows, for more information.

After a process has been added using add process, you can also use the set 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.

Note

When IPv6-enabled Windows systems are used as MySQL Cluster hosts under MySQL Cluster Manager, you must reference these hosts using IPv4 addresses. Otherwise, MySQL Cluster Manager will be unable to connect to the agent processes on those hosts. See Section 5.1, “MySQL Cluster Manager Usage and Design Limitations”.