In this section, we discuss the procedure for using MySQL Cluster Manager to create and start a new MySQL Cluster. We assume that you have already obtained the MySQL Cluster Manager and MySQL Cluster software, and that you are already familiar with installing MySQL Cluster Manager (see Chapter 2, MySQL Cluster Manager Installation, Configuration, Cluster Setup).
We also assume that you have identified the hosts on which you plan to run the cluster and have decided on the types and distributions of the different types of nodes among these hosts, as well as basic configuration requirements based on these factors and the hardware charactersitics of the host machines.
You can create and start a MySQL Cluster on a single host for
testing or similar purposes, simply by invoking
mcmd with the --bootstrap
option. See Section 2.5, “Starting and Stopping the MySQL Cluster Manager Agent”.
Creating a new cluster consists of the following tasks:
MySQL Cluster Manager agent installation and startup. Install the MySQL Cluster Manager software distribution, make any necessary edits of the agent configuration files, and start the agent processes as explained in Chapter 2, MySQL Cluster Manager Installation, Configuration, Cluster Setup. Agent processes must be running on all cluster hosts before you can create a cluster. This means that you need to place a complete copy of the MySQL Cluster Manager software distribution (including license files, which are supplied separately) on every host. The MySQL Cluster Manager software does not have to be in a specific location, or even the same location on all hosts, but it must be present; you cannot manage any cluster processes hosted on a computer where mcmd is not also running.
MySQL Cluster Manager client session startup. Starting the MySQL Cluster Manager client and connect to the MySQL Cluster Manager agent. You can connect to an agent process running on any of the cluster hosts, using the mcm client on any computer that can establish a network connection to the desired host. See Section 2.6, “Starting the MySQL Cluster Manager Client”, for details.
On systems where mcm is not available, you can use the mysql client for this purpose. See Connecting to the agent using the mysql client.
MySQL Cluster software deployment.
The simplest and easiest way to do this is to copy the
complete MySQL Cluster distribution to the same location
on every host in the cluster. (If you have installed MySQL Cluster Manager
1.1.6 on each host, the MySQL Cluster NDB 7.2.4
distribution is already included, in
.)
If you do not use the same location on every host, be sure
to note it for each host. Do not yet start any MySQL
Cluster processes or edit any configuration files; when
creating a new cluster, MySQL Cluster Manager takes care of these tasks
automatically.
mcm_installation_dir/cluster
On Windows hosts, you should not install as services any of the MySQL Cluster node process programs, including ndb_mgmd.exe, ndbd.exe, ndbmtd.exe, and mysqld.exe. MySQL Cluster Manager manages MySQL Cluster processes independently of the Windows Service Manager and does not interact with the Service Manager or any Windows services when doing so.
You can actually perform this step at any time up to the
point where the software package is registered (using
add package). However, we recommend
that you have all required software—including the
MySQL Cluster software—in place before executing any
MySQL Cluster Manager client commands.
Management site definition.
Using the create site command in the
MySQL Cluster Manager client, define a MySQL Cluster Manager management site—that
is, the set of hosts to be managed. This command provides
a name for the site, and must reference all hosts in the
cluster. Section 3.2.1, “The create site Command”, provides
syntax and other information about this command. To verify
that the site was created correctly, use the MySQL Cluster Manager client
commands list sites and list
hosts (see Section 3.2.3, “The list sites Command”, and
Section 3.2.5, “The list hosts Command”, for more information).
MySQL Cluster software package registration.
In this step, you provide the location of the MySQL
Cluster software on all hosts in the cluster using one or
more add package commands. (See
Section 3.3.1, “The add package Command”, for more information
about this command.) To verify that the package was
created correctly, use the list
packages and list processes
commands (see Section 3.3.3, “The list packages Command”, and
Section 3.8.5, “The list processes Command”).
Cluster definition.
Execute a create cluster command to
define the set of MySQL Cluster nodes (processes) and
hosts on which each cluster process runs, making up a the
MySQL Cluster. This command also uses the name of the
package registered in the previous step so that MySQL Cluster Manager
knows the location of the binary running each cluster
process. For more about this command, see
Section 3.4.1, “The create cluster Command”. You can use the
list clusters and list
processes commands to determine whether the
cluster has been defined as desired (see
Section 3.4.7, “The list clusters Command”, and
Section 3.8.5, “The list processes Command”, respectively, for
more information about these MySQL Cluster Manager client commands).
If you wish to use SQL node connection pooling, see Setup for mysqld connection pooling before creating the cluster.
Initial configuration.
Perform any configuration of the cluster that is required
or desired prior to starting it. You can set values for
MySQL Cluster Manager configuration attributes (MySQL Cluster parameters
and MySQL Server options) using the MySQL Cluster Manager client
set command, which is explained in
detail in Section 3.5.2, “The set Command”. You do not need to
edit any configuration files directly—in fact, you
should not do so. Keep in mind that
certain attributes are read-only, and that some others
cannot be reset after the cluster has been started for the
first time. You can use the get command
to verify that attributes have been set to the correct
values (see Section 3.5.1, “The get Command”).
Cluster startup.
Once you have completed the previous steps, including
necessary or desired initial configuration, you are ready
to start the cluster. The start cluster
command starts all cluster processes in the correct order.
You can verify that the cluster has started and is running
normally after this command has completed, using the MySQL Cluster Manager
client command show status (see
Section 3.6, “The show status Command”). At this point, the
cluster is ready for use by MySQL Cluster applications.