Menu:
mysql-cluster-installer:: The NDB Cluster Auto-Installer (NO LONGER SUPPORTED)
This section describes the basics for planning, installing, configuring, and running an NDB Cluster. Whereas the examples in *note mysql-cluster-configuration:: provide more in-depth information on a variety of clustering options and configuration, the result of following the guidelines and procedures outlined here should be a usable NDB Cluster which meets the minimum requirements for availability and safeguarding of data.
For information about upgrading or downgrading an NDB Cluster between release versions, see *note mysql-cluster-upgrade-downgrade::.
This section covers hardware and software requirements; networking issues; installation of NDB Cluster; basic configuration issues; starting, stopping, and restarting the cluster; loading of a sample database; and performing queries.
Assumptions
The following sections make a number of assumptions regarding the cluster's physical and network configuration. These assumptions are discussed in the next few paragraphs.
Cluster nodes and host computers
The cluster consists of four nodes, each on a separate host computer, and each with a fixed network address on a typical Ethernet network as shown here:
Network addresses of nodes in example cluster
Node IP Address
Management node ('mgmd') 198.51.100.10
SQL node (*note 'mysqld': mysqld.) 198.51.100.20
Data node "A" 198.51.100.30 (*note 'ndbd': mysql-cluster-programs-ndbd.)
Data node "B" 198.51.100.40 (*note 'ndbd': mysql-cluster-programs-ndbd.)
This setup is also shown in the following diagram:
FIGURE GOES HERE: NDB Cluster Multi-Computer Setup
Network addressing
In the interest of simplicity (and reliability), this 'How-To' uses only numeric IP addresses. However, if DNS resolution is available on your network, it is possible to use host names in lieu of IP addresses in configuring Cluster. Alternatively, you can use the 'hosts' file (typically '/etc/hosts' for Linux and other Unix-like operating systems, 'C:32' on Windows, or your operating system's equivalent) for providing a means to do host lookup if such is available.
Potential hosts file issues
A common problem when trying to use host names for Cluster nodes arises because of the way in which some operating systems (including some Linux distributions) set up the system's own host name in the '/etc/hosts' during installation. Consider two machines with the host names 'ndb1' and 'ndb2', both in the 'cluster' network domain. Red Hat Linux (including some derivatives such as CentOS and Fedora) places the following entries in these machines' '/etc/hosts' files:
# ndb1 /etc/hosts:
127.0.0.1 ndb1.cluster ndb1 localhost.localdomain localhost
# ndb2 /etc/hosts:
127.0.0.1 ndb2.cluster ndb2 localhost.localdomain localhost
SUSE Linux (including OpenSUSE) places these entries in the machines' '/etc/hosts' files:
# ndb1 /etc/hosts:
127.0.0.1 localhost
127.0.0.2 ndb1.cluster ndb1
# ndb2 /etc/hosts:
127.0.0.1 localhost
127.0.0.2 ndb2.cluster ndb2
In both instances, 'ndb1' routes 'ndb1.cluster' to a loopback IP address, but gets a public IP address from DNS for 'ndb2.cluster', while 'ndb2' routes 'ndb2.cluster' to a loopback address and obtains a public address for 'ndb1.cluster'. The result is that each data node connects to the management server, but cannot tell when any other data nodes have connected, and so the data nodes appear to hang while starting.
Caution:
You cannot mix 'localhost' and other host names or IP addresses in 'config.ini'. For these reasons, the solution in such cases (other than to use IP addresses for all 'config.ini' 'HostName' entries) is to remove the fully qualified host names from '/etc/hosts' and use these in 'config.ini' for all cluster hosts.
Host computer type
Each host computer in our installation scenario is an Intel-based desktop PC running a supported operating system installed to disk in a standard configuration, and running no unnecessary services. The core operating system with standard TCP/IP networking capabilities should be sufficient. Also for the sake of simplicity, we also assume that the file systems on all hosts are set up identically. In the event that they are not, you should adapt these instructions accordingly.
Network hardware
Standard 100 Mbps or 1 gigabit Ethernet cards are installed on each machine, along with the proper drivers for the cards, and that all four hosts are connected through a standard-issue Ethernet networking appliance such as a switch. (All machines should use network cards with the same throughput. That is, all four machines in the cluster should have 100 Mbps cards or all four machines should have 1 Gbps cards.) NDB Cluster works in a 100 Mbps network; however, gigabit Ethernet provides better performance.
Important:
NDB Cluster is not intended for use in a network for which throughput is less than 100 Mbps or which experiences a high degree of latency. For this reason (among others), attempting to run an NDB Cluster over a wide area network such as the Internet is not likely to be successful, and is not supported in production.
Sample data
We use the 'world' database which is available for download from the MySQL website (see https://dev.mysql.com/doc/index-other.html). We assume that each machine has sufficient memory for running the operating system, required NDB Cluster processes, and (on the data nodes) storing the database.
For general information about installing MySQL, see note installing::. For information about installation of NDB Cluster on Linux and other Unix-like operating systems, see note mysql-cluster-install-linux::. For information about installation of NDB Cluster on Windows operating systems, see *note mysql-cluster-install-windows::.
For general information about NDB Cluster hardware, software, and networking requirements, see *note mysql-cluster-overview-requirements::.
File: manual.info.tmp, Node: mysql-cluster-install-linux, Next: mysql-cluster-install-windows, Prev: mysql-cluster-installation, Up: mysql-cluster-installation
Menu:
mysql-cluster-install-linux-source:: Building NDB Cluster from Source on Linux
This section covers installation methods for NDB Cluster on Linux and other Unix-like operating systems. While the next few sections refer to a Linux operating system, the instructions and procedures given there should be easily adaptable to other supported Unix-like platforms. For manual installation and setup instructions specific to Windows systems, see *note mysql-cluster-install-windows::.
Each NDB Cluster host computer must have the correct executable programs installed. A host running an SQL node must have installed on it a MySQL Server binary (note 'mysqld': mysqld.). Management nodes require the management server daemon (note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd.); data nodes require the data node daemon (note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd.). It is not necessary to install the MySQL Server binary on management node hosts and data node hosts. It is recommended that you also install the management client (*note 'ndb_mgm': mysql-cluster-programs-ndb-mgm.) on the management server host.
Installation of NDB Cluster on Linux can be done using precompiled binaries from Oracle (downloaded as a .tar.gz archive), with RPM packages (also available from Oracle), or from source code. All three of these installation methods are described in the section that follow.
Regardless of the method used, it is still necessary following installation of the NDB Cluster binaries to create configuration files for all cluster nodes, before you can start the cluster. See *note mysql-cluster-install-configuration::.
File: manual.info.tmp, Node: mysql-cluster-install-linux-binary, Next: mysql-cluster-install-linux-rpm, Prev: mysql-cluster-install-linux, Up: mysql-cluster-install-linux
21.3.1.1 Installing an NDB Cluster Binary Release on Linux ..........................................................
This section covers the steps necessary to install the correct executables for each type of Cluster node from precompiled binaries supplied by Oracle.
For setting up a cluster using precompiled binaries, the first step in the installation process for each cluster host is to download the binary archive from the NDB Cluster downloads page (https://dev.mysql.com/downloads/cluster/). (For the most recent 64-bit NDB 7.6 release, this is 'mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64.tar.gz'.) We assume that you have placed this file in each machine's '/var/tmp' directory.
If you require a custom binary, see *note installing-development-tree::.
Note:
After completing the installation, do not yet start any of the binaries. We show you how to do so following the configuration of the nodes (see *note mysql-cluster-install-configuration::).
SQL nodes
On each of the machines designated to host 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:
$> groupadd mysql
$> useradd -g mysql -s /bin/false 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 symbolic link named 'mysql' to the 'mysql' directory.
Note:
The actual file and directory names vary according to the NDB Cluster version number.
$> cd /var/tmp
$> tar -C /usr/local -xzvf mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64.tar.gz
$> ln -s /usr/local/mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64 /usr/local/mysql
Change location to the 'mysql' directory and set up the system databases using *note 'mysqld': mysqld. '--initialize' as shown here:
$> cd mysql
$> mysqld --initialize
This generates a random password for the MySQL 'root' account. If you do not want the random password to be generated, you can substitute the '--initialize-insecure' option for '--initialize'. In either case, you should review note data-directory-initialization::, for additional information before performing this step. See also note mysql-secure-installation::.
Set the necessary permissions for the MySQL server and data directories:
$> chown -R root .
$> chown -R mysql data
$> chgrp -R mysql .
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/
$> chmod +x /etc/rc.d/init.d/mysql.server
$> 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 platform, 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.
Data nodes
Installation of the data nodes does not require the note 'mysqld': mysqld. binary. Only the NDB Cluster data node executable note 'ndbd': mysql-cluster-programs-ndbd. (single-threaded) or *note 'ndbmtd': mysql-cluster-programs-ndbmtd. (multithreaded) is required. These binaries can 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 the data node binaries on the data node hosts:
Change location to the '/var/tmp' directory, and extract the note 'ndbd': mysql-cluster-programs-ndbd. and note 'ndbmtd': mysql-cluster-programs-ndbmtd. binaries from the archive into a suitable directory such as '/usr/local/bin':
$> cd /var/tmp
$> tar -zxvf mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64.tar.gz
$> cd mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64
$> cp bin/ndbd /usr/local/bin/ndbd
$> cp bin/ndbmtd /usr/local/bin/ndbmtd
(You can safely delete the directory created by unpacking the downloaded archive, and the files it contains, from '/var/tmp' once note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. and note 'ndb_mgmd': mysql-cluster-programs-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:
$> cd /usr/local/bin
$> chmod +x ndb*
The preceding steps should be repeated on each data node host.
Although only one of the data node executables is required to run an NDB Cluster data node, we have shown you how to install both note 'ndbd': mysql-cluster-programs-ndbd. and note 'ndbmtd': mysql-cluster-programs-ndbmtd. in the preceding instructions. We recommend that you do this when installing or upgrading NDB Cluster, even if you plan to use only one of them, since this should save time and trouble in the event that you later decide to change from one to the other.
Note:
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 *note mysql-cluster-install-configuration::.)
Management nodes
Installation of the management node does not require the note 'mysqld': mysqld. binary. Only the NDB Cluster management server (note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd.) is required; you most likely want to install the management client (*note 'ndb_mgm': mysql-cluster-programs-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', perform the following steps to install note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. and note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. on the management node host:
Change location to the '/var/tmp' directory, and extract the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. and note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. from the archive into a suitable directory such as '/usr/local/bin':
$> cd /var/tmp
$> tar -zxvf mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64.tar.gz
$> cd mysql-cluster-gpl-7.6.33-linux-glibc2.12-x86_64
$> 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 note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. and note 'ndb_mgmd': mysql-cluster-programs-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:
$> cd /usr/local/bin
$> chmod +x ndb_mgm*
In *note mysql-cluster-install-configuration::, we create configuration files for all of the nodes in our example NDB Cluster.
File: manual.info.tmp, Node: mysql-cluster-install-linux-rpm, Next: mysql-cluster-install-debian, Prev: mysql-cluster-install-linux-binary, Up: mysql-cluster-install-linux
21.3.1.2 Installing NDB Cluster from RPM ........................................
This section covers the steps necessary to install the correct executables for each type of NDB Cluster node using RPM packages supplied by Oracle.
As an alternative to the method described in this section, Oracle provides MySQL Repositories for NDB Cluster 7.5.6 and later that are compatible with many common Linux distributions. Two repostories, listed here, are available for RPM-based distributions:
For distributions using 'yum' or 'dnf', you can use the MySQL Yum Repository for NDB Cluster. See 'Installing MySQL NDB Cluster Using the Yum Repository' (https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/#repo-qg-yum-fresh-cluster-install), for instructions and additional information.
For SLES, you can use the MySQL SLES Repository for NDB Cluster. See 'Installing MySQL NDB Cluster Using the SLES Repository' (https://dev.mysql.com/doc/mysql-sles-repo-quick-guide/en/#repo-qg-sles-fresh-cluster-install), for instructions and additional information.
RPMs are available for both 32-bit and 64-bit Linux platforms. The filenames for these RPMs use the following pattern:
mysql-cluster-community-data-node-7.5.8-1.el7.x86_64.rpm
mysql-cluster-LICENSE-COMPONENT-VER-REV.DISTRO.ARCH.rpm
LICENSE:= {commercial | community}
COMPONENT: {management-server | data-node | server | client | OTHER---SEE TEXT}
VER: MAJOR.MINOR.RELEASE
REV: MAJOR[.MINOR]
DISTRO: {el6 | el7 | sles12}
ARCH: {i686 | x86_64}
LICENSE indicates whether the RPM is part of a Commercial or Community release of NDB Cluster. In the remainder of this section, we assume for the examples that you are installing a Community release.
Possible values for COMPONENT, with descriptions, can be found in the following table:
Components of the NDB Cluster RPM distribution
Component Description
'auto-installer' NDB Cluster Auto Installer program (DEPRECATED); see *note mysql-cluster-install-auto::, for usage
'client' MySQL and 'NDB' client programs; includes note 'mysql': mysql. client, note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client, and other client tools
'common' Character set and error message information needed by the MySQL server
'data-node' note 'ndbd': mysql-cluster-programs-ndbd. and note 'ndbmtd': mysql-cluster-programs-ndbmtd. data node binaries
'devel' Headers and library files needed for MySQL client development
'embedded' Embedded MySQL server
'embedded-compat' Backwards-compatible embedded MySQL server
'embedded-devel' Header and library files for developing applications for embedded MySQL
'java' JAR files needed for support of ClusterJ applications
'libs' MySQL client libraries
'libs-compat' Backwards-compatible MySQL client libraries
'management-server' The NDB Cluster management server (*note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd.)
'memcached' Files needed to support 'ndbmemcache'
'minimal-debuginfo' Debug information for package server-minimal; useful when developing applications that use this package or when debugging this package
'ndbclient' 'NDB' client library for running NDB API and MGM API applications ('libndbclient')
'ndbclient-devel' Header and other files needed for developing NDB API and MGM API applications
'nodejs' Files needed to set up Node.JS support for NDB Cluster
'server' The MySQL server (*note 'mysqld': mysqld.) with 'NDB' storage engine support included, and associated MySQL server programs
'server-minimal' Minimal installation of the MySQL server for NDB and related tools
'test' 'mysqltest', other MySQL test programs, and support files
A single bundle ('.tar' file) of all NDB Cluster RPMs for a given platform and architecture is also available. The name of this file follows the pattern shown here:
mysql-cluster-LICENSE-VER-REV.DISTRO.ARCH.rpm-bundle.tar
You can extract the individual RPM files from this file using 'tar' or your preferred tool for extracting archives.
The components required to install the three major types of NDB Cluster nodes are given in the following list:
Management node: 'management-server'
Data node: 'data-node'
SQL node: 'server' and 'common'
In addition, the 'client' RPM should be installed to provide the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. management client on at least one management node. You may also wish to install it on SQL nodes, to have note 'mysql': mysql. and other MySQL client programs available on these. We discuss installation of nodes by type later in this section.
VER represents the three-part 'NDB' storage engine version number in 7.6.X format, shown as '7.6.33' in the examples. 'rev' provides the RPM revision number in MAJOR.MINOR format. In the examples shown in this section, we use '1.1' for this value.
The DISTRO (Linux distribution) is one of 'rhel5' (Oracle Linux 5, Red Hat Enterprise Linux 4 and 5), 'el6' (Oracle Linux 6, Red Hat Enterprise Linux 6), 'el7' (Oracle Linux 7, Red Hat Enterprise Linux 7), or 'sles12' (SUSE Enterprise Linux 12). For the examples in this section, we assume that the host runs Oracle Linux 7, Red Hat Enterprise Linux 7, or the equivalent ('el7').
ARCH is 'i686' for 32-bit RPMs and 'x86_64' for 64-bit versions. In the examples shown here, we assume a 64-bit platform.
The NDB Cluster version number in the RPM file names (shown here as '7.6.33') 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 architecture should also be appropriate to the machine on which the RPM is to be installed; in particular, you should keep in mind that 64-bit RPMs ('x86_64') cannot be used with 32-bit operating systems (use 'i686' for the latter).
Data nodes
On a computer that is to host an NDB Cluster data node it is necessary to install only the 'data-node' 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 website:
$> rpm -Uhv mysql-cluster-community-data-node-7.6.33-1.el7.x86_64.rpm
This installs the note 'ndbd': mysql-cluster-programs-ndbd. and note 'ndbmtd': mysql-cluster-programs-ndbmtd. data node binaries in '/usr/sbin'. Either of these can be used to run a data node process on this host.
SQL nodes
Copy the 'server' and 'common' RPMs to each machine to be used for hosting an NDB Cluster SQL node ('server' requires 'common'). 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 website:
$> rpm -Uhv mysql-cluster-community-server-7.6.33-1.el7.x86_64.rpm
This installs the MySQL server binary (note 'mysqld': mysqld.), with 'NDB' storage engine support, in the '/usr/sbin' directory. It also installs all needed MySQL Server support files and useful MySQL server programs, including the note 'mysql.server': mysql-server. and *note 'mysqld_safe': 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.
Important:
You must use the versions of these RPMs released for NDB Cluster; those released for the standard MySQL server do not provide support for the 'NDB' storage engine.
To administer the SQL node (MySQL server), you should also install the 'client' RPM, as shown here:
$> rpm -Uhv mysql-cluster-community-client-7.6.33-1.el7.x86_64.rpm
This installs the note 'mysql': mysql. client and other MySQL client programs, such as note 'mysqladmin': mysqladmin. and *note 'mysqldump': mysqldump, to '/usr/bin'.
Management nodes
To install the NDB Cluster management server, it is necessary only to use the 'management-server' 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 'management-server' RPM downloaded from the MySQL website):
$> rpm -Uhv mysql-cluster-community-management-server-7.6.33-1.el7.x86_64.rpm
This RPM installs the management server binary note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. in the '/usr/sbin' directory. While this is the only program actually required for running a management node, it is also a good idea to have the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. NDB Cluster management client available as well. You can obtain this program, as well as other 'NDB' client programs such as note 'ndb_desc': mysql-cluster-programs-ndb-desc. and note 'ndb_config': mysql-cluster-programs-ndb-config, by installing the 'client' RPM as described previously.
Note:
Previously, note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. was installed by the same RPM used to install the management server. In NDB 7.5 (and later), all 'NDB' client programs are obtained from the same 'client' RPM that installs note 'mysql': mysql. and other MySQL clients.
See *note linux-installation-rpm::, for general information about installing MySQL using RPMs supplied by Oracle.
After installing from RPM, you still need to configure the cluster; see *note mysql-cluster-install-configuration::, for the relevant information.
See note linux-installation-rpm::, for general information about installing MySQL using RPMs supplied by Oracle. See note mysql-cluster-install-configuration::, for information about required post-installation configuration.
File: manual.info.tmp, Node: mysql-cluster-install-debian, Next: mysql-cluster-install-linux-source, Prev: mysql-cluster-install-linux-rpm, Up: mysql-cluster-install-linux
21.3.1.3 Installing NDB Cluster Using .deb Files ................................................
The section provides information about installing NDB Cluster on Debian and related Linux distributions such Ubuntu using the '.deb' files supplied by Oracle for this purpose.
For NDB Cluster 7.5.6 and later, Oracle also provides an APT repository for Debian and other distributions. See 'Installing MySQL NDB Cluster Using the APT Repository' (https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#repo-qg-apt-cluster-install), for instructions and additional information.
Oracle provides '.deb' installer files for NDB Cluster 7.5 and later for 32-bit and 64-bit platforms. For a Debian-based system, only a single installer file is necessary. This file is named using the pattern shown here, according to the applicable NDB Cluster version, Debian version, and architecture:
mysql-cluster-gpl-NDBVER-debianDEBIANVER-ARCH.deb
Here, NDBVER is the 3-part 'NDB' engine version number, DEBIANVER is the major version of Debian ('8' or '9'), and ARCH is one of 'i686' or 'x86_64'. In the examples that follow, we assume you wish to install NDB 7.6.33 on a 64-bit Debian 9 system; in this case, the installer file is named 'mysql-cluster-gpl-7.6.33-debian9-x86_64.deb-bundle.tar'.
Once you have downloaded the appropriate '.deb' file, you can untar it, and then install it from the command line using 'dpkg', like this:
$> dpkg -i mysql-cluster-gpl-7.6.33-debian9-i686.deb
You can also remove it using 'dpkg' as shown here:
$> dpkg -r mysql
The installer file should also be compatible with most graphical package managers that work with '.deb' files, such as 'GDebi' for the Gnome desktop.
The '.deb' file installs NDB Cluster under '/opt/mysql/server-VERSION/', where VERSION is the 2-part release series version for the included MySQL server. For NDB 7.5 and later, this is always '5.7'. The directory layout is the same as that for the generic Linux binary distribution (see note binary-installation-layout::), with the exception that startup scripts and configuration files are found in 'support-files' instead of 'share'. All NDB Cluster executables, such as note 'ndb_mgm': mysql-cluster-programs-ndb-mgm, note 'ndbd': mysql-cluster-programs-ndbd, and note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd, are placed in the 'bin' directory.
File: manual.info.tmp, Node: mysql-cluster-install-linux-source, Prev: mysql-cluster-install-debian, Up: mysql-cluster-install-linux
21.3.1.4 Building NDB Cluster from Source on Linux ..................................................
This section provides information about compiling NDB Cluster on Linux and other Unix-like platforms. Building NDB Cluster from source is similar to building the standard MySQL Server, although it differs in a few key respects discussed here. For general information about building MySQL from source, see note source-installation::. For information about compiling NDB Cluster on Windows platforms, see note mysql-cluster-install-windows-source::.
Building NDB Cluster requires using the NDB Cluster sources. These are available from the NDB Cluster downloads page at https://dev.mysql.com/downloads/cluster/. The archived source file should have a name similar to 'mysql-cluster-gpl-7.6.33.tar.gz'. You can also obtain NDB Cluster sources from GitHub at https://github.com/mysql/mysql-server/tree/cluster-7.5 (NDB 7.5) and https://github.com/mysql/mysql-server/tree/cluster-7.6 (NDB 7.6). Building NDB Cluster 7.5 or 7.6 from standard MySQL Server 5.7 sources is not supported.
The 'WITH_NDBCLUSTER_STORAGE_ENGINE' option for 'CMake' causes the binaries for the management nodes, data nodes, and other NDB Cluster programs to be built; it also causes note 'mysqld': mysqld. to be compiled with note 'NDB': mysql-cluster. storage engine support. This option (or its alias 'WITH_NDBCLUSTER') is required when building NDB Cluster.
Important:
The 'WITH_NDB_JAVA' option is enabled by default. This means that, by default, if 'CMake' cannot find the location of Java on your system, the configuration process fails; if you do not wish to enable Java and ClusterJ support, you must indicate this explicitly by configuring the build using '-DWITH_NDB_JAVA=OFF'. Use 'WITH_CLASSPATH' to provide the Java classpath if needed.
For more information about 'CMake' options specific to building NDB Cluster, see *note cmake-mysql-cluster-options::.
After you have run 'make && make install' (or your system's equivalent), the result is similar to what is obtained by unpacking a precompiled binary to the same location.
Management nodes
When building from source and running the default 'make install', the management server and management client binaries (note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. and note 'ndb_mgm': mysql-cluster-programs-ndb-mgm.) can be found in '/usr/local/mysql/bin'. Only note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. is required to be present on a management node host; however, it is also a good idea to have note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. present on the same host machine. Neither of these executables requires a specific location on the host machine's file system.
Data nodes
The only executable required on a data node host is the data node binary note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. (note 'mysqld': mysqld, for example, does not have to be present on the host machine.) By default, when building from source, this file is placed in the directory '/usr/local/mysql/bin'. For installing on multiple data node hosts, only note 'ndbd': mysql-cluster-programs-ndbd. or *note 'ndbmtd': mysql-cluster-programs-ndbmtd. 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.) The data node binary need not be in any particular location on the host's file system, as long as the location is known.
When compiling NDB Cluster from source, no special options are required for building multithreaded data node binaries. Configuring the build with note 'NDB': mysql-cluster. storage engine support causes note 'ndbmtd': mysql-cluster-programs-ndbmtd. to be built automatically; 'make install' places the note 'ndbmtd': mysql-cluster-programs-ndbmtd. binary in the installation 'bin' directory along with note 'mysqld': mysqld, note 'ndbd': mysql-cluster-programs-ndbd, and note 'ndb_mgm': mysql-cluster-programs-ndb-mgm.
SQL nodes
If you compile MySQL with clustering support, and perform the default installation (using 'make install' as the system 'root' user), note 'mysqld': mysqld. is placed in '/usr/local/mysql/bin'. Follow the steps given in note source-installation:: to make note 'mysqld': mysqld. ready for use. If you want to run multiple SQL nodes, you can use a copy of the same note 'mysqld': 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 *note source-installation:: on each machine. If you configure the build with a nondefault 'PREFIX' option, you must adjust the directory accordingly.
In *note mysql-cluster-install-configuration::, we create configuration files for all of the nodes in our example NDB Cluster.
File: manual.info.tmp, Node: mysql-cluster-install-windows, Next: mysql-cluster-install-configuration, Prev: mysql-cluster-install-linux, Up: mysql-cluster-installation
Menu:
mysql-cluster-install-windows-service:: Installing NDB Cluster Processes as Windows Services
This section describes installation procedures for NDB Cluster on Windows hosts. NDB Cluster 7.5 and 7.6 binaries for Windows can be obtained from https://dev.mysql.com/downloads/cluster/. For information about installing NDB Cluster on Windows from a binary release provided by Oracle, see *note mysql-cluster-install-windows-binary::.
It is also possible to compile and install NDB Cluster from source on Windows using Microsoft Visual Studio. For more information, see *note mysql-cluster-install-windows-source::.
File: manual.info.tmp, Node: mysql-cluster-install-windows-binary, Next: mysql-cluster-install-windows-source, Prev: mysql-cluster-install-windows, Up: mysql-cluster-install-windows
21.3.2.1 Installing NDB Cluster on Windows from a Binary Release ................................................................
This section describes a basic installation of NDB Cluster on Windows using a binary 'no-install' NDB Cluster release provided by Oracle, using the same 4-node setup outlined in the beginning of this section (see *note mysql-cluster-installation::), as shown in the following table:
Network addresses of nodes in example cluster
Node IP Address
Management node ('mgmd') 198.51.100.10
SQL node (*note 'mysqld': mysqld.) 198.51.100.20
Data node "A" 198.51.100.30 (*note 'ndbd': mysql-cluster-programs-ndbd.)
Data node "B" 198.51.100.40 (*note 'ndbd': mysql-cluster-programs-ndbd.)
As on other platforms, the NDB Cluster host computer running an SQL node must have installed on it a MySQL Server binary (note 'mysqld.exe': mysqld.). You should also have the MySQL client (note 'mysql.exe': mysql.) on this host. For management nodes and data nodes, it is not necessary to install the MySQL Server binary; however, each management node requires the management server daemon (note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd.); each data node requires the data node daemon (note 'ndbd.exe': mysql-cluster-programs-ndbd. or note 'ndbmtd.exe': mysql-cluster-programs-ndbmtd.). For this example, we refer to note 'ndbd.exe': mysql-cluster-programs-ndbd. as the data node executable, but you can install note 'ndbmtd.exe': mysql-cluster-programs-ndbmtd, the multithreaded version of this program, instead, in exactly the same way. You should also install the management client (note 'ndb_mgm.exe': mysql-cluster-programs-ndb-mgm.) on the management server host. This section covers the steps necessary to install the correct Windows binaries for each type of NDB Cluster node.
Note:
As with other Windows programs, NDB Cluster executables are named with the '.exe' file extension. However, it is not necessary to include the '.exe' extension when invoking these programs from the command line. Therefore, we often simply refer to these programs in this documentation as note 'mysqld': mysqld, note 'mysql': mysql, note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd, and so on. You should understand that, whether we refer (for example) to note 'mysqld': mysqld. or *note 'mysqld.exe': mysqld, either name means the same thing (the MySQL Server program).
For setting up an NDB Cluster using Oracles's 'no-install' binaries, the first step in the installation process is to download the latest NDB Cluster Windows ZIP binary archive from https://dev.mysql.com/downloads/cluster/. This archive has a filename of the 'mysql-cluster-gpl-VER-winARCH.zip', where VER is the 'NDB' storage engine version (such as '7.6.33'), and ARCH is the architecture ('32' for 32-bit binaries, and '64' for 64-bit binaries). For example, the NDB Cluster 7.6.33 archive for 64-bit Windows systems is named 'mysql-cluster-gpl-7.6.33-win64.zip'.
You can run 32-bit NDB Cluster binaries on both 32-bit and 64-bit versions of Windows; however, 64-bit NDB Cluster binaries can be used only on 64-bit versions of Windows. If you are using a 32-bit version of Windows on a computer that has a 64-bit CPU, then you must use the 32-bit NDB Cluster binaries.
To minimize the number of files that need to be downloaded from the Internet or copied between machines, we start with the computer where you intend to run the SQL node.
SQL node
We assume that you have placed a copy of the archive in the directory 'C:and SettingsDocuments' on the computer having the IP address 198.51.100.20, where USERNAME is the name of the current user. (You can obtain this name using 'ECHO %USERNAME%' on the command line.) To install and run NDB Cluster executables as Windows services, this user should be a member of the 'Administrators' group.
Extract all the files from the archive. The Extraction Wizard integrated with Windows Explorer is adequate for this task. (If you use a different archive program, be sure that it extracts all files and directories from the archive, and that it preserves the archive's directory structure.) When you are asked for a destination directory, enter 'C:', which causes the Extraction Wizard to extract the archive to the directory 'C:-cluster-gpl-VER-winARCH'. Rename this directory to 'C:'.
It is possible to install the NDB Cluster binaries to directories other than 'C:'; however, if you do so, you must modify the paths shown in this procedure accordingly. In particular, if the MySQL Server (SQL node) binary is installed to a location other than 'C:' or 'C:FilesServer 5.7', or if the SQL node's data directory is in a location other than 'C:' or 'C:FilesServer 5.7', extra configuration options must be used on the command line or added to the 'my.ini' or 'my.cnf' file when starting the SQL node. For more information about configuring a MySQL Server to run in a nonstandard location, see *note windows-install-archive::.
For a MySQL Server with NDB Cluster support to run as part of an NDB Cluster, it must be started with the options '--ndbcluster' and '--ndb-connectstring'. While you can specify these options on the command line, it is usually more convenient to place them in an option file. To do this, create a new text file in Notepad or another text editor. Enter the following configuration information into this file:
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
ndb-connectstring=198.51.100.10 # location of management server
You can add other options used by this MySQL Server if desired (see *note windows-create-option-file::), but the file must contain the options shown, at a minimum. Save this file as 'C:.ini'. This completes the installation and setup for the SQL node.
Data nodes
An NDB Cluster data node on a Windows host requires only a single executable, one of either note 'ndbd.exe': mysql-cluster-programs-ndbd. or note 'ndbmtd.exe': mysql-cluster-programs-ndbmtd. For this example, we assume that you are using note 'ndbd.exe': mysql-cluster-programs-ndbd, but the same instructions apply when using note 'ndbmtd.exe': mysql-cluster-programs-ndbmtd. On each computer where you wish to run a data node (the computers having the IP addresses 198.51.100.30 and 198.51.100.40), create the directories 'C:', 'C:', and 'C:-data'; then, on the computer where you downloaded and extracted the 'no-install' archive, locate 'ndbd.exe' in the 'C:' directory. Copy this file to the 'C:' directory on each of the two data node hosts.
To function as part of an NDB Cluster, each data node must be given the address or hostname of the management server. You can supply this information on the command line using the '--ndb-connectstring' or '-c' option when starting each data node process. However, it is usually preferable to put this information in an option file. To do this, create a new text file in Notepad or another text editor and enter the following text:
[mysql_cluster]
# Options for data node process:
ndb-connectstring=198.51.100.10 # location of management server
Save this file as 'C:.ini' on the data node host. Create another text file containing the same information and save it on as 'C:mysql.ini' on the other data node host, or copy the my.ini file from the first data node host to the second one, making sure to place the copy in the second data node's 'C:' directory. Both data node hosts are now ready to be used in the NDB Cluster, which leaves only the management node to be installed and configured.
Management node
The only executable program required on a computer used for hosting an NDB Cluster management node is the management server program note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. However, in order to administer the NDB Cluster once it has been started, you should also install the NDB Cluster management client program note 'ndb_mgm.exe': mysql-cluster-programs-ndb-mgm. on the same machine as the management server. Locate these two programs on the machine where you downloaded and extracted the 'no-install' archive; this should be the directory 'C:' on the SQL node host. Create the directory 'C:' on the computer having the IP address 198.51.100.10, then copy both programs to this directory.
You should now create two configuration files for use by 'ndb_mgmd.exe':
A local configuration file to supply configuration data specific to the management node itself. Typically, this file needs only to supply the location of the NDB Cluster global configuration file (see item 2).
To create this file, start a new text file in Notepad or another text editor, and enter the following information:
[mysql_cluster]
# Options for management node process
config-file=C:/mysql/bin/config.ini
Save this file as the text file 'C:.ini'.
A global configuration file from which the management node can obtain configuration information governing the NDB Cluster as a whole. At a minimum, this file must contain a section for each node in the NDB Cluster, and the IP addresses or hostnames for the management node and all data nodes ('HostName' configuration parameter). It is also advisable to include the following additional information:
* The IP address or hostname of any SQL nodes
* The data memory and index memory allocated to each data node
('DataMemory' and 'IndexMemory' configuration parameters)
* The number of fragment replicas, using the 'NoOfReplicas'
configuration parameter (see *note
mysql-cluster-nodes-groups::)
* The directory where each data node stores it data and log
file, and the directory where the management node keeps its
log files (in both cases, the 'DataDir' configuration
parameter)
Create a new text file using a text editor such as Notepad, and input the following information:
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of fragment replicas
DataDir=C:/mysql/cluster-data # Directory for each data node's data files
# Forward slashes used in directory path,
# rather than backslashes. This is correct;
# see *Important* note in text
DataMemory=80M # Memory allocated to data storage
IndexMemory=18M # Memory allocated to index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.
[ndb_mgmd]
# Management process options:
HostName=198.51.100.10 # Hostname or IP address of management node
DataDir=C:/mysql/bin/cluster-logs # Directory for management node log files
[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
HostName=198.51.100.30 # Hostname or IP address
[ndbd]
# Options for data node "B":
HostName=198.51.100.40 # Hostname or IP address
[mysqld]
# SQL node options:
HostName=198.51.100.20 # Hostname or IP address
Save this file as the text file 'C:.ini'.
Important:
A single backslash character ('') cannot be used when specifying directory paths in program options or configuration files used by NDB Cluster on Windows. Instead, you must either escape each backslash character with a second backslash ('\'), or replace the backslash with a forward slash character ('/'). For example, the following line from the '[ndb_mgmd]' section of an NDB Cluster 'config.ini' file does not work:
DataDir=C:\mysql\bin\cluster-logs
Instead, you may use either of the following:
DataDir=C:\\mysql\\bin\\cluster-logs # Escaped backslashes
DataDir=C:/mysql/bin/cluster-logs # Forward slashes
For reasons of brevity and legibility, we recommend that you use forward slashes in directory paths used in NDB Cluster program options and configuration files on Windows.
File: manual.info.tmp, Node: mysql-cluster-install-windows-source, Next: mysql-cluster-install-windows-initial-start, Prev: mysql-cluster-install-windows-binary, Up: mysql-cluster-install-windows
21.3.2.2 Compiling and Installing NDB Cluster from Source on Windows ....................................................................
Oracle provides precompiled NDB Cluster binaries for Windows which should be adequate for most users. However, if you wish, it is also possible to compile NDB Cluster for Windows from source code. The procedure for doing this is almost identical to the procedure used to compile the standard MySQL Server binaries for Windows, and uses the same tools. However, there are two major differences:
Building NDB Cluster requires using the NDB Cluster sources. These are available from the NDB Cluster downloads page at https://dev.mysql.com/downloads/cluster/. The archived source file should have a name similar to 'mysql-cluster-gpl-7.6.33.tar.gz'. You can also obtain NDB Cluster sources from GitHub at https://github.com/mysql/mysql-server/tree/cluster-7.5 (NDB 7.5) and https://github.com/mysql/mysql-server/tree/cluster-7.6 (NDB 7.6). Building NDB Cluster 7.5 or 7.6 from standard MySQL Server 5.7 sources is not supported.
You must configure the build using the 'WITH_NDBCLUSTER' option in addition to any other build options you wish to use with 'CMake'. ('WITH_NDBCLUSTER_STORAGE_ENGINE' is supported as an alias.)
Important:
The 'WITH_NDB_JAVA' option is enabled by default. This means that, by default, if 'CMake' cannot find the location of Java on your system, the configuration process fails; if you do not wish to enable Java and ClusterJ support, you must indicate this explicitly by configuring the build using '-DWITH_NDB_JAVA=OFF'. (Bug #12379735) Use 'WITH_CLASSPATH' to provide the Java classpath if needed.
For more information about 'CMake' options specific to building NDB Cluster, see *note cmake-mysql-cluster-options::.
Once the build process is complete, you can create a Zip archive containing the compiled binaries; note installing-source-distribution:: provides the commands needed to perform this task on Windows systems. The NDB Cluster binaries can be found in the 'bin' directory of the resulting archive, which is equivalent to the 'no-install' archive, and which can be installed and configured in the same manner. For more information, see note mysql-cluster-install-windows-binary::.
File: manual.info.tmp, Node: mysql-cluster-install-windows-initial-start, Next: mysql-cluster-install-windows-service, Prev: mysql-cluster-install-windows-source, Up: mysql-cluster-install-windows
21.3.2.3 Initial Startup of NDB Cluster on Windows ..................................................
Once the NDB Cluster executables and needed configuration files are in place, performing an initial start of the cluster is simply a matter of starting the NDB Cluster executables for all nodes in the cluster. Each cluster node process must be started separately, and on the host computer where it resides. The management node should be started first, followed by the data nodes, and then finally by any SQL nodes.
On the management node host, issue the following command from the command line to start the management node process. The output should appear similar to what is shown here:
C:\mysql\bin> ndb_mgmd
2010-06-23 07:53:34 [MgmtSrvr] INFO -- NDB Cluster Management Server. mysql-5.7.44-ndb-7.6.34
2010-06-23 07:53:34 [MgmtSrvr] INFO -- Reading cluster configuration from 'config.ini'
The management node process continues to print logging output to the console. This is normal, because the management node is not running as a Windows service. (If you have used NDB Cluster on a Unix-like platform such as Linux, you may notice that the management node's default behavior in this regard on Windows is effectively the opposite of its behavior on Unix systems, where it runs by default as a Unix daemon process. This behavior is also true of NDB Cluster data node processes running on Windows.) For this reason, do not close the window in which note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. is running; doing so kills the management node process. (See note mysql-cluster-install-windows-service::, where we show how to install and run NDB Cluster processes as Windows services.)
The required '-f' option tells the management node where to find the global configuration file ('config.ini'). The long form of this option is '--config-file'.
Important:
An NDB Cluster management node caches the configuration data that it reads from 'config.ini'; once it has created a configuration cache, it ignores the 'config.ini' file on subsequent starts unless forced to do otherwise. This means that, if the management node fails to start due to an error in this file, you must make the management node re-read 'config.ini' after you have corrected any errors in it. You can do this by starting *note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. with the '--reload' or '--initial' option on the command line. Either of these options works to refresh the configuration cache.
It is not necessary or advisable to use either of these options in the management node's 'my.ini' file.
On each of the data node hosts, run the command shown here to start the data node processes:
C:\mysql\bin> ndbd
2010-06-23 07:53:46 [ndbd] INFO -- Configuration fetched from 'localhost:1186', generation: 1
In each case, the first line of output from the data node process should resemble what is shown in the preceding example, and is followed by additional lines of logging output. As with the management node process, this is normal, because the data node is not running as a Windows service. For this reason, do not close the console window in which the data node process is running; doing so kills note 'ndbd.exe': mysql-cluster-programs-ndbd. (For more information, see note mysql-cluster-install-windows-service::.)
Do not start the SQL node yet; it cannot connect to the cluster until the data nodes have finished starting, which may take some time. Instead, in a new console window on the management node host, start the NDB Cluster management client note 'ndb_mgm.exe': mysql-cluster-programs-ndb-mgm, which should be in 'C:' on the management node host. (Do not try to re-use the console window where note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. is running by typing 'CTRL'+'C', as this kills the management node.) The resulting output should look like this:
C:\mysql\bin> ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm>
When the prompt 'ndb_mgm>' appears, this indicates that the management client is ready to receive NDB Cluster management commands. You can observe the status of the data nodes as they start by entering 'ALL STATUS' at the management client prompt. This command causes a running report of the data nodes's startup sequence, which should look something like this:
ndb_mgm> ALL STATUS
Connected to Management Server at: localhost:1186
Node 2: starting (Last completed phase 3) (mysql-5.7.44-ndb-7.6.34)
Node 3: starting (Last completed phase 3) (mysql-5.7.44-ndb-7.6.34)
Node 2: starting (Last completed phase 4) (mysql-5.7.44-ndb-7.6.34)
Node 3: starting (Last completed phase 4) (mysql-5.7.44-ndb-7.6.34)
Node 2: Started (version 7.6.34)
Node 3: Started (version 7.6.34)
ndb_mgm>
Note:
Commands issued in the management client are not case-sensitive; we use uppercase as the canonical form of these commands, but you are not required to observe this convention when inputting them into the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client. For more information, see note mysql-cluster-mgm-client-commands::.
The output produced by 'ALL STATUS' is likely to vary from what is shown here, according to the speed at which the data nodes are able to start, the release version number of the NDB Cluster software you are using, and other factors. What is significant is that, when you see that both data nodes have started, you are ready to start the SQL node.
You can leave *note 'ndb_mgm.exe': mysql-cluster-programs-ndb-mgm. running; it has no negative impact on the performance of the NDB Cluster, and we use it in the next step to verify that the SQL node is connected to the cluster after you have started it.
On the computer designated as the SQL node host, open a console window and navigate to the directory where you unpacked the NDB Cluster binaries (if you are following our example, this is 'C:').
Start the SQL node by invoking *note 'mysqld.exe': mysqld. from the command line, as shown here:
C:\mysql\bin> mysqld --console
The '--console' option causes logging information to be written to the console, which can be helpful in the event of problems. (Once you are satisfied that the SQL node is running in a satisfactory manner, you can stop it and restart it out without the '--console' option, so that logging is performed normally.)
In the console window where the management client (*note 'ndb_mgm.exe': mysql-cluster-programs-ndb-mgm.) is running on the management node host, enter the 'SHOW' command, which should produce output similar to what is shown here:
ndb_mgm> SHOW
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @198.51.100.30 (Version: 5.7.44-ndb-7.6.34, Nodegroup: 0, *)
id=3 @198.51.100.40 (Version: 5.7.44-ndb-7.6.34, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @198.51.100.10 (Version: 5.7.44-ndb-7.6.34)
[mysqld(API)] 1 node(s)
id=4 @198.51.100.20 (Version: 5.7.44-ndb-7.6.34)
You can also verify that the SQL node is connected to the NDB Cluster in the note 'mysql': mysql. client (note 'mysql.exe': mysql.) using the 'SHOW ENGINE NDB STATUS' statement.
You should now be ready to work with database objects and data using NDB Cluster 's note 'NDBCLUSTER': mysql-cluster. storage engine. See note mysql-cluster-install-example-data::, for more information and examples.
You can also install note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd, note 'ndbd.exe': mysql-cluster-programs-ndbd, and note 'ndbmtd.exe': mysql-cluster-programs-ndbmtd. as Windows services. For information on how to do this, see note mysql-cluster-install-windows-service::).
File: manual.info.tmp, Node: mysql-cluster-install-windows-service, Prev: mysql-cluster-install-windows-initial-start, Up: mysql-cluster-install-windows
21.3.2.4 Installing NDB Cluster Processes as Windows Services .............................................................
Once you are satisfied that NDB Cluster is running as desired, you can install the management nodes and data nodes as Windows services, so that these processes are started and stopped automatically whenever Windows is started or stopped. This also makes it possible to control these processes from the command line with the appropriate 'SC START' and 'SC STOP' commands, or using the Windows graphical 'Services' utility. 'NET START' and 'NET STOP' commands can also be used.
Installing programs as Windows services usually must be done using an account that has Administrator rights on the system.
To install the management node as a service on Windows, invoke *note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. from the command line on the machine hosting the management node, using the '--install' option, as shown here:
C:\> C:\mysql\bin\ndb_mgmd.exe --install
Installing service 'NDB Cluster Management Server'
as '"C:\mysql\bin\ndbd.exe" "--service=ndb_mgmd"'
Service successfully installed.
Important:
When installing an NDB Cluster program as a Windows service, you should always specify the complete path; otherwise the service installation may fail with the error 'The system cannot find the file specified'.
The '--install' option must be used first, ahead of any other options that might be specified for note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. However, it is preferable to specify such options in an options file instead. If your options file is not in one of the default locations as shown in the output of note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. '--help', you can specify the location using the '--config-file' option.
Now you should be able to start and stop the management server like this:
C:\> SC START ndb_mgmd
C:\> SC STOP ndb_mgmd
Note:
If using 'NET' commands, you can also start or stop the management server as a Windows service using the descriptive name, as shown here:
C:\> NET START 'NDB Cluster Management Server'
The NDB Cluster Management Server service is starting.
The NDB Cluster Management Server service was started successfully.
C:\> NET STOP 'NDB Cluster Management Server'
The NDB Cluster Management Server service is stopping..
The NDB Cluster Management Server service was stopped successfully.
It is usually simpler to specify a short service name or to permit the default service name to be used when installing the service, and then reference that name when starting or stopping the service. To specify a service name other than 'ndb_mgmd', append it to the '--install' option, as shown in this example:
C:\> C:\mysql\bin\ndb_mgmd.exe --install=mgmd1
Installing service 'NDB Cluster Management Server'
as '"C:\mysql\bin\ndb_mgmd.exe" "--service=mgmd1"'
Service successfully installed.
Now you should be able to start or stop the service using the name you have specified, like this:
C:\> SC START mgmd1
C:\> SC STOP mgmd1
To remove the management node service, use 'SC DELETE SERVICE_NAME':
C:\> SC DELETE mgmd1
Alternatively, invoke *note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. with the '--remove' option, as shown here:
C:\> C:\mysql\bin\ndb_mgmd.exe --remove
Removing service 'NDB Cluster Management Server'
Service successfully removed.
If you installed the service using a service name other than the default, pass the service name as the value of the *note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. '--remove' option, like this:
C:\> C:\mysql\bin\ndb_mgmd.exe --remove=mgmd1
Removing service 'mgmd1'
Service successfully removed.
Installation of an NDB Cluster data node process as a Windows service can be done in a similar fashion, using the '--install' option for note 'ndbd.exe': mysql-cluster-programs-ndbd. (or note 'ndbmtd.exe': mysql-cluster-programs-ndbmtd.), as shown here:
C:\> C:\mysql\bin\ndbd.exe --install
Installing service 'NDB Cluster Data Node Daemon' as '"C:\mysql\bin\ndbd.exe" "--service=ndbd"'
Service successfully installed.
Now you can start or stop the data node as shown in the following example:
C:\> SC START ndbd
C:\> SC STOP ndbd
To remove the data node service, use 'SC DELETE SERVICE_NAME':
C:\> SC DELETE ndbd
Alternatively, invoke *note 'ndbd.exe': mysql-cluster-programs-ndbd. with the '--remove' option, as shown here:
C:\> C:\mysql\bin\ndbd.exe --remove
Removing service 'NDB Cluster Data Node Daemon'
Service successfully removed.
As with note 'ndb_mgmd.exe': mysql-cluster-programs-ndb-mgmd. (and note 'mysqld.exe': mysqld.), when installing *note 'ndbd.exe': mysql-cluster-programs-ndbd. as a Windows service, you can also specify a name for the service as the value of '--install', and then use it when starting or stopping the service, like this:
C:\> C:\mysql\bin\ndbd.exe --install=dnode1
Installing service 'dnode1' as '"C:\mysql\bin\ndbd.exe" "--service=dnode1"'
Service successfully installed.
C:\> SC START dnode1
C:\> SC STOP dnode1
If you specified a service name when installing the data node service, you can use this name when removing it as well, as shown here:
C:\> SC DELETE dnode1
Alternatively, you can pass the service name as the value of the 'ndbd.exe' '--remove' option, as shown here:
C:\> C:\mysql\bin\ndbd.exe --remove=dnode1
Removing service 'dnode1'
Service successfully removed.
Installation of the SQL node as a Windows service, starting the service, stopping the service, and removing the service are done in a similar fashion, using note 'mysqld': mysqld. '--install', 'SC START', 'SC STOP', and 'SC DELETE' (or note 'mysqld': mysqld. '--remove'). 'NET' commands can also be used to start or stop a service. For additional information, see *note windows-start-service::.
File: manual.info.tmp, Node: mysql-cluster-install-configuration, Next: mysql-cluster-install-first-start, Prev: mysql-cluster-install-windows, Up: mysql-cluster-installation
In this section, we discuss manual configuration of an installed NDB Cluster by creating and editing configuration files.
For our four-node, four-host NDB Cluster (see *note mysql-cluster-install-nodes-hosts::), it is necessary to write four configuration files, one per node host.
Each data node or SQL node requires a 'my.cnf' file that provides two pieces of information: a connection string that tells the node where to find the management node, and a line telling the MySQL server on this host (the machine hosting the data node) to enable the *note 'NDBCLUSTER': mysql-cluster. storage engine.
For more information on connection strings, see *note mysql-cluster-connection-strings::.
The management node needs a 'config.ini' file telling it how many fragment replicas to maintain, how much memory to allocate for data and indexes on each data node, where to find the data nodes, where to save data to disk on each data node, and where to find any SQL nodes.
Configuring the data nodes and SQL nodes
The 'my.cnf' file needed for the data nodes is fairly simple. The configuration file should be located in the '/etc' directory and can be edited using any text editor. (Create the file if it does not exist.) For example:
$> vi /etc/my.cnf
Note:
We show 'vi' being used here to create the file, but any text editor should work just as well.
For each data node and SQL node in our example setup, 'my.cnf' should look like this:
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
[mysql_cluster]
# Options for NDB Cluster processes:
ndb-connectstring=198.51.100.10 # location of management server
After entering the preceding information, save this file and exit the text editor. Do this for the machines hosting data node 'A', data node 'B', and the SQL node.
Important:
Once you have started a note 'mysqld': mysqld. process with the 'ndbcluster' and 'ndb-connectstring' parameters in the '[mysqld]' and '[mysql_cluster]' sections of the 'my.cnf' file as shown previously, you cannot execute any note 'CREATE TABLE': create-table. or *note 'ALTER TABLE': alter-table. statements without having actually started the cluster. Otherwise, these statements fail with an error. This is by design.
Configuring the management node
The first step in configuring the management node is to create the directory in which the configuration file can be found and then to create the file itself. For example (running as 'root'):
$> mkdir /var/lib/mysql-cluster
$> cd /var/lib/mysql-cluster
$> vi config.ini
For our representative setup, the 'config.ini' file should read as follows:
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of fragment replicas
DataMemory=80M # How much memory to allocate for data storage
IndexMemory=18M # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example NDB Cluster setup.
# NOTE: IndexMemory is deprecated in NDB 7.6 and later; in
# these versions, resources for all data and indexes are
# allocated by DataMemory and any that are set for IndexMemory
# are added to the DataMemory resource pool
[ndb_mgmd]
# Management process options:
HostName=198.51.100.10 # Hostname or IP address of management node
DataDir=/var/lib/mysql-cluster # Directory for management node log files
[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
HostName=198.51.100.30 # Hostname or IP address
NodeId=2 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files
[ndbd]
# Options for data node "B":
HostName=198.51.100.40 # Hostname or IP address
NodeId=3 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files
[mysqld]
# SQL node options:
HostName=198.51.100.20 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
Note:
The 'world' database can be downloaded from https://dev.mysql.com/doc/index-other.html.
After all the configuration files have been created and these minimal options have been specified, you are ready to proceed with starting the cluster and verifying that all processes are running. We discuss how this is done in *note mysql-cluster-install-first-start::.
For more detailed information about the available NDB Cluster configuration parameters and their uses, see note mysql-cluster-config-file::, and note mysql-cluster-configuration::. For configuration of NDB Cluster as relates to making backups, see *note mysql-cluster-backup-configuration::.
The default port for Cluster management nodes is 1186. For data nodes, the cluster can automatically allocate ports from those that are already free.
File: manual.info.tmp, Node: mysql-cluster-install-first-start, Next: mysql-cluster-install-example-data, Prev: mysql-cluster-install-configuration, Up: mysql-cluster-installation
Starting the cluster is not very difficult after it has been configured. Each cluster node process must be started separately, and on the host where it resides. The management node should be started first, followed by the data nodes, and then finally by any SQL nodes:
On the management host, issue the following command from the system shell to start the management node process:
$> ndb_mgmd --initial -f /var/lib/mysql-cluster/config.ini
The first time that it is started, note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. must be told where to find its configuration file, using the '-f' or '--config-file' option. This option requires that '--initial' or '--reload' also be specified; see note mysql-cluster-programs-ndb-mgmd::, for details.
On each of the data node hosts, run this command to start the *note 'ndbd': mysql-cluster-programs-ndbd. process:
$> ndbd
If you used RPM files to install MySQL on the cluster host where the SQL node is to reside, you can (and should) use the supplied startup script to start the MySQL server process on the SQL node.
If all has gone well, and the cluster has been set up correctly, the cluster should now be operational. You can test this by invoking the *note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. management node client. The output should look like that shown here, although you might see some slight differences in the output depending upon the exact version of MySQL that you are using:
$> ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> SHOW
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @198.51.100.30 (Version: 5.7.44-ndb-7.6.34, Nodegroup: 0, *)
id=3 @198.51.100.40 (Version: 5.7.44-ndb-7.6.34, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @198.51.100.10 (Version: 5.7.44-ndb-7.6.34)
[mysqld(API)] 1 node(s)
id=4 @198.51.100.20 (Version: 5.7.44-ndb-7.6.34)
The SQL node is referenced here as '[mysqld(API)]', which reflects the fact that the *note 'mysqld': mysqld. process is acting as an NDB Cluster API node.
Note:
The IP address shown for a given NDB Cluster SQL or other API node in the output of 'SHOW' is the address used by the SQL or API node to connect to the cluster data nodes, and not to any management node.
You should now be ready to work with databases, tables, and data in NDB Cluster. See *note mysql-cluster-install-example-data::, for a brief discussion.
File: manual.info.tmp, Node: mysql-cluster-install-example-data, Next: mysql-cluster-install-shutdown-restart, Prev: mysql-cluster-install-first-start, Up: mysql-cluster-installation
Note:
The information in this section applies to NDB Cluster running on both Unix and Windows platforms.
Working with database tables and data in NDB Cluster is not much different from doing so in standard MySQL. There are two key points to keep in mind:
For a table to be replicated in the cluster, it must use the *note 'NDBCLUSTER': mysql-cluster. storage engine. To specify this, use the 'ENGINE=NDBCLUSTER' or 'ENGINE=NDB' option when creating the table:
CREATE TABLE TBL_NAME (COL_NAME COLUMN_DEFINITIONS) ENGINE=NDBCLUSTER;
Alternatively, for an existing table that uses a different storage engine, use note 'ALTER TABLE': alter-table. to change the table to use note 'NDBCLUSTER': mysql-cluster.:
ALTER TABLE TBL_NAME ENGINE=NDBCLUSTER;
Every note 'NDBCLUSTER': mysql-cluster. table has a primary key. If no primary key is defined by the user when a table is created, the note 'NDBCLUSTER': mysql-cluster. storage engine automatically generates a hidden one. Such a key takes up space just as does any other table index. (It is not uncommon to encounter problems due to insufficient memory for accommodating these automatically created indexes.)
If you are importing tables from an existing database using the output of *note 'mysqldump': mysqldump, you can open the SQL script in a text editor and add the 'ENGINE' option to any table creation statements, or replace any existing 'ENGINE' options. Suppose that you have the 'world' sample database on another MySQL server that does not support NDB Cluster, and you want to export the 'City' table:
$> mysqldump --add-drop-table world City > city_table.sql
The resulting 'city_table.sql' file contains this table creation statement (and the *note 'INSERT': insert. statements necessary to import the table data):
DROP TABLE IF EXISTS `City`;
CREATE TABLE `City` (
`ID` int(11) NOT NULL auto_increment,
`Name` char(35) NOT NULL default '',
`CountryCode` char(3) NOT NULL default '',
`District` char(20) NOT NULL default '',
`Population` int(11) NOT NULL default '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `City` VALUES (1,'Kabul','AFG','Kabol',1780000);
INSERT INTO `City` VALUES (2,'Qandahar','AFG','Qandahar',237500);
INSERT INTO `City` VALUES (3,'Herat','AFG','Herat',186800);
(REMAINING INSERT STATEMENTS OMITTED)
You need to make sure that MySQL uses the *note 'NDBCLUSTER': mysql-cluster. storage engine for this table. There are two ways that this can be accomplished. One of these is to modify the table definition before importing it into the Cluster database. Using the 'City' table as an example, modify the 'ENGINE' option of the definition as follows:
DROP TABLE IF EXISTS `City`;
CREATE TABLE `City` (
`ID` int(11) NOT NULL auto_increment,
`Name` char(35) NOT NULL default '',
`CountryCode` char(3) NOT NULL default '',
`District` char(20) NOT NULL default '',
`Population` int(11) NOT NULL default '0',
PRIMARY KEY (`ID`)
) *ENGINE=NDBCLUSTER* DEFAULT CHARSET=latin1;
INSERT INTO `City` VALUES (1,'Kabul','AFG','Kabol',1780000);
INSERT INTO `City` VALUES (2,'Qandahar','AFG','Qandahar',237500);
INSERT INTO `City` VALUES (3,'Herat','AFG','Herat',186800);
(REMAINING INSERT STATEMENTS OMITTED)
This must be done for the definition of each table that is to be part of the clustered database. The easiest way to accomplish this is to do a search-and-replace on the file that contains the definitions and replace all instances of 'TYPE=ENGINE_NAME' or 'ENGINE=ENGINE_NAME' with 'ENGINE=NDBCLUSTER'. If you do not want to modify the file, you can use the unmodified file to create the tables, and then use *note 'ALTER TABLE': alter-table. to change their storage engine. The particulars are given later in this section.
Assuming that you have already created a database named 'world' on the SQL node of the cluster, you can then use the *note 'mysql': mysql. command-line client to read 'city_table.sql', and create and populate the corresponding table in the usual manner:
$> mysql world < city_table.sql
It is very important to keep in mind that the preceding command must be executed on the host where the SQL node is running (in this case, on the machine with the IP address '198.51.100.20').
To create a copy of the entire 'world' database on the SQL node, use *note 'mysqldump': mysqldump. on the noncluster server to export the database to a file named 'world.sql' (for example, in the '/tmp' directory). Then modify the table definitions as just described and import the file into the SQL node of the cluster like this:
$> mysql world < /tmp/world.sql
If you save the file to a different location, adjust the preceding instructions accordingly.
Running *note 'SELECT': select. queries on the SQL node is no different from running them on any other instance of a MySQL server. To run queries from the command line, you first need to log in to the MySQL Monitor in the usual way (specify the 'root' password at the 'Enter password:' prompt):
$> mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.7.44-ndb-7.6.34
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
We simply use the MySQL server's 'root' account and assume that you have followed the standard security precautions for installing a MySQL server, including setting a strong 'root' password. For more information, see *note default-privileges::.
It is worth taking into account that Cluster nodes do not make use of the MySQL privilege system when accessing one another. Setting or changing MySQL user accounts (including the 'root' account) effects only applications that access the SQL node, not interaction between nodes. See *note mysql-cluster-security-mysql-privileges::, for more information.
If you did not modify the 'ENGINE' clauses in the table definitions prior to importing the SQL script, you should run the following statements at this point:
mysql> USE world;
mysql> ALTER TABLE City ENGINE=NDBCLUSTER;
mysql> ALTER TABLE Country ENGINE=NDBCLUSTER;
mysql> ALTER TABLE CountryLanguage ENGINE=NDBCLUSTER;
Selecting a database and running a 'SELECT' query against a table in that database is also accomplished in the usual manner, as is exiting the MySQL Monitor:
mysql> USE world;
mysql> SELECT Name, Population FROM City ORDER BY Population DESC LIMIT 5;
+-----------+------------+
| Name | Population |
+-----------+------------+
| Bombay | 10500000 |
| Seoul | 9981619 |
| Sa~o Paulo | 9968485 |
| Shanghai | 9696300 |
| Jakarta | 9604900 |
+-----------+------------+
5 rows in set (0.34 sec)
mysql> \q
Bye
$>
Applications that use MySQL can employ standard APIs to access note 'NDB': mysql-cluster. tables. It is important to remember that your application must access the SQL node, and not the management or data nodes. This brief example shows how we might execute the note 'SELECT': select. statement just shown by using the PHP 5.X 'mysqli' extension running on a Web server elsewhere on the network:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>SIMPLE mysqli SELECT</title>
</head>
<body>
<?php
# connect to SQL node:
$link = new mysqli('198.51.100.20', 'root', 'ROOT_PASSWORD', 'world');
# parameters for mysqli constructor are:
# host, user, password, database
if( mysqli_connect_errno() )
die("Connect failed: " . mysqli_connect_error());
$query = "SELECT Name, Population
FROM City
ORDER BY Population DESC
LIMIT 5";
# if no errors...
if( $result = $link->query($query) )
{
?>
<table border="1" width="40%" cellpadding="4" cellspacing ="1">
<tbody>
<tr>
<th width="10%">City</th>
<th>Population</th>
</tr>
<?
# then display the results...
while($row = $result->fetch_object())
printf("<tr>\n <td align=\"center\">%s</td><td>%d</td>\n</tr>\n",
$row->Name, $row->Population);
?>
</tbody
</table>
<?
# ...and verify the number of rows that were retrieved
printf("<p>Affected rows: %d</p>\n", $link->affected_rows);
}
else
# otherwise, tell us what went wrong
echo mysqli_error();
# free the result set and the mysqli connection object
$result->close();
$link->close();
?>
</body>
</html>
We assume that the process running on the Web server can reach the IP address of the SQL node.
In a similar fashion, you can use the MySQL C API, Perl-DBI, Python-mysql, or MySQL Connectors to perform the tasks of data definition and manipulation just as you would normally with MySQL.
File: manual.info.tmp, Node: mysql-cluster-install-shutdown-restart, Next: mysql-cluster-upgrade-downgrade, Prev: mysql-cluster-install-example-data, Up: mysql-cluster-installation
To shut down the cluster, enter the following command in a shell on the machine hosting the management node:
$> ndb_mgm -e shutdown
The '-e' option here is used to pass a command to the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client from the shell. The command causes the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm, note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd, and any note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. processes to terminate gracefully. Any SQL nodes can be terminated using note 'mysqladmin shutdown': mysqladmin. and other means. On Windows platforms, assuming that you have installed the SQL node as a Windows service, you can use 'SC STOP SERVICE_NAME' or 'NET STOP SERVICE_NAME'.
To restart the cluster on Unix platforms, run these commands:
On the management host ('198.51.100.10' in our example setup):
$> ndb_mgmd -f /var/lib/mysql-cluster/config.ini
On each of the data node hosts ('198.51.100.30' and '198.51.100.40'):
$> ndbd
Use the *note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client to verify that both data nodes have started successfully.
On the SQL host ('198.51.100.20'):
$> mysqld_safe &
On Windows platforms, assuming that you have installed all NDB Cluster processes as Windows services using the default service names (see *note mysql-cluster-install-windows-service::), you can restart the cluster as follows:
On the management host ('198.51.100.10' in our example setup), execute the following command:
C:\> SC START ndb_mgmd
On each of the data node hosts ('198.51.100.30' and '198.51.100.40'), execute the following command:
C:\> SC START ndbd
On the management node host, use the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client to verify that the management node and both data nodes have started successfully (see note mysql-cluster-install-windows-initial-start::).
On the SQL node host ('198.51.100.20'), execute the following command:
C:\> SC START mysql
In a production setting, it is usually not desirable to shut down the cluster completely. In many cases, even when making configuration changes, or performing upgrades to the cluster hardware or software (or both), which require shutting down individual host machines, it is possible to do so without shutting down the cluster as a whole by performing a rolling restart of the cluster. For more information about doing this, see *note mysql-cluster-rolling-restart::.
File: manual.info.tmp, Node: mysql-cluster-upgrade-downgrade, Next: mysql-cluster-install-auto, Prev: mysql-cluster-install-shutdown-restart, Up: mysql-cluster-installation
Menu:
mysql-cluster-upgrade-downgrade-7-6:: Upgrading and Downgrading NDB 7.6
The following sections provide information about upgrading and downgrading NDB Cluster 7.5 and 7.6.
Schema operations, including SQL DDL statements, cannot be performed while any data nodes are restarting, and thus during an online upgrade or downgrade of the cluster. For other information regarding the rolling restart procedure used to perform an online upgrade, see *note mysql-cluster-rolling-restart::.
Important:
Compatibility between release versions is taken into account only with regard to note 'NDBCLUSTER': mysql-cluster. in this section, and there are additional issues to be considered. See note upgrading::.
As with any other MySQL software upgrade or downgrade, you are strongly encouraged to review the relevant portions of the MySQL Manual for the MySQL versions from which and to which you intend to migrate, before attempting an upgrade or downgrade of the NDB Cluster software.
File: manual.info.tmp, Node: mysql-cluster-upgrade-downgrade-7-5, Next: mysql-cluster-upgrade-downgrade-7-6, Prev: mysql-cluster-upgrade-downgrade, Up: mysql-cluster-upgrade-downgrade
21.3.7.1 Upgrading and Downgrading NDB 7.5 ..........................................
This section provides information about compatibility between different NDB Cluster 7.5 releases with regard to performing upgrades and downgrades as well as compatibility matrices and notes. Additional information can also be found here regarding downgrades from NDB 7.5 to previous NDB release series. You should already be familiar with installing and configuring NDB Cluster prior to attempting an upgrade or downgrade. See *note mysql-cluster-configuration::.
The table shown here provides information on NDB Cluster upgrade and downgrade compatibility among different releases of NDB 7.5. Additional notes about upgrades and downgrades to, from, or within the NDB Cluster 7.5 release series can be found following the table.
FIGURE GOES HERE: NDB Cluster Upgrade and Downgrade Compatibility, MySQL NDB Cluster 7.5
Version support
The following versions of NDB Cluster are supported for upgrades to GA releases of NDB Cluster 7.5 (7.5.4 and later):
NDB Cluster 7.4 GA releases (7.4.4 and later)
NDB Cluster 7.3 GA releases (7.3.2 and later)
Known Issues When Upgrading or Downgrading NDB Cluster 7.5
The following issues are known to occur when upgrading to or between NDB 7.5 releases:
When run with '--initialize', the server does not require note 'NDB': mysql-cluster. support; having 'NDB' enabled at this time can cause problems with note 'ndbinfo': mysql-cluster-ndbinfo. tables. To keep this from happening, the '--initialize' option now causes *note 'mysqld': mysqld. to ignore the '--ndbcluster' option if the latter is also specified.
A workaround for an upgrade that has failed for these reasons can be accomplished as follows:
Perform a rolling restart of the entire cluster
Delete all '.frm' files in the 'data/ndbinfo' directory
Run *note 'mysql_upgrade': mysql-upgrade.
(Bug #81689, Bug #82724, Bug #24521927, Bug #23518923)
During an online upgrade from an NDB Cluster 7.3 release to an NDB 7.4 (or later) release, the failures of several data nodes running the lower version during local checkpoints (LCPs), and just prior to upgrading these nodes, led to additional node failures following the upgrade. This was due to lingering elements of the 'EMPTY_LCP' protocol initiated by the older nodes as part of an LCP-plus-restart sequence, and which is no longer used in NDB 7.4 and later due to LCP optimizations implemented in those versions. This issue was fixed in NDB 7.5.4. (Bug #23129433)
In NDB 7.5 (and later), the 'ndb_binlog_index' table uses the note 'InnoDB': innodb-storage-engine. storage engine. Use of the note 'MyISAM': myisam-storage-engine. storage engine for this table continues to be supported for backward compatibility.
When upgrading a previous release to NDB 7.5 (or later), you can use the '--force' '--upgrade-system-tables' options with note 'mysql_upgrade': mysql-upgrade. so that it performs note 'ALTER TABLE ... ENGINE=INNODB': alter-table. on the 'ndb_binlog_index' table.
For more information, see *note mysql-cluster-replication-schema::.
File: manual.info.tmp, Node: mysql-cluster-upgrade-downgrade-7-6, Prev: mysql-cluster-upgrade-downgrade-7-5, Up: mysql-cluster-upgrade-downgrade
21.3.7.2 Upgrading and Downgrading NDB 7.6 ..........................................
This section provides information about compatibility between different NDB Cluster 7.6 releases with regard to performing upgrades and downgrades as well as compatibility matrices and notes. Additional information can also be found here regarding downgrades from NDB 7.6 to previous NDB release series. You should already be familiar with installation and configuration of NDB Cluster prior to attempting an upgrade or downgrade. See *note mysql-cluster-configuration::.
The table shown here provides information on NDB Cluster upgrade and downgrade compatibility among different releases of NDB 7.6. Additional notes about upgrades and downgrades to, from, or within the NDB Cluster 7.6 release series can be found following the table.
FIGURE GOES HERE: NDB Cluster Upgrade and Downgrade Compatibility, MySQL NDB Cluster 7.6
Version support
The following versions of NDB Cluster are supported for upgrades to GA releases of NDB Cluster 7.6 (7.6.6 and later):
NDB Cluster 7.5 GA releases (7.5.4 and later)
NDB Cluster 7.4 GA releases (7.4.4 and later)
NDB Cluster 7.3 GA releases (7.3.2 and later)
Known Issues When Upgrading or Downgrading NDB Cluster 7.6
The following issues are known to occur when upgrading to, downgrading from, or between NDB 7.6 releases:
Changes in Disk Data file format
Due to changes in disk format, upgrading to or downgrading from either of the versions listed here requires an initial node restart of each data node:
NDB 7.6.2
NDB 7.6.4
To avoid problems relating to the old format, you should re-create any existing tablespaces and undo log file groups when upgrading. You can do this by performing an initial restart of each data node (that is, using the '--initial' option) as part of the upgrade process.
If you are using Disk Data tables, a downgrade from any NDB 7.6 release to any NDB 7.5 or earlier release requires that you restart all data nodes with '--initial' as part of the downgrade process. This is because NDB 7.5 and earlier release series are not able to read the new Disk Data file format.
IndexMemory changes
If you are downgrading from NDB 7.6 to NDB 7.5 (or earlier), you must set an explicit value for 'IndexMemory' in the cluster configuration file if none is already present. This is because NDB 7.6 does not use this parameter and sets it to 0 by default, whereas it is required in NDB 7.5 and earlier releases, in which the cluster refuses to start with 'Invalid configuration received from Management Server...' if 'IndexMemory' is not set to a nonzero value.
Important:
Upgrading to NDB 7.6 from an earlier release, or downgrading from NDB 7.6 to an earlier release, requires purging then re-creating the 'NDB' data node file system, which means that each data node must be restarted using the '--initial' option as part of the rolling restart or system restart normally required. (Starting a data node with no file system is already equivalent to an initial restart; in such cases, '--initial' is implied and not required. This is unchanged from previous releases of NDB Cluster.)
When such a restart is performed as part of an upgrade to NDB 7.6, any existing LCP files are checked for the presence of the LCP 'Sysfile', indicating that the existing data node file system was written using NDB 7.6. If such a node file system exists, but does not contain the 'Sysfile', and if any data nodes are restarted without the '--initial' option, 'NDB' causes the restart to fail with an appropriate error message.
You should also be aware that no such protection is possible when downgrading from NDB 7.6 to a release previous to NDB 7.6.
File: manual.info.tmp, Node: mysql-cluster-install-auto, Next: mysql-cluster-installer, Prev: mysql-cluster-upgrade-downgrade, Up: mysql-cluster-installation
Note:
This feature has been removed from NDB Cluster, and is no longer supported. See *note mysql-cluster-what-is-new::, for more information.
The web-based graphical configuration installer (Auto-Installer) was removed in NDB 7.5.21, and is no longer included as part of the NDB Cluster distribution.
File: manual.info.tmp, Node: mysql-cluster-installer, Prev: mysql-cluster-install-auto, Up: mysql-cluster-installation
Note:
This feature has been removed from NDB Cluster, and is no longer supported. See *note mysql-cluster-what-is-new::, for more information.
The web-based graphical configuration installer (Auto-Installer) was removed in NDB 7.6.17, and is no longer included as part of the NDB Cluster distribution.
File: manual.info.tmp, Node: mysql-cluster-configuration, Next: mysql-cluster-programs, Prev: mysql-cluster-installation, Up: mysql-cluster