16.3. Simple Multi-Computer How-To
This section is a “How-To” that describes the basics
for how to plan, install, configure, and run a MySQL Cluster.
Whereas the examples in
Section 16.4, “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 MySQL Cluster which
meets the minimum requirements for
availability and safeguarding of data.
This section covers hardware and software requirements; networking
issues; installation of MySQL Cluster; configuration issues;
starting, stopping, and restarting the cluster; loading of a
sample database; and performing queries.
This How-To makes the following assumptions:
The cluster setup has four nodes, each on a separate host, and
each with a fixed network address on a typical Ethernet as
|Management (MGM) node
|MySQL server (SQL) node
|Data (NDBD) node "A"
|Data (NDBD) node "B"
This may be made clearer in the following diagram:
Note: 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 hostnames in lieu of IP
addresses in configuring Cluster. Alternatively, you can use
/etc/hosts file or your operating
system's equivalent for providing a means to do host lookup if
such is available.
Each host in our scenario is an Intel-based desktop PC running
a common, generic Linux distribution installed to disk in a
standard configuration, and running no unnecessary services.
The core OS with standard TCP/IP networking capabilities
should be sufficient. Also for the sake of simplicity, we also
assume that the filesystems on all hosts are set up
identically. In the event that they are not, you will need to
adapt these instructions accordingly.
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 via a standard-issue
Ethernet networking appliance such as a switch. (All machines
should use network cards with the same throughout. That is,
all four machines in the cluster should have 100 Mbps cards
or all four machines should have 1 Gbps
cards.) MySQL Cluster will work in a 100 Mbps network;
however, gigabit Ethernet will provide better performance.
Note that MySQL Cluster is not intended
for use in a network for which throughput is less than 100
Mbps. For this reason (among others), attempting to run a
MySQL Cluster over a public network such as the Internet is
not likely to be successful, and is not recommended.
For our sample data, we will use the
database which is available for download from the MySQL AB Web
site. As this database takes up a relatively small amount of
space, we assume that each machine has 256MB RAM, which should
be sufficient for running the operating system, host NDB
process, and (for the data nodes) for storing the database.
Although we refer to a Linux operating system in this How-To, the
instructions and procedures that we provide here should be easily
adaptable to either Solaris or Mac OS X. We also assume that you
already know how to perform a minimal installation and
configuration of the operating system with networking capability,
or that you are able to obtain assistance in this elsewhere if
We discuss MySQL Cluster hardware, software, and networking
requirements in somewhat greater detail in the next section. (See
Section 16.3.1, “Hardware, Software, and Networking”.)