Each MySQL Cluster host computer running an SQL node must have installed on it a MySQL binary. For management nodes and data nodes, it is not necessary to install the MySQL server binary, but management nodes require the management server daemon (ndb_mgmd) and data nodes require the data node daemon (ndbd). It is also a good idea to install the management client (ndb_mgm) on the management server host. This section covers the steps necessary to install the correct binaries for each type of Cluster node.
Oracle provides precompiled binaries that support MySQL Cluster,
and there is generally no need to compile these yourself. However,
we also include information relating to installing a MySQL Cluster
after building MySQL from source. For setting up a cluster using
MySQL's binaries, the first step in the installation process
for each cluster host is to download the file
from the MySQL downloads
area. We assume that you have placed it in each machine's
/var/tmp directory. (If you do require a
custom binary, see Section 2.9.2, “Installing MySQL from a Development Source Tree”.)
RPMs are also available for both 32-bit and 64-bit Linux platforms. For a MySQL Cluster, four RPMs are required:
The Server RPM (for example,
which supplies the core files needed to run a MySQL Server.
The Server/Max RPM (for
which provides a MySQL Server binary with clustering support.
The NDB Cluster - Storage
engine RPM (for example,
which supplies the MySQL Cluster data node binary
The NDB Cluster - Storage engine
management RPM (for example,
which provides the MySQL Cluster management server binary
In addition, you should also obtain the NDB
Cluster - Storage engine basic tools RPM (for example,
which supplies several useful applications for working with a
MySQL Cluster. The most important of these is the MySQL Cluster
management client (ndb_mgm). The
NDB Cluster - Storage engine extra
tools RPM (for example,
contains some additional testing and monitoring programs, but is
not required to install a MySQL Cluster. (For more information
about these additional programs, see
Section 15.4, “MySQL Cluster Programs”.)
The MySQL version number in the RPM file names (shown here as
4.1.25) can vary according to the
version which you are actually using. It is very
important that all of the Cluster RPMs to be installed have the
same MySQL version number. The
version number (if present—shown here as
glibc23), and architecture designation (shown
i386) should be appropriate to the
machine on which the RPM is to be installed.
See Section 2.4, “Installing MySQL from RPM Packages on Linux”, for general information about installing MySQL using RPMs supplied by Oracle.
After installing from RPM, you still need to configure the cluster as discussed in Section 15.2.2, “MySQL Cluster Multi-Computer Configuration”.
After completing the installation, do not yet start any of the binaries. We show you how to do so following the configuration of all nodes.
Data and SQL Node Installation: .tar.gz Binary.
On each of the machines designated to host data or SQL nodes,
perform the following steps as the system
/etc/group files (or use whatever
tools are provided by your operating system for managing
users and groups) to see whether there is already a
mysql group and
mysql user on the system. Some OS
distributions create these as part of the operating system
installation process. If they are not already present,
create a new
mysql user group, and then
mysql user to this group:
useradd -g mysql mysql
The syntax for useradd and groupadd may differ slightly on different versions of Unix, or they may have different names such as adduser and addgroup.
Change location to the directory containing the downloaded
file, unpack the archive, and create a symlink to the
mysql-max directory named
mysql. Note that the actual file and
directory names will vary according to the MySQL version
tar -C /usr/local -xzvf mysql-max-4.1.25-pc-linux-gnu-i686.tar.gzshell>
ln -s /usr/local/mysql-max-4.1.25-pc-linux-gnu-i686 /usr/local/mysql
Change location to the
directory and run the supplied script for creating the
Set the necessary permissions for the MySQL server and data directories:
chown -R root .shell>
chown -R mysql datashell>
chgrp -R mysql .
Note that the data directory on each machine hosting a
data node is
This piece of information is essential when configuring
the management node. (See
Section 15.2.2, “MySQL Cluster Multi-Computer Configuration”.)
Copy the MySQL startup script to the appropriate directory, make it executable, and set it to start when the operating system is booted up:
cp support-files/mysql.server /etc/rc.d/init.d/shell>
chmod +x /etc/rc.d/init.d/mysql.servershell>
chkconfig --add mysql.server
(The startup scripts directory may vary depending on your
operating system and version—for example, in some
Linux distributions, it is
Here we use Red Hat's chkconfig for creating links to the startup scripts; use whatever means is appropriate for this purpose on your operating system and distribution, such as update-rc.d on Debian.
Remember that the preceding steps must be performed separately on each machine where an SQL node is to reside.
SQL node installation: RPM files. On each machine to be used for hosting a cluster SQL node, install the MySQL Max RPM by executing the following command as the system root user, replacing the name shown for the RPM as necessary to match the name of the RPM downloaded from the MySQL web site:
rpm -Uhv MySQL-server-4.1.25-0.glibc23.i386.rpmshell>
rpm -Uhv MySQL-Max-4.1.25-0.glibc23.i386.rpm
This installs the MySQL Max server binary
(mysqld-max) in the
/usr/sbin directory, as well as all needed
MySQL Server support files. It also installs the
mysqld_safe startup scripts in
/usr/bin, respectively. The RPM installer
should take care of general configuration issues (such as
mysql user and group, if needed)
SQL node installation: building from source.
If you compile MySQL with clustering support (for example, by
script appropriate to your platform), and perform the default
installation (using make install as the root
user), mysqld is placed in
/usr/local/mysql/bin. Follow the steps
given in Section 2.9, “Installing MySQL from Source” to make
mysqld ready for use. If you want to run
multiple SQL nodes, you can use a copy of the same
mysqld executable and its associated support
files on several machines. The easiest way to do this is to copy
/usr/local/mysql directory and
all directories and files contained within it to the other SQL
node host or hosts, then repeat the steps from
Section 2.9, “Installing MySQL from Source” on each machine. If you
configure the build with a nondefault
--prefix, you need to adjust
the directory accordingly.
Data node installation: RPM Files. On a computer that is to host a cluster data node it is necessary to install only the NDB Cluster - Storage engine RPM. To do so, copy this RPM to the data node host, and run the following command as the system root user, replacing the name shown for the RPM as necessary to match that of the RPM downloaded from the MySQL web site:
rpm -Uhv MySQL-ndb-storage-4.1.25-0.glibc23.i386.rpm
The previous command installs the MySQL Cluster data node binary
(ndbd) in the
Data node installation: building from source.
The only executable required on a data node host is
ndbd (mysqld, for example,
does not have to be present on the host machine). By default
when doing a source build, this file is placed in the directory
/usr/local/mysql/libexec. For installing on
multiple data node hosts, only ndbd need be
copied to the other host machine or machines. (This assumes that
all data node hosts use the same architecture and operating
system; otherwise you may need to compile separately for each
different platform.) ndbd need not be in any
particular location on the host's file system, as long as the
location is known.
Management node installation: .tar.gz binary.
Installation of the management node does not require the
mysqld binary. Only the MySQL Cluster
management server (ndb_mgmd) is required; you
most likely want to install the management client
(ndb_mgm) as well. Both of these binaries
also be found in the
Again, we assume that you have placed this archive in
root (that is, after using
sudo, su root, or your
system's equivalent for temporarily assuming the system
administrator account's privileges), perform the following steps
to install ndb_mgmd and
ndb_mgm on the Cluster management node host:
tar -zxvf mysql-4.1.25-pc-linux-gnu-i686.tar.gzshell>
cp bin/ndb_mgm* /usr/local/bin
Change location to the directory into which you copied the files, and then make both of them executable:
chmod +x ndb_mgm*
Management node installation: RPM file. To install the MySQL Cluster management server, it is necessary only to use the NDB Cluster - Storage engine management RPM. Copy this RPM to the computer intended to host the management node, and then install it by running the following command as the system root user (replace the name shown for the RPM as necessary to match that of the Storage engine management RPM downloaded from the MySQL web site):
rpm -Uhv MySQL-ndb-management-4.1.25-0.glibc23.i386.rpm
This installs the management server binary
(ndb_mgmd) to the
You should also install the
management client, which is supplied by the
Storage engine basic tools RPM.
Copy this RPM to the same computer as the management node, and
then install it by running the following command as the system
root user (again, replace the name shown for the RPM as necessary
to match that of the Storage engine basic
tools RPM downloaded from the MySQL web site):
shell> rpm -Uhv
The Storage engine basic tools
RPM installs the MySQL Cluster management client
(ndb_mgm) to the
Management node installation: building from source.
When building from source and running the default make
install, the management server binary
(ndb_mgmd) is placed in
/usr/local/mysql/libexec, while the
management client binary (ndb_mgm) can be
ndb_mgmd is required to be present on a
management node host; however, it is also a good idea to have
ndb_mgm present on the same host machine.
Neither of these executables requires a specific location on the
host machine's file system.
In Section 15.2.2, “MySQL Cluster Multi-Computer Configuration”, we create configuration files for all of the nodes in our example Cluster.