In this section, we discuss the procedure for using MySQL Cluster Manager to create and start a new MySQL NDB Cluster. We assume that you have already obtained the MySQL Cluster Manager and MySQL NDB Cluster software, and that you are already familiar with installing MySQL Cluster Manager (see Chapter 3, MySQL Cluster Manager Installation, Configuration, Cluster Setup).
MySQL Cluster Manager also supports importing existing, standalone MySQL NDB Clusters; for more information, see Section 4.5, “Importing MySQL NDB Clusters into MySQL Cluster Manager”.
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 characteristics of the host machines.
You can create and start a MySQL NDB Cluster on a single host for
testing or similar purposes, simply by invoking
mcmd with the --bootstrap
option. See Section 4.2, “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 3, 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 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 4.3, “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 NDB Cluster software deployment. The simplest and easiest way to do this is to copy the complete MySQL NDB Cluster distribution to the same location on every host in the cluster. (If you have installed MySQL Cluster Manager 9.0.1 on each host, the MySQL NDB Cluster 9.0.1 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 NDB Cluster processes or edit any configuration files; when creating a new cluster, MySQL Cluster Manager takes care of these tasks automatically.mcm_installation_dir
/clusterOn Windows hosts, you should not install as services any of the MySQL NDB Cluster node process programs, including ndb_mgmd.exe, ndbd.exe, ndbmtd.exe, and mysqld.exe. MySQL Cluster Manager manages MySQL NDB Cluster processes independently of the Windows Service Manager and does not interact with the Service Manager or any Windows services when doing so.
NoteYou 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 NDB 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 5.2.6, “Thecreate site
Command”, provides syntax and other information about this command. To verify that the site was created correctly, use the MySQL Cluster Manager client commandslist sites
andlist hosts
.MySQL NDB Cluster software package registration. In this step, you provide the location of the MySQL NDB Cluster software on all hosts in the cluster using one or more
add package
commands. To verify that the package was created correctly, use thelist packages
andlist processes
commands.Cluster definition. Execute a
create cluster
command to define the set of MySQL NDB Cluster nodes (processes) and hosts on which each cluster process runs, making up a the MySQL NDB 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. You can use thelist clusters
andlist processes
commands to determine whether the cluster has been defined as desired.If you wish to use SQL node connection pooling, see Setting up 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 NDB Cluster parameters and MySQL Server options) using the MySQL Cluster Manager client
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 theget
command to verify that attributes have been set to the correct values.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 commandshow status
. At this point, the cluster is ready for use by MySQL NDB Cluster applications.