18.5 Management of MySQL Cluster

18.5.1 Summary of MySQL Cluster Start Phases
18.5.2 Commands in the MySQL Cluster Management Client
18.5.3 Online Backup of MySQL Cluster
18.5.4 MySQL Server Usage for MySQL Cluster
18.5.5 Performing a Rolling Restart of a MySQL Cluster
18.5.6 Event Reports Generated in MySQL Cluster
18.5.7 MySQL Cluster Log Messages
18.5.8 MySQL Cluster Single User Mode
18.5.9 Quick Reference: MySQL Cluster SQL Statements
18.5.10 The ndbinfo MySQL Cluster Information Database
18.5.11 MySQL Cluster Security Issues
18.5.12 MySQL Cluster Disk Data Tables
18.5.13 Adding MySQL Cluster Data Nodes Online
18.5.14 Distributed MySQL Privileges for MySQL Cluster
18.5.15 NDB API Statistics Counters and Variables

Managing a MySQL Cluster involves a number of tasks, the first of which is to configure and start MySQL Cluster. This is covered in Section 18.3, “Configuration of MySQL Cluster NDB 7.2”, and Section 18.4, “MySQL Cluster Programs”.

The next few sections cover the management of a running MySQL Cluster.

For information about security issues relating to management and deployment of a MySQL Cluster, see Section 18.5.11, “MySQL Cluster Security Issues”.

There are essentially two methods of actively managing a running MySQL Cluster. The first of these is through the use of commands entered into the management client whereby cluster status can be checked, log levels changed, backups started and stopped, and nodes stopped and started. The second method involves studying the contents of the cluster log ndb_node_id_cluster.log; this is usually found in the management server's DataDir directory, but this location can be overridden using the LogDestination option. (Recall that node_id represents the unique identifier of the node whose activity is being logged.) The cluster log contains event reports generated by ndbd. It is also possible to send cluster log entries to a Unix system log.

Some aspects of the cluster's operation can be also be monitored from an SQL node using the SHOW ENGINE NDB STATUS statement.

More detailed information about MySQL Cluster operations is available in real time through an SQL interface using the ndbinfo database. For more information, see Section 18.5.10, “The ndbinfo MySQL Cluster Information Database”.

NDB statistics counters provide improved monitoring using the mysql client. These counters, implemented in the NDB kernel, relate to operations performed by or affecting Ndb objects, such as starting, closing, and aborting transactions; primary key and unique key operations; table, range, and pruned scans; blocked threads waiting for various operations to complete; and data and events sent and received by MySQL Cluster. The counters are incremented by the NDB kernel whenever NDB API calls are made or data is sent to or received by the data nodes.

mysqld exposes the NDB API statistics counters as system status variables, which can be identified from the prefix common to all of their names (Ndb_api_). The values of these variables can be read in the mysql client from the output of a SHOW STATUS statement, or by querying either the SESSION_STATUS table or the GLOBAL_STATUS table (in the INFORMATION_SCHEMA database). By comparing the values of the status variables before and after the execution of an SQL statement that acts on NDB tables, you can observe the actions taken on the NDB API level that correspond to this statement, which can be beneficial for monitoring and performance tuning of MySQL Cluster.

MySQL Enterprise Monitor can also be used to monitor MySQL Servers that are part of a MySQL Cluster deployment. MySQL Enterprise Monitor 2.3, added a MySQL Cluster advisor, including a set of graphs providing information on MySQL Cluster resources, and defining rules for alerts on key information from data nodes such as DataMemory usage. This information is made available to MySQL Enterprise Monitor 2.3 or later by any MySQL Server which is connected to the MySQL Cluster, using ndbinfo. The advisor could be run against a single MySQL Server in the Cluster, or against a pair in order to provide a higher level of availability for the monitoring service. For more information, see the MySQL Enterprise Monitor 2.3 Manual.

MySQL Cluster Manager provides an advanced command-line interface that simplifies many otherwise complex MySQL Cluster management tasks, such as starting, stopping, or restarting a MySQL Cluster with a large number of nodes. The MySQL Cluster Manager client also supports commands for getting and setting the values of most node configuration parameters as well as mysqld server options and variables relating to MySQL Cluster. MySQL Cluster Manager 1.1 provides support for adding data nodes online. See the MySQL Cluster Manager 1.1 User Manual, for more information.