In the following section, we answer questions that are frequently
asked about MySQL Cluster and the NDBCLUSTER
storage engine.
Questions
29.10.1: Which versions of the MySQL software support Cluster? Do I have to compile from source?
29.10.2: What does “NDB” mean?
29.10.3: What is the difference between using MySQL Cluster vs using MySQL replication?
29.10.4: Do I need to do any special networking to run MySQL Cluster? How do computers in a cluster communicate?
29.10.5: How many computers do I need to run a MySQL Cluster, and why?
29.10.6: What do the different computers do in a MySQL Cluster?
29.10.7: With which operating systems can I use Cluster?
29.10.8: What are the hardware requirements for running MySQL Cluster?
29.10.9: How much RAM do I need to use MySQL Cluster? Is it possible to use disk memory at all?
29.10.10: What filesystems can I use with MySQL Cluster? What about network filesystems or network shares?
29.10.11: Can I run MySQL Cluster nodes inside virtual machines (such as those created by VirtualBox, VMWare, Parallels, or Xen)?
29.10.12:
I am trying to populate a MySQL Cluster database. The
loading process terminates prematurely and I get an error
message like this one:
ERROR 1114: The table 'my_cluster_table'
is full
Why is this happening?
29.10.13: MySQL Cluster uses TCP/IP. Does this mean that I can run it over the Internet, with one or more nodes in remote locations?
29.10.14: Do I have to learn a new programming or query language to use MySQL Cluster?
29.10.15: How do I find out what an error or warning message means when using MySQL Cluster?
29.10.16: Is MySQL Cluster transaction-safe? What isolation levels are supported?
29.10.17: What storage engines are supported by MySQL Cluster?
29.10.18: In the event of a catastrophic failure — say, for instance, the whole city loses power and my UPS fails — would I lose all my data?
29.10.19:
Is it possible to use FULLTEXT indexes
with MySQL Cluster?
29.10.20: Can I run multiple nodes on a single computer?
29.10.21: Can I add data nodes to a MySQL Cluster without restarting it?
29.10.22: Are there any limitations that I should be aware of when using MySQL Cluster?
29.10.23: How do I import an existing MySQL database into a MySQL Cluster?
29.10.24: How do cluster nodes communicate with one another?
29.10.25: What is an arbitrator?
29.10.26: What data types are supported by MySQL Cluster?
29.10.27: How do I start and stop MySQL Cluster?
29.10.28: What happens to MySQL Cluster data when the cluster is shut down?
29.10.29: Is it a good idea to have more than one management node for a MySQL Cluster?
29.10.30: Can I mix different kinds of hardware and operating systems in one MySQL Cluster?
29.10.31: Can I run two data nodes on a single host? Two SQL nodes?
29.10.32: Can I use hostnames with MySQL Cluster?
29.10.33: How do I handle MySQL users in a MySQL Cluster having multiple MySQL servers?
29.10.34: How do I continue to send queries in the event that one of the SQL nodes fails?
Questions and Answers
29.10.1: Which versions of the MySQL software support Cluster? Do I have to compile from source?
Beginning with MySQL 5.1.24, MySQL Cluster is no longer supported in standard MySQL Server 5.1 releases. Instead, MySQL Cluster is now released as a separate product. Currently, two MySQL Cluster release series are available:
MySQL Cluster NDB 6.2. This is the preferred series for production use. The latest MySQL Cluster NDB 6.2 sources and binaries can be obtained from http://dev.mysql.com/downloads/cluster.
MySQL Cluster NDB 6.3. This series can also be used in production; however, you must compile the binaries yourself. The latest MySQL Cluster NDB 6.3 sources can be obtained from the MySQL FTP site at ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/.
You should use MySQL NDB Cluster NDB 6.2 or 6.3 for new deployments, and to upgrade to one of these release series if you are using a previous version of MySQL with clustering support. For an overview of improvements in MySQL Cluster NDB 6.2 and 6.3, see Section 20.15.3, “Features Added in MySQL Cluster NDB 6.2”, and Section 20.15.4, “Features Added in MySQL Cluster NDB 6.3”.
You can determine whether your server has
NDB support using either either of the
statements SHOW VARIABLES LIKE 'have_%'
or SHOW ENGINES.
29.10.2: What does “NDB” mean?
This stands for
“Network
Database”.
NDB (also known as
NDBCLUSTER) is the storage engine that
enables clustering in MySQL.
29.10.3: What is the difference between using MySQL Cluster vs using MySQL replication?
In traditional MySQL replication, a master MySQL server
updates one or more slaves. Transactions are committed
sequentially, and a slow transaction can cause the slave to
lag behind the master. This means that if the master fails,
it is possible that the slave might not have recorded the
last few transactions. If a transaction-safe engine such as
InnoDB is being used, a transaction will
either be complete on the slave or not applied at all, but
replication does not guarantee that all data on the master
and the slave will be consistent at all times. In MySQL
Cluster, all data nodes are kept in synchrony, and a
transaction committed by any one data node is committed for
all data nodes. In the event of a data node failure, all
remaining data nodes remain in a consistent state.
In short, whereas standard MySQL replication is asynchronous, MySQL Cluster is synchronous.
We have implemented (asynchronous) replication for MySQL Cluster in MySQL 5.1 and MySQL Cluster NDB 6.x. This includes the capability to replicate both between two clusters, and from a MySQL Cluster to a non-Cluster MySQL server. See Section 20.11, “MySQL Cluster Replication”.
29.10.4: Do I need to do any special networking to run MySQL Cluster? How do computers in a cluster communicate?
MySQL Cluster is intended to be used in a high-bandwidth environment, with computers connecting via TCP/IP. Its performance depends directly upon the connection speed between the cluster's computers. The minimum connectivity requirements for MySQL Cluster include a typical 100-megabit Ethernet network or the equivalent. We recommend you use gigabit Ethernet whenever available.
The faster SCI protocol is also supported, but requires special hardware. See Section 20.13, “Using High-Speed Interconnects with MySQL Cluster”, for more information about SCI.
29.10.5: How many computers do I need to run a MySQL Cluster, and why?
A minimum of three computers is required to run a viable cluster. However, the minimum recommended number of computers in a MySQL Cluster is four: one each to run the management and SQL nodes, and two computers to serve as data nodes. The purpose of the two data nodes is to provide redundancy; the management node must run on a separate machine to guarantee continued arbitration services in the event that one of the data nodes fails.
To provide increased throughput and high availability, you should use multiple SQL nodes (MySQL Servers connected to the cluster). It is also possible (although not strictly necessary) to run multiple management servers.
29.10.6: What do the different computers do in a MySQL Cluster?
A MySQL Cluster has both a physical and logical organization, with computers being the physical elements. The logical or functional elements of a cluster are referred to as nodes, and a computer housing a cluster node is sometimes referred to as a cluster host. There are three types of nodes, each corresponding to a specific role within the cluster. These are:
Management node. This node provides management services for the cluster as a whole, including startup, shutdown, backups, and configuration data for the other nodes. The management node server is implemented as the application ndb_mgmd; the management client used to control MySQL Cluster is ndb_mgm.
Data node.
This type of node stores and replicates data. Data
node functionality is handled by instances of the
NDB data node process
ndbd.
SQL node.
This is simply an instance of MySQL Server
(mysqld) that is built with support
for the NDBCLUSTER storage engine
and started with the --ndb-cluster
option to enable the engine and the
--ndb-connectstring option to
enable it to connect to a MySQL Cluster management
server. For more about these options, see
Section 20.4.2, “MySQL Cluster-Related Command Options for mysqld”.
An API node is any application that makes direct use of Cluster data nodes for data storage and retrieval. An SQL node can thus be considered a type of API node that uses a MySQL Server to provide an SQL interface to the Cluster. You can write such applications (that do not depend on a MySQL Server) using the NDB API, which supplies a direct, object-oriented transaction and scanning interface to MySQL Cluster data; see The NDB API, for more information.
29.10.7: With which operating systems can I use Cluster?
MySQL Cluster is supported on most Unix-like operating systems, including Linux, Mac OS X, Solaris, and HP-UX. MySQL Cluster is not supported on Windows at this time. We are working to add MySQL Cluster support for other platforms, including Windows; eventually we intend to offer MySQL Cluster on all platforms for which MySQL itself is supported.
For more detailed information concerning the level of support which is offered for MySQL Cluster on various operating system versions, OS distributions, and hardware platforms, please refer to http://www.mysql.com/support/supportedplatforms/cluster.html.
29.10.8: What are the hardware requirements for running MySQL Cluster?
MySQL Cluster should run on any platform for which
NDB-enabled binaries are available. For
data nodes, faster CPUs and more memory are likely to
improve performance, and 64-bit CPUs are likely to be more
effective than 32-bit processors. There must be sufficient
memory on machines used for data nodes to hold each node's
share of the database (see How much RAM do I
Need? for more information). Nodes can
communicate via a standard TCP/IP network and hardware. For
SCI support, special networking hardware is required (see
Section 20.13, “Using High-Speed Interconnects with MySQL Cluster”).
29.10.9: How much RAM do I need to use MySQL Cluster? Is it possible to use disk memory at all?
Previous to MySQL 5.1 (including MySQL Cluster NDB 6.2 and 6.3), MySQL Cluster was in-memory only. This meant that all table data (including indexes) was stored in RAM. If your data took up 1 GB of space and you wanted to replicate it once in the cluster, you needed 2 GB of memory to do so (1 GB per replica). This was in addition to the memory required by the operating system and any applications running on the cluster computers. This is still true of in-memory tables.
If a data node's memory usage exceeds what is available
in RAM, then the system will attempt to use swap space up to
the limit set for DataMemory. However,
this will at best result in severely degraded performance,
and may cause the node to be dropped due to slow response
time (missed heartbeats). We do not recommend on relying on
disk swapping in a production environment for this reason.
In any case, once the DataMemory limit is
reached, any operations requiring additional memory (such as
inserts) will fail.
NDBCLUSTER in MySQL 5.1
includes support for Disk Data, which helps to alleviate
these issues. See Section 20.12, “MySQL Cluster Disk Data Tables”,
for more information.
You can use the following formula for obtaining a rough estimate of how much RAM is needed for each data node in the cluster:
(SizeofDatabase × NumberOfReplicas × 1.1 ) / NumberOfDataNodes
To calculate the memory requirements more exactly requires determining, for each table in the cluster database, the storage space required per row (see Section 10.5, “Data Type Storage Requirements”, for details), and multiplying this by the number of rows. You must also remember to account for any column indexes as follows:
Each primary key or hash index created for an
NDBCLUSTER table requires 21–25
bytes per record. These indexes use
IndexMemory.
Each ordered index requires 10 bytes storage per record,
using DataMemory.
Creating a primary key or unique index also creates an
ordered index, unless this index is created with
USING HASH. In other words:
A primary key or unique index on a Cluster table normally takes up 31 to 35 bytes per record.
However, if the primary key or unique index is
created with USING HASH, then it
requires only 21 to 25 bytes per record.
Note that creating MySQL Cluster tables with USING
HASH for all primary keys and unique indexes will
generally cause table updates to run more quickly — in
some cases by a much as 20 to 30 percent faster than updates
on tables where USING HASH was not used
in creating primary and unique keys. This is due to the fact
that less memory is required (because no ordered indexes are
created), and that less CPU must be utilized (because fewer
indexes must be read and possibly updated). However, it also
means that queries that could otherwise use range scans must
be satisfied by other means, which can result in slower
selects.
When calculating Cluster memory requirements, you may find
useful the ndb_size.pl utility which is
available in recent MySQL 5.1 releases. This
Perl script connects to a current (non-Cluster) MySQL
database and creates a report on how much space that
database would require if it used the
NDBCLUSTER storage engine. For more
information, see
Section 20.10.15, “ndb_size.pl — NDBCLUSTER Size Requirement Estimator”.
It is especially important to keep in mind that
every MySQL Cluster table must have a primary
key. The NDB storage engine
creates a primary key automatically if none is defined, and
this primary key is created without USING
HASH.
To determine how much memory is being used for storage of
Cluster indexes at any given time, you can check the Cluster
log for the warnings which are written to it when 80% of
available DataMemory or
IndexMemory is in use, and again when use
reaches 85%, 90%, and so on. Beginning with MySQL Cluster
NDB 6.2.3 and 6.3.0, you can use the REPORT
MemoryUsage command in the cluster management
client to obtain a real-time report of the amount of memory
used to store MySQL Cluster data and indexes. For more
information about this comannd, see
29.10.10: What filesystems can I use with MySQL Cluster? What about network filesystems or network shares?
Generally, any filesystem that is native to the host operating system should work well with MySQL Cluster. If you find that a given filesystem works particularly well (or not so especially well) with MySQL Cluster, we invite you to discuss your findings in the MySQL Cluster Forums.
We do not test MySQL Cluster with FAT or
VFAT filesystems on Linux. Because of
this, and due to the fact that these are not very useful for
any purpose other than sharing disk partitions between Linux
and Windows operating systems on multi-boot computers, we do
not recommend their use with MySQL Cluster.
MySQL Cluster is implemented as a shared-nothing solution; the idea behind this is that the failure of a single piece of hardware should not cause the failure of multiple cluster nodes, or possibly even the failure of the cluster as a whole. For this reason, the use of network shares or network filesystems is not supported for MySQL Cluster. This also applies to shared storage devices such as SANs.
29.10.11: Can I run MySQL Cluster nodes inside virtual machines (such as those created by VirtualBox, VMWare, Parallels, or Xen)?
This is possible but not recommended for a production environment.
We have found that running MySQL Cluster processes inside a virtual machine can give rise to issues with timing and disk subsystems that have a strong negative impact on the operation of the cluster. The behavior of the cluster is often unpredictable in these cases.
If an issue can be reproduced outside the virtual environment, then we may be able to provide assistance. Otherwise, we cannot support it at this time.
29.10.12:
I am trying to populate a MySQL Cluster database. The
loading process terminates prematurely and I get an error
message like this one:
ERROR 1114: The table 'my_cluster_table'
is full
Why is this happening?
The cause is very likely to be that your setup does not
provide sufficient RAM for all table data and all indexes,
including the primary key required by the
NDB storage engine and automatically
created in the event that the table definition does not
include the definition of a primary key.
It is also worth noting that all data nodes should have the same amount of RAM, since no data node in a cluster can use more memory than the least amount available to any individual data node. For example, if there are four computers hosting Cluster data nodes, and three of these have 3GB of RAM available to store Cluster data while the remaining data node has only 1GB RAM, then each data node can devote at most 1GB to MySQL Cluster data and indexes.
29.10.13: MySQL Cluster uses TCP/IP. Does this mean that I can run it over the Internet, with one or more nodes in remote locations?
It is very unlikely that a cluster would perform reliably under such conditions, as MySQL Cluster was designed and implemented with the assumption that it would be run under conditions guaranteeing dedicated high-speed connectivity such as that found in a LAN setting using 100 Mbps or gigabit Ethernet — preferably the latter. We neither test nor warrant its performance using anything slower than this.
Also, it is extremely important to keep in mind that communications between the nodes in a MySQL Cluster are not secure; they are neither encrypted nor safeguarded by any other protective mechanism. The most secure configuration for a cluster is in a private network behind a firewall, with no direct access to any Cluster data or management nodes from outside. (For SQL nodes, you should take the same precautions as you would with any other instance of the MySQL server.) For more information, see Section 20.8, “MySQL Cluster Security Issues”.
29.10.14: Do I have to learn a new programming or query language to use MySQL Cluster?
No. Although some specialized commands are used to manage and configure the cluster itself, only standard (My)SQL queries and commands are required for the following operations:
Creating, altering, and dropping tables (including Disk Data tables and related objects)
Inserting, updating, and deleting table data
Creating, changing, and dropping primary and unique indexes
Some specialized configuration parameters and files are required to set up a MySQL Cluster — see Section 20.3.4, “Configuration File”, for information about these.
A few simple commands are used in the MySQL Cluster management client (ndb_mgm) for tasks such as starting and stopping cluster nodes. See Section 20.7.2, “Commands in the MySQL Cluster Management Client”.
29.10.15: How do I find out what an error or warning message means when using MySQL Cluster?
There are two ways in which this can be done:
29.10.16: Is MySQL Cluster transaction-safe? What isolation levels are supported?
Yes: For tables created with the
NDB storage engine, transactions are
supported. Currently, MySQL Cluster supports only the
READ COMMITTED transaction isolation
level.
29.10.17: What storage engines are supported by MySQL Cluster?
Clustering with MySQL is supported only by the
NDB storage engine. That is, in order for
a table to be shared between nodes in a MySQL Cluster, the
table must be created using ENGINE=NDB
(or the equivalent option
ENGINE=NDBCLUSTER).
It is possible to create tables using other storage engines
(such as MyISAM or
InnoDB) on a MySQL server being used with
a MySQL Cluster, but these non-NDB tables
do not participate in clustering; they
are strictly local to the individual MySQL server instance
on which they are created.
29.10.18: In the event of a catastrophic failure — say, for instance, the whole city loses power and my UPS fails — would I lose all my data?
All committed transactions are logged. Therefore, although it is possible that some data could be lost in the event of a catastrophe, this should be quite limited. Data loss can be further reduced by minimizing the number of operations per transaction. (It is not a good idea to perform large numbers of operations per transaction in any case.)
29.10.19:
Is it possible to use FULLTEXT indexes
with MySQL Cluster?
FULLTEXT indexing is not supported by any
storage engine other than MyISAM. We are
working to add this capability to MySQL Cluster tables in a
future release.
29.10.20: Can I run multiple nodes on a single computer?
It is possible but not advisable. One of the chief reasons to run a cluster is to provide redundancy. To obtain the full benefits of this redundancy, each node should reside on a separate machine. If you place multiple nodes on a single machine and that machine fails, you lose all of those nodes. Given that MySQL Cluster can be run on commodity hardware loaded with a low-cost (or even no-cost) operating system, the expense of an extra machine or two is well worth it to safeguard mission-critical data. It also worth noting that the requirements for a cluster host running a management node are minimal. This task can be accomplished with a 200 MHz Pentium CPU and sufficient RAM for the operating system plus a small amount of overhead for the ndb_mgmd and ndb_mgm processes.
It is acceptable to run multiple cluster data nodes on a single host for learning about MySQL Cluster, or for testing purposes; however, this is not generally supported for production use.
29.10.21: Can I add data nodes to a MySQL Cluster without restarting it?
Not at present. A rolling restart is all that is required for adding new management or SQL nodes to a MySQL Cluster (see Section 20.5.1, “Performing a Rolling Restart of the Cluster”). Adding data nodes is more complex, and requires the following steps:
Make a complete backup of all Cluster data.
Completely shut down the cluster and all cluster node processes.
Restart the cluster, using the
--initial startup option for all
instances of ndbd.
Never use the --initial when starting
ndbd except when necessary to clear
the data node filesystem. See
Section 20.6.5.1, “Command Options for ndbd”,
for information about when this is required.
Restore all cluster data from the backup.
In a future MySQL Cluster release series, we hope to implement a “hot” reconfiguration capability for MySQL Cluster to minimize (if not eliminate) the requirement for restarting the cluster when adding new nodes.
29.10.22: Are there any limitations that I should be aware of when using MySQL Cluster?
Limitations on NDB tables in MySQL
5.1 (including MySQL Cluster NDB 6.x) include
the following:
Temporary tables are not supported; a CREATE
TEMPORARY TABLE statement using
ENGINE=NDB or
ENGINE=NDBCLUSTER fails with an
error.
The only types of user-defined partitioning supported
for NDB tables are
KEY and LINEAR
KEY. (Beginning with MySQL 5.1.12, attempting
to create an NDB table using any
other partitioning type fails with an error.)
FULLTEXT indexes and index prefixes
are not supported. Only complete columns may be indexed.
Spatial indexes are not supported (although spatial columns can be used). See Chapter 22, Spatial Extensions.
Only complete rollbacks for transactions are supported. Partial rollbacks and rollbacks to save points are not supported.
The maximum number of attributes allowed per table is 128, and attribute names cannot be any longer than 31 characters. For each table, the maximum combined length of the table and database names is 122 characters.
The maximum size for a table row is 8 kilobytes, not
counting BLOB values. There is no set
limit for the number of rows per table. Table size
limits depend on a number of factors, in particular on
the amount of RAM available to each data node.
The NDB engine does not support
foreign key constraints. As with
MyISAM tables, if these are specified
in a CREATE TABLE or ALTER
TABLE statement, they are ignored.
For a complete listing of limitations in MySQL Cluster, see Section 20.14, “Known Limitations of MySQL Cluster”.
29.10.23: How do I import an existing MySQL database into a MySQL Cluster?
You can import databases into MySQL Cluster much as you
would with any other version of MySQL. Other than the
limitations mentioned elsewhere in this FAQ, the only other
special requirement is that any tables to be included in the
cluster must use the NDB storage engine.
This means that the tables must be created with
ENGINE=NDB or
ENGINE=NDBCLUSTER.
It is also possible to convert existing tables using other
storage engines to NDBCLUSTER using one
or more ALTER TABLE statement. However,
the definition of the table must be compatible with the
NDBCLUSTER storage engine prior to making
the conversion.
See Section 20.14, “Known Limitations of MySQL Cluster”, for details.
29.10.24: How do cluster nodes communicate with one another?
Cluster nodes can communicate via any of three different transport mechanisms: TCP/IP, SHM (shared memory), and SCI (Scalable Coherent Interface). Where available, SHM is used by default between nodes residing on the same cluster host; however, this is considered experimental. SCI is a high-speed (1 gigabit per second and higher), high-availability protocol used in building scalable multi-processor systems; it requires special hardware and drivers. See Section 20.13, “Using High-Speed Interconnects with MySQL Cluster”, for more about using SCI as a transport mechanism for MySQL Cluster.
29.10.25: What is an arbitrator?
If one or more nodes in a cluster fail, it is possible that not all cluster nodes will be able to “see” one another. In fact, it is possible that two sets of nodes might become isolated from one another in a network partitioning, also known as a “split brain” scenario. This type of situation is undesirable because each set of nodes tries to behave as though it is the entire cluster.
When cluster nodes go down, there are two possibilities. If more than 50% of the remaining nodes can communicate with each other, we have what is sometimes called a “majority rules” situation, and this set of nodes is considered to be the cluster. The arbitrator comes into play when there is an even number of nodes: in such cases, the set of nodes to which the arbitrator belongs is considered to be the cluster, and nodes not belonging to this set are shut down.
The preceding information is somewhat simplified. A more complete explanation taking into account node groups follows:
When all nodes in at least one node group are alive, network
partitioning is not an issue, because no one portion of the
cluster can form a functional cluster. The real problem
arises when no single node group has all its nodes alive, in
which case network partitioning (the
“split-brain” scenario) becomes possible. Then
an arbitrator is required. All cluster nodes recognize the
same node as the arbitrator, which is normally the
management server; however, it is possible to configure any
of the MySQL Servers in the cluster to act as the arbitrator
instead. The arbitrator accepts the first set of cluster
nodes to contact it, and tells the remaining set to shut
down. Arbitrator selection is controlled by the
ArbitrationRank configuration parameter
for MySQL Server and management server nodes. (See
Section 20.3.4.4, “Defining the Management Server”, for
details.)
The role of arbitrator does not in and of itself impose any heavy demands upon the host so designated, and thus the arbitrator host does not need to be particularly fast or to have extra memory especially for this purpose.
29.10.26: What data types are supported by MySQL Cluster?
MySQL Cluster 5.1, including MySQL CLuster NDB
6.2 and 6.3, supports all of the usual MySQL data types,
including those associated with MySQL's spatial
extensions; however, the NDBCLUSTER
storage engine does not support spatial indexes. (Spatial
indexes are supported only by MyISAM; see
Chapter 22, Spatial Extensions, for more information.)
In addition, there are some differences with regard to
indexes when used with NDB tables.
MySQL Cluster Disk Data tables (that is, tables created
with TABLESPACE ... STORAGE DISK
ENGINE=NDBCLUSTER) have only fixed-width rows.
This means that (for example) each Disk Data table record
containing a VARCHAR(255) column
requires space for 255 characters (as required for the
character set and collation being used for the table),
regardless of the actual number of characters stored
therein.
See Section 20.14, “Known Limitations of MySQL Cluster”, for more information about these issues.
29.10.27: How do I start and stop MySQL Cluster?
It is necessary to start each node in the cluster separately, in the following order:
Start the management node, using the ndb_mgmd command.
You must include the -f or
--config-file option to tell the
management node where its configuration file can be
found.
Start each data node with the ndbd command.
Each data node must be started with the
-c or --connect-string
option so that the data node knows how to connect to the
management server.
Start each MySQL Server (SQL node) using your preferred startup script, such as mysqld_safe.
Each MySQL Server must be started with the
--ndbcluster and
--ndb-connectstring options. These
options cause mysqld to enable
NDBCLUSTER storage engine support and
how to connect to the management server.
Each of these commands must be run from a system shell on
the machine housing the affected node. (You do not have to
be physically present at the machine — a remote login
shell can be used for this purpose.) You can verify that the
cluster is running by starting the NDB
management client ndb_mgm on the machine
housing the management node and issuing the
SHOW or ALL STATUS
command.
To shut down a running cluster, issue the command
SHUTDOWN in the management client.
Alternatively, you may enter the following command in a
system shell:
shell> ndb_mgm -e "SHUTDOWN"
(The quotation marks are optional; in addition, the
SHUTDOWN command is not case-sensitive.)
Either of these commands causes the ndb_mgm, ndb_mgm, and any ndbd processes to terminate gracefully. MySQL servers running as Cluster SQL nodes can be stopped using mysqladmin shutdown.
For more information, see Section 20.7.2, “Commands in the MySQL Cluster Management Client”, and Section 20.2.6, “Safe Shutdown and Restart”.
29.10.28: What happens to MySQL Cluster data when the cluster is shut down?
The data that was held in memory by the cluster's data nodes is written to disk, and is reloaded into memory the next time that the cluster is started.
29.10.29: Is it a good idea to have more than one management node for a MySQL Cluster?
It can be helpful as a fail-safe. Only one management node controls the cluster at any given time, but it is possible to configure one management node as primary, and one or more additional management nodes to take over in the event that the primary management node fails.
See Section 20.3.4, “Configuration File”, for information on how to configure MySQL Cluster management nodes.
29.10.30: Can I mix different kinds of hardware and operating systems in one MySQL Cluster?
Yes, as long as all machines and operating systems have the same “endianness” (all big-endian or all little-endian). We are working to overcome this limitation in a future MySQL Cluster release.
It is also possible to use software different MySQL Cluster releases on different nodes. However, we support this only as part of a rolling upgrade procedure (see Section 20.5.1, “Performing a Rolling Restart of the Cluster”).
29.10.31: Can I run two data nodes on a single host? Two SQL nodes?
Yes, it is possible to do this. In the case of multiple data nodes, it is advisable (but not required) for each node to use a different data directory. If you want to run multiple SQL nodes on one machine, each instance of mysqld must use a different TCP/IP port. However, running more than one cluster node of a given type per machine is generally not encouraged or supported for production use.
We also advise against running data nodes and SQL nodes together on the same host, since the ndbd and mysqld processes may compete for memory.
29.10.32: Can I use hostnames with MySQL Cluster?
Yes, it is possible to use DNS and DHCP for cluster hosts. However, if your application requires “five nines” availability, we recommend using fixed (numeric) IP addresses. Making communication between Cluster hosts dependent on services such as DNS and DHCP introduces additional potential points of failure.
29.10.33: How do I handle MySQL users in a MySQL Cluster having multiple MySQL servers?
MySQL user accounts and privileges are not automatically propagated between different MySQL servers accessing the same MySQL Cluster. Therefore, you must make sure that these are copied between the SQL nodes yourself. You can do this manually, or automate the task with scripts.
Do not attempt to work around this issue by converting the
MySQL system tables to use the
NDBCLUSTER storage engine. Only the
MyISAM storage engine is supported for
these tables.
29.10.34: How do I continue to send queries in the event that one of the SQL nodes fails?
MySQL Cluster does not provide any sort of automatic failover between SQL nodes. Your application must be prepared to handlethe loss of SQL nodes and to fail over between them.

User Comments
Add your own comment.