Chapter 17 MySQL Cluster NDB 6.1 - 7.1

Table of Contents

17.1 MySQL Cluster Overview
17.1.1 MySQL Cluster Core Concepts
17.1.2 MySQL Cluster Nodes, Node Groups, Replicas, and Partitions
17.1.3 MySQL Cluster Hardware, Software, and Networking Requirements
17.1.4 MySQL Cluster Development History
17.1.5 MySQL Server Using InnoDB Compared with MySQL Cluster
17.1.6 Known Limitations of MySQL Cluster
17.2 MySQL Cluster Installation and Upgrades
17.2.1 Installing MySQL Cluster on Linux
17.2.2 Installing MySQL Cluster on Windows
17.2.3 Initial Configuration of MySQL Cluster
17.2.4 Initial Startup of MySQL Cluster
17.2.5 MySQL Cluster Example with Tables and Data
17.2.6 Safe Shutdown and Restart of MySQL Cluster
17.2.7 Upgrading and Downgrading MySQL Cluster
17.3 Configuration of MySQL Cluster NDB 6.1-7.1
17.3.1 Quick Test Setup of MySQL Cluster
17.3.2 MySQL Cluster Configuration Files
17.3.3 Overview of MySQL Cluster Configuration Parameters
17.3.4 MySQL Server Options and Variables for MySQL Cluster
17.3.5 Using High-Speed Interconnects with MySQL Cluster
17.4 MySQL Cluster Programs
17.4.1 ndbd — The MySQL Cluster Data Node Daemon
17.4.2 ndbinfo_select_all — Select From ndbinfo Tables
17.4.3 ndbmtd — The MySQL Cluster Data Node Daemon (Multi-Threaded)
17.4.4 ndb_mgmd — The MySQL Cluster Management Server Daemon
17.4.5 ndb_mgm — The MySQL Cluster Management Client
17.4.6 ndb_blob_tool — Check and Repair BLOB and TEXT columns of MySQL Cluster Tables
17.4.7 ndb_config — Extract MySQL Cluster Configuration Information
17.4.8 ndb_cpcd — Automate Testing for NDB Development
17.4.9 ndb_delete_all — Delete All Rows from an NDB Table
17.4.10 ndb_desc — Describe NDB Tables
17.4.11 ndb_drop_index — Drop Index from an NDB Table
17.4.12 ndb_drop_table — Drop an NDB Table
17.4.13 ndb_error_reporter — NDB Error-Reporting Utility
17.4.14 ndb_index_stat — NDB Index Statistics Utility
17.4.15 ndb_print_backup_file — Print NDB Backup File Contents
17.4.16 ndb_print_schema_file — Print NDB Schema File Contents
17.4.17 ndb_print_sys_file — Print NDB System File Contents
17.4.18 ndbd_redo_log_reader — Check and Print Content of Cluster Redo Log
17.4.19 ndb_restore — Restore a MySQL Cluster Backup
17.4.20 ndb_select_all — Print Rows from an NDB Table
17.4.21 ndb_select_count — Print Row Counts for NDB Tables
17.4.22 ndb_show_tables — Display List of NDB Tables
17.4.23 ndb_size.pl — NDBCLUSTER Size Requirement Estimator
17.4.24 ndb_waiter — Wait for MySQL Cluster to Reach a Given Status
17.4.25 Options Common to MySQL Cluster Programs — Options Common to MySQL Cluster Programs
17.5 Management of MySQL Cluster
17.5.1 Summary of MySQL Cluster Start Phases
17.5.2 Commands in the MySQL Cluster Management Client
17.5.3 Online Backup of MySQL Cluster
17.5.4 MySQL Server Usage for MySQL Cluster
17.5.5 Performing a Rolling Restart of a MySQL Cluster
17.5.6 Event Reports Generated in MySQL Cluster
17.5.7 MySQL Cluster Log Messages
17.5.8 MySQL Cluster Single User Mode
17.5.9 Quick Reference: MySQL Cluster SQL Statements
17.5.10 The ndbinfo MySQL Cluster Information Database
17.5.11 MySQL Cluster Security Issues
17.5.12 MySQL Cluster Disk Data Tables
17.5.13 Adding MySQL Cluster Data Nodes Online
17.5.14 Distributed MySQL Privileges for MySQL Cluster
17.5.15 NDB API Statistics Counters and Variables
17.6 MySQL Cluster Replication
17.6.1 MySQL Cluster Replication: Abbreviations and Symbols
17.6.2 General Requirements for MySQL Cluster Replication
17.6.3 Known Issues in MySQL Cluster Replication
17.6.4 MySQL Cluster Replication Schema and Tables
17.6.5 Preparing the MySQL Cluster for Replication
17.6.6 Starting MySQL Cluster Replication (Single Replication Channel)
17.6.7 Using Two Replication Channels for MySQL Cluster Replication
17.6.8 Implementing Failover with MySQL Cluster Replication
17.6.9 MySQL Cluster Backups With MySQL Cluster Replication
17.6.10 MySQL Cluster Replication: Multi-Master and Circular Replication
17.6.11 MySQL Cluster Replication Conflict Resolution
17.7 MySQL Cluster NDB 6.1 - 7.1 Release Notes

