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; in MySQL Cluster NDB 7.0 and later, you can use ndbmtd instead). 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.
Sun Microsystems, Inc. provides precompiled binaries that support
Cluster. 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 latest MySQL Cluster NDB 6.2, MySQL Cluster NDB 6.3, or MySQL
Cluster NDB 7.0 binary archive
(mysql-cluster-gpl-6.2.19-linux-i686-glibc23.tar.gz
,
mysql-cluster-gpl-6.3.34-linux-i686-glibc23.tar.gz
,
or
mysql-cluster-gpl-7.0.15-linux-i686-glibc23.tar.gz
,
respectively) from the
MySQL Cluster downloads
area. We assume that you have placed this file in each
machine's /var/tmp
directory. (If you do
require a custom binary, see
Section 2.3.3, “Installing from the Development Source Tree”.)
When compiling MySQL Cluster NDB 7.0 from source, no special
options are required for building multi-threaded data node
binaries. On Unix platforms, configuring the build with any of the
options --plugins=ndbcluster
,
--plugins=max
, or,
--plugins=max-no-innodb
causes
ndbmtd to be built automatically; make
install places the ndbmtd binary in
the libexec
directory along with
mysqld, ndbd, and
ndb_mgm.
On Windows, beginning with MySQL Cluster NDB 7.0.11, using
WITH_NDBCLUSTER_STORAGE_ENGINE
with
configure.js causes
ndbmtd.exe to be built automatically, and to be
found in the bin
directory of the archive
created by make_win_bin_dist.
Currently, MySQL Cluster is not compatible with the
InnoDB Plugin
. You must use the version of
InnoDB
that is supplied with the
MySQL Server. You can build MySQL Cluster with
InnoDB
storage engine support using
the --with-plugins=max
or
--with-innodb
option for
configure.
This is a known issue, which we are working to address in a future MySQL Cluster release.
RPMs are also available for both 32-bit and 64-bit Linux platforms. For a MySQL Cluster, three RPMs are required:
The Server RPM (for example,
MySQL-Cluster-gpl-server-6.2.19-0.sles10.i586.rpm
,
MySQL-Cluster-gpl-server-6.3.34-0.sles10.i586.rpm
,
or
MySQL-Cluster-gpl-server-7.0.15-0.sles10.i586.rpm
),
which supplies the core files needed to run a MySQL Server
with NDBCLUSTER
storage engine
support (that is, as a MySQL Cluster SQL node).
If you do not have your own client application capable of
administering a MySQL server, you should also obtain and
install the Client RPM (for
example,
MySQL-Cluster-gpl-client-6.2.19-0.sles10.i586.rpm
,
MySQL-Cluster-gpl-client-6.3.34-0.sles10.i586.rpm
,
or
MySQL-Cluster-gpl-client-7.0.15-0.sles10.i586.rpm
).
The Cluster storage engine
RPM (for example,
MySQL-Cluster-gpl-storage-6.2.19-0.sles10.i586.rpm
,
MySQL-Cluster-gpl-storage-6.3.34-0.sles10.i586.rpm
,
or
MySQL-Cluster-gpl-storage-7.0.15-0.sles10.i586.rpm
),
which supplies the MySQL Cluster data node binary
(ndbd).
The Cluster storage engine management
RPM (for example,
MySQL-Cluster-gpl-management-6.2.19-0.sles10.i586.rpm
,
MySQL-Cluster-gpl-management-6.3.34-0.sles10.i586.rpm
,
or
MySQL-Cluster-gpl-management-7.0.15-0.sles10.i586.rpm
)
which provides the MySQL Cluster management server binary
(ndb_mgmd).
In addition, you should also obtain the NDB
Cluster - Storage engine basic tools RPM (for example,
MySQL-Cluster-gpl-tools-6.2.19-0.sles10.i586.rpm
,
MySQL-Cluster-gpl-tools-6.3.34-0.sles10.i586.rpm
,
or
MySQL-Cluster-gpl-tools-7.0.15-0.sles10.i586.rpm
),
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,
MySQL-Cluster-gpl-extra-6.2.19-0.sles10.i586.rpm
,
MySQL-Cluster-gpl-extra-6.3.34-0.sles10.i586.rpm
,
or
MySQL-Cluster-gpl-extra-7.0.15-0.sles10.i586.rpm
)
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 17.4, “MySQL Cluster Programs”.)
The MySQL Cluster version number in the RPM file names (shown here
as 6.2.19
,
6.3.34
, or
7.0.15
) 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 version number. The glibc
version number (if present), and architecture designation (shown
here as i586
) should be appropriate to the
machine on which the RPM is to be installed.
See Section 2.6.1, “Installing MySQL from RPM Packages on Linux”, for general information about installing MySQL using RPMs supplied by Sun Microsystems, Inc.
After installing from RPM, you still need to configure the cluster as discussed in Section 17.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
root
user:
Check your /etc/passwd
and
/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
add a mysql
user to this group:
shell>groupadd mysql
shell>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
directory named
mysql
. Note that the actual file and
directory names will vary according to the MySQL Cluster
version number.
shell>cd /var/tmp
shell>tar -C /usr/local -xzvf mysql-cluster-gpl-7.0.15-linux-i686-glibc23.tar.gz
shell>ln -s /usr/local/mysql-cluster-gpl-7.0.15-linux-i686-glibc23.tar.gz /usr/local/mysql
Change location to the mysql
directory and run the supplied script for creating the
system databases:
shell>cd mysql
shell>scripts/mysql_install_db --user=mysql
Set the necessary permissions for the MySQL server and data directories:
shell>chown -R root .
shell>chown -R mysql data
shell>chgrp -R mysql .
Note that the data directory on each machine hosting a
data node is /usr/local/mysql/data
.
This piece of information is essential when configuring
the management node. (See
Section 17.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:
shell>cp support-files/mysql.server /etc/rc.d/init.d/
shell>chmod +x /etc/rc.d/init.d/mysql.server
shell>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
/etc/init.d
.)
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 repeated 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 Server 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:
shell> rpm -Uhv MySQL-Cluster-gpl-server-7.0.15-0.sles10.i586.rpm
This installs the MySQL server binary
(mysqld) in the
/usr/sbin
directory, as well as all needed
MySQL Server support files. It also installs the
mysql.server and
mysqld_safe startup scripts in
/usr/share/mysql
and
/usr/bin
, respectively. The RPM installer
should take care of general configuration issues (such as
creating the mysql
user and group, if needed)
automatically.
To administer the SQL node (MySQL server), you should also install the Client RPM, as shown here:
shell> rpm -Uhv MySQL-Cluster-gpl-client-7.0.15-0.sles10.i586.rpm
This installs the mysql client program.
SQL node installation — building from source.
If you compile MySQL with clustering support (for example, by
using the
BUILD/compile-platform_name
-max
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.3, “MySQL Installation Using a Source Distribution” 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
the entire /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.3, “MySQL Installation Using a Source Distribution” 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:
shell> rpm -Uhv MySQL-Cluster-gpl-storage-7.0.15-0.sles10.i586.rpm
The previous command installs the MySQL Cluster data node binary
(ndbd) in the /usr/sbin
directory.
Data node installation — building from source.
The only executable required on a data node host is
ndbd or (in MySQL Cluster NDB 7.0 and later)
ndbmtd (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.
ndbmtd was not built on Windows prior to MySQL Cluster NDB 7.0.11.
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 .tar.gz
archive.
Again, we assume that you have placed this archive in
/var/tmp
.
As system 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:
Change location to the /var/tmp
directory, and extract the ndb_mgm and
ndb_mgmd from the archive into a suitable
directory such as /usr/local/bin
:
shell>cd /var/tmp
shell>tar -zxvf mysql-5.1.44-ndb-7.0.15-linux-i686-glibc23.tar.gz
shell>cd mysql-5.1.44-ndb-7.0.15-linux-i686-glibc23
shell>cp bin/ndb_mgm* /usr/local/bin
(You can safely delete the directory created by unpacking
the downloaded archive, and the files it contains, from
/var/tmp
once
ndb_mgm and ndb_mgmd
have been copied to the executables directory.)
Change location to the directory into which you copied the files, and then make both of them executable:
shell>cd /usr/local/bin
shell>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):
shell> rpm -Uhv MySQL-Cluster-gpl-management-7.0.15-0.sles10.i586.rpm
This installs the management server binary
(ndb_mgmd) to the
/usr/sbin
directory.
You should also install the NDB
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 MySQL-Cluster-gpl-tools-7.0.15-0.sles10.i586.rpm
The Storage engine basic tools
RPM installs the MySQL Cluster management client
(ndb_mgm) to the /usr/bin
directory.
You can also install the Cluster storage engine extra tools RPM, if you wish, as shown here:
shell> rpm -Uhv MySQL-Cluster-gpl-extra-7.0.15-0.sles10.i586.rpm
You may find the extra tools useful; however the Cluster storage engine extra tools RPM is not required to install a working MySQL Cluster.
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
found in /usr/local/mysql/bin
. Only
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 17.2.2, “MySQL Cluster Multi-Computer Configuration”, we create configuration files for all of the nodes in our example MySQL Cluster.
MySQL Cluster on Windows (alpha).
In MySQL Cluster NDB 7.0, experimental support is added for
Microsoft Windows platforms. To compile MySQL Cluster from
source on Windows, you must configure the build using the
WITH_NDBCLUSTER_STORAGE_ENGINE
option before
creating the Visual Studio project files. After running
make_win_bin_dist, the MySQL Cluster binaries
can be found in the bin
directory of the
resulting archive. For more information, see
Section 2.5.10, “Installing MySQL from Source on Windows”.
User Comments
Add your own comment.