1.Download the RPM from MySQL.com
2.Install the RPM and dependencies
yum groupinstall 'Development Tools'
yum remove mysql-libs
yum install libaio-devel
rpm -Uhv MySQL-Cluster-server-gpl-7.3.5-1.el6.x86_64.rpm
This installs all the binaries that will be required to configure each component of the MySQL Cluster.
Management Node(s) [ndb_mgmd]
MySQL cluster has a configuration file config.ini which should reside on all management nodes. The configuration file is made up of three(3) main sections:
- [ndbd default] – Section for parameters that are shared between each node
- [ndb_mgmd] – Section for parameters for management node/daemon
- [ndbd] – Section for parameters related to the storage/data node
- [mysqld] – Section for parameters related the mysql node
Ensure that the ndbd is installed on your server . You can compile and install this separately or you can repeat steps 1 & 2 under Installing. Configure /etc/my.cnf with the information below. This allows the storage nodes to find their management node(s)
MySQL Server Node(s)[mysqld]
1. Configure /etc/my.cnf to connect to the NDB cluster. Installed seem to be here /usr/my.cnf but MySQL server will search /etc/my.cnf first
# Enable MySQL Cluster
# Tell this node where to find its management node
# Default storage engine
default-storage-engine = ndbcluster
Ensure that Iptables is disabled or the the correct rules have been put in place to allow connections on port 1186 . You might want to restrict this to only the data nodes that should be talking to your management node(s).
service iptables stop chkconfig iptables off
To start MySQL Cluster the following steps must be done in order:
1.Start Management Node(s)
You should see the following output in your
Lets quickly check to ensure the cluster is up and running. Execute
at the prompt to get a quick overview of the status of the cluster. As you can see below we have two data nodes(NDB), 1 SQL node(mysqld) and 1 management node(MGM). Only the management node is currently running.
2. Start the Data Node(s)
Execute the following command on each data node. The –initial parameter should only be used for new deployments.
You should now see an updated status from the management node shell. Indicating that the 2 data nodes(NDB) are now connected.
3.Start MySQL Node(s)
service mysql start
Verifiy that the MySQL server has successfully joined the cluster.
4. Check NDB Engine Status
Test MySQL Cluster
In Cento’s case the binaries for the cluster specific version of MySQL Cluster was installed at
Create Database and Tables
create database test_database;
Create test table and data and then check to ensure that the database and data inserted in the table is accessible from other MySQL nodes that are apart of the cluster.