This chapter contains information about MySQL Cluster, which is a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment. Current releases of MySQL Cluster use versions 6 and 7 of the NDB storage engine (also known as NDBCLUSTER) to enable running several computers with MySQL servers and other software in a cluster.

Beginning with MySQL 5.1.24, support for the NDBCLUSTER storage engine was removed from the standard MySQL server binaries built by MySQL. Instead, users of MySQL Cluster binaries built by MySQL should upgrade to the most recent binary release of MySQL Cluster NDB 7.0 or MySQL Cluster 7.1 for supported platforms—these include RPMs that should work with most Linux distributions. MySQL Cluster users who build from source should be aware that, also beginning with MySQL 5.1.24, NDBCLUSTER sources in the standard MySQL 5.1 tree are no longer maintained; these users should use the sources provided for MySQL Cluster NDB 7.0 or later. (Locations where the sources can be obtained are listed later in this section.)

Note

MySQL Cluster NDB 6.1, 6.2, and 6.3 were formerly known as MySQL Cluster Carrier Grade Edition. Beginning with MySQL Cluster NDB 6.2.15 and MySQL Cluster NDB 6.3.14, this term is no longer applied to the MySQL Cluster software—which is now known simply as MySQL Cluster—but rather to a commercial licensing and support package. You can learn more about available options for commercial licensing of MySQL Cluster from http://mysql.com/products/database/cluster/features.html, on the MySQL web site.

This chapter contains information about MySQL Cluster in MySQL 5.1 mainline releases through MySQL 5.1.23, MySQL Cluster NDB 6.2 releases through 5.1.51-ndb-6.2.19, MySQL Cluster NDB 6.3 releases through 5.1.73-ndb-6.3.55, MySQL Cluster NDB 7.0 releases through 5.1.73-ndb-7.0.42 and MySQL Cluster NDB 7.1 releases through 5.1.73-ndb-7.1.33. Currently, the MySQL Cluster NDB 7.2 release series is Generally Available (GA), as is MySQL Cluster NDB 7.1. MySQL Cluster NDB 7.0 and MySQL Cluster NDB 6.3 are previous GA release series; although they are still supported, we recommend that new deployments use MySQL Cluster NDB 7.2. For information about MySQL Cluster NDB 7.2, see MySQL Cluster NDB 7.2, in the MySQL 5.5 Manual.

This chapter also contains historical information about MySQL Cluster NDB 6.1 and MySQL Cluster NDB 6,2, although these release series are no longer in active development, and no longer supported for new deployments. You should upgrade to a MySQL Cluster NDB 7.1 or later release series as soon as possible.

Release notes for the changes in each release of MySQL Cluster are located at MySQL Cluster 7.1 Release Notes.

Supported Platforms.  MySQL Cluster is currently available and supported on a number of platforms. For exact levels of support available for on specific combinations of operating system versions, operating system distributions, and hardware platforms, please refer to http://www.mysql.com/support/supportedplatforms/cluster.html.

Availability.  MySQL Cluster binary and source packages are available for supported platforms from http://dev.mysql.com/downloads/cluster/.

Note

Binary releases and RPMs were not available for MySQL Cluster NDB 6.2 prior to MySQL Cluster NDB 6.2.15.

