How to configure a MySQL cluster on CentOS / Redhat

In this article learn how to configure a MySQL cluster with three nodes, one being the management node and two storage nodes.

Well folks, I hope this article will be useful to someone. I am going to clear and quick on the installation and configuration. I hope you enjoy, comments and criticisms are welcome for the betterment of future articles.


Well, let’s get our hands dirty.

Let’s see our work environment.

  • DB1 – – Management Server (MGM) node.
  • DB2 – – Storage Server (NDBD) node 1.
  • DB3 – – Storage Server (NDBD) node 2.

1st step – Configuration management server (MGM)

First install the following packages via yum:

# yum install perl-HTML*
# yum install perl-DBD-MySQL

Link to download the MySQL packages used in this tutorial:

Installing packages:
# rpm -ivh MySQL-ndb-management-5.0.90-1.glibc23.i386.rpm
# rpm -ivh MySQL-ndb-tools-5.0.90-1.glibc23.i386.rpm

Create directory:
# mkdir /var/lib/mysql-cluster
# cd /var/lib/mysql-cluster
# vi config.ini

DataMemory=80M # How much memory to allocate for data storage
IndexMemory=18M # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the .world. database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.

# Management Section (MGM)
#NodeId = 1
# IP address of the management node

# Storage Server Section (NDBD)
#NodeId = 2
# IP address of the Storage Server (NDBD) node 1

#NodeId = 3
# IP address of the Storage Server (NDBD) node 2

# one [MYSQLD] per storage node
# 2 Clientes MySQL
#NodeId = 5
#NodeId = 6


After configuring the IP addresses of servers in the configuration file jameshallison casino config.ini, it is necessary to start the Management Service:
# ndb_mgmd
Command to enter the administration console:
# ndb_mgm
Command “SHOW” shows the nodes that are connected to the cluster:
ndb_mgm> show
Command “HELP” for further information:
ndb_mgm> help

As we don’t have any other node yet, let’s create them!


Leave a Reply

Your email address will not be published. Required fields are marked *