add process {--processhosts=|-R }process_host_list
[--set=attribute_assignment_list] [--verbose | -v] [--sequential-restart] 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
with the
--processhosts
option, 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.
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)
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 the node_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 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)
If the cluster is not running when you run the
add process
command, it is
recommended that you start all the new processes added by this
command together using the start
process
--added
command or
start them together with the whole cluster using the
start 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 a
CREATE NODEGROUP
command to
the cluster. If the added nodes are started with
start process
--initial
instead,
you are then required to run CREATE
NODEGROUP
manually via the ndb_mgm
client.
If the cluster is running when you run the
add process
command, a rolling
restart for the cluster is performed at the end of the
add process
command. Use the
--sequential-restart
option to make the rolling restart a
sequential
one.
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
command after they have been successfully added to the cluster.
--added
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 that 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;
Notice that 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;
Unlike the way you use the
set
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 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.
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. See Section 6.1, “MySQL Cluster Manager Usage and Design Limitations”.