MySQL Cluster release numbers.  Starting with MySQL Cluster NDB 6.1 and MySQL Cluster NDB 6.2, MySQL Cluster follows a somewhat different release pattern from the mainline MySQL 5.1 Cluster series of releases. In this Manual and other MySQL documentation, we identify these and later MySQL Cluster releases employing a version number that begins with NDB. This version number is that of the NDBCLUSTER storage engine used in the release, and not of the MySQL server version on which the MySQL Cluster release is based.

Version strings used in MySQL Cluster NDB 6.x and 7.x software.  The version string displayed by MySQL Cluster NDB 6.x and 7.x software uses this format:

mysql-mysql_server_version-ndb-ndb_engine_version

mysql_server_version represents the version of the MySQL Server on which the MySQL Cluster release is based. For all MySQL Cluster NDB 6.x and 7.x releases, this is 5.1. ndb_engine_version is the version of the NDB storage engine used by this release of the MySQL Cluster software. You can see this format used in the mysql client, as shown here:

shell> mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73-ndb-7.1.33 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SELECT VERSION()\G
*************************** 1. row ***************************
VERSION(): 5.1.73-ndb-7.1.33
1 row in set (0.00 sec)

This version string is also displayed in the output of the SHOW command in the ndb_mgm client:

ndb_mgm> SHOW
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @10.0.10.6  (5.1.73-ndb-7.1.33, Nodegroup: 0, *)
id=2    @10.0.10.8  (5.1.73-ndb-7.1.33, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=3    @10.0.10.2  (5.1.73-ndb-7.1.33)

[mysqld(API)]   2 node(s)
id=4    @10.0.10.10  (5.1.73-ndb-7.1.33)
id=5 (not connected, accepting connect from any host)

The version string identifies the mainline MySQL version from which the MySQL Cluster release was branched and the version of the NDBCLUSTER storage engine used. For example, the full version string for MySQL Cluster NDB 7.0.5 (the first GA MySQL Cluster NDB 7.0 binary release) was mysql-5.1.32-ndb-7.0.5. From this we can determine the following:

New MySQL Cluster releases are numbered according to updates in the NDB storage engine, and do not necessarily correspond in a linear fashion with mainline MySQL Server releases. For example, MySQL Cluster NDB 7.0.5 (as previously noted) is based on MySQL 5.1.32, and MySQL Cluster NDB 7.0.6 is based on MySQL 5.1.34 (version string: mysql-5.1.34-ndb-7.0.6).

Compatibility with standard MySQL 5.1 releases.  While many standard MySQL schemas and applications can work using MySQL Cluster, it is also true that unmodified applications and database schemas may be slightly incompatible or have suboptimal performance when run using MySQL Cluster (see Section 17.1.6, “Known Limitations of MySQL Cluster”). Most of these issues can be overcome, but this also means that you are very unlikely to be able to switch an existing application datastore—that currently uses, for example, MyISAM or InnoDB—to use the NDB storage engine without allowing for the possibility of changes in schemas, queries, and applications. Moreover, from MySQL 5.1.24 onwards, the MySQL Server and MySQL Cluster codebases diverge considerably (and NDB storage engine support dropped from subsequent MySQL Server releases), so that the standard mysqld cannot function as a dropin replacement for the version of mysqld that is supplied with MySQL Cluster.

MySQL Cluster development source trees.  MySQL Cluster development trees can also be accessed from https://code.launchpad.net/~mysql/:

The MySQL Cluster development sources maintained at https://code.launchpad.net/~mysql/ are licensed under the GPL. For information about obtaining MySQL sources using Bazaar and building them yourself, see Section 2.11.3, “Installing MySQL Using a Development Source Tree”.

Currently, MySQL Cluster NDB 7.0, MySQL Cluster NDB 7.1, and MySQL Cluster NDB 7.2 releases are all Generally Available (GA), although we recommend that new deployments use MySQL Cluster NDB 7.2. MySQL Cluster NDB 6.1, MySQL Cluster NDB 6.2, and MySQL Cluster NDB 6.3, are no longer in active development. For an overview of major features added in MySQL Cluster NDB 6.x and 7.x releases, see Section 17.1.4, “MySQL Cluster Development History”. For an overview of major features added in MySQL Cluster NDB 7.2, see MySQL Cluster Development History.

This chapter represents a work in progress, and its contents are subject to revision as MySQL Cluster continues to evolve. Additional information regarding MySQL Cluster can be found on the MySQL Web site at http://www.mysql.com/products/cluster/.

Additional Resources.  More information about MySQL Cluster can be found in the following places: