Configuration files
In this section we are going to create the configuration files for the three main components of the architecture: the management server and two MySQLd server (the first one is a master server).
#This is the configuration of the mgmt node
#Put this content in a file called $MGMT_ETC/config.ini
[NDB_MGMD]
Id=1
Hostname=[PUT HERE THE IPADDRESS OF MGMT NODE]
PortNumber=1186
Datadir=[PUT HERE THE VALUE OF MGMT_DATADIR]
[NDBD]
Id=2
Hostname=[PUT HERE THE IPADDRESS OF NODE1]
Datadir=[PUT HERE THE VALUE OF NODE1_DATADIR]
[NDBD]
Id=3
Hostname=[PUT HERE THE IPADDRESS OF NODE2]
Datadir=[PUT HERE THE VALUE OF NODE2_DATADIR]
[MYSQLD]
[MYSQLD]
#This is the configuration of node1
#Put this content in a file called my.cnf.master in $NODE1_ETC
[MYSQLD]
user=mysql #the user running MySQL
basedir=[PUT HERE THE VALUE OF NODE1_HOME]
datadir=[PUT HERE THE VALUE OF NODE1_DATADIR]
pid-file = [PUT HERE THE VALUE OF NODE1_VAR]/run/mysqld.pid
socket = [PUT HERE THE VALUE OF NODE1_VAR]/run/mysqld.sock
log-error = [PUT HERE THE VALUE OF NODE1_VAR]/log/mysqld.err
bind-address = [PUT HERE THE IPADDRESS OF NODE 1]
ndb-cluster-connection-pool=1
ndbcluster
ndb-connectstring=”[PUT HERE THE IPADDRESS OF MGMT NODE]”
ndb-force-send=1
ndb-use-exact-count=0
ndb-extra-logging=1
ndb-autoincrement-prefetch-sz=256
engine-condition-pushdown=1
#REPLICATION SPECIFIC – GENERAL
#server-id must be unique across all mysql servers participating in replication.
server-id=4
#REPLICATION SPECIFIC – MASTER
log-bin
#This is the configuration of node2
#Put this content in a file called my.cnf in $NODE2_ETC
[MYSQLD]
user=mysql #the user running MySQL
basedir=[PUT HERE THE VALUE OF NODE2_HOME]
datadir=[PUT HERE THE VALUE OF NODE2_DATADIR]
pid-file = [PUT HERE THE VALUE OF NODE2_VAR]/run/mysqld.pid
socket = [PUT HERE THE VALUE OF NODE2_VAR]/run/mysqld.sock
log-error = [PUT HERE THE VALUE OF NODE2_VAR]/log/mysqld.err
bind-address = [PUT HERE THE IPADDRESS OF NODE 2]
ndb-cluster-connection-pool=1
ndbcluster
ndb-connectstring=”[PUT HERE THE IPADDRESS OF MGMT NODE]”
ndb-force-send=1
ndb-use-exact-count=0
ndb-extra-logging=1
ndb-autoincrement-prefetch-sz=256
engine-condition-pushdown=1
#server-id must be unique across all mysql servers participating in replication.
server-id=5

Hi,
Thanks a lot. This demonstration is very useful to me and it is working fine. I have installed and tested the mysql clusters in my single linux machine.
Very useful………………..
Hi Karuna,
many thanks for your feedback: I tried all these steps for a clean installation but I’m also the writer of this tutorial
Bye
Apiero
Hi..
I am facing problem after completing cluster configuration, cluster runs properly but i dont see “Master” in [ndbd(NDB)] 2 nodes, both nodes show:
[ndbd(NDB)] 2 node(s)
id=2 @192.168.42.174 (mysql-5.1.23 ndb-6.2.15, starting, Nodegroup: 0)
id=3 @192.168.42.175 (mysql-5.1.23 ndb-6.2.15, starting, Nodegroup: 0)
I am using Redhat Enterprise 5.
Please Help
Hi,
did you verify that the firewall was disabled? Maybe it is blocking some ports
Try, as root, with:
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
Please let me know if it works or not.
Bye
Apiero
when trying to run the deamon in the final step get the following error msg:
/usr/lib/mysql_cluster/node_1/bin/mysqld: Table ‘mysql.plugin’ doesn’t exist
090122 18:01:18 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
090122 18:01:18 InnoDB: Started; log sequence number 0 46409
090122 18:01:18 [Note] Starting Cluster Binlog Thread
090122 18:01:18 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
any idea why?
Hi Kagan,
did you use the exact versions of MySQL that I did? It looks like you missed the first part of page 6 (http://www.brucalipto.org/linux/how-to-install-a-mysql-cluster/6).
Please let me know if it works or not.
Bye
Apiero
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
hi mate, i’ve managed to get almost everything working..
instead of doing everything on one host, i did it with 3 VMs, one is management, and 2 nodes/storage.
I got the nodes to connect without problems. but i can’t get the mysql database to connect. any ideas?
Cluster Configuration
———————
[ndbd(NDB)] 2 node(s)
id=2 @172.12.13.105 (Version: 7.0.6, starting, Nodegroup: 0)
id=3 @172.12.13.106 (Version: 7.0.6, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @mgm01 (Version: 7.0.6)
[mysqld(API)] 2 node(s)
id=4 (not connected, accepting connect from any host)
id=5 (not connected, accepting connect from any host)
thanks
Hi.
Do you think is it better a cluster or a replication (1 master – n slave) configuration in a situation of an high load website?
And have you ever tried mysql proxy as loadbalancer?
Hi,
I think that in a situation of an high load website a cluster would be better but keep in mind that the MySQL cluster has many “limitation”: not really limitations but its own rules. Keep in mind that MySQL is very fast so maybe a simple node could be sufficient.
I tried to look at MySQL proxy as loadbalancer but I did not understand how does it work: actually if I would need to setup something “big” with MySQL I would try MMM (Multi-Master Replication Manager) for MySQL[1].
Please let me know what was your choice!
Bye
Apiero
[1]http://mysql-mmm.org/
Hi,
(still alive ?)
im having a question …
i am running the ndb managment server and the mysql server one on the same server and the mysql server 2 on a second server.
if the server 1 (with mysql1 and mgmt server) crashes > there is data loss > what will append when i will restart the whole servers ?
the cluster system is only transmitting the queries ? isn’t it?
Subscribed!
I normally don’t write-up in Blogs but your weblog forced me to, awesome operate.. stunning
Been looking for this article for long time ago and finally found here. thanks for sharing this post. appreciate!