Installing MySQL cluster is fun. For the moment its not supported for windows. Errors during installation are very common and general ones. If you have bit of experience on Linux you got it all.
MySQL cluster is more to high performance that based on server memory. So NDBD service (at least) should run in dedicated servers. All of the configurations inside config.ini need to share among servers.
Extract mysql-cluster-gpl-6.2.15-linux-x86_64-glibc23.tar.gz.gz inside /usr/local/ as root
tar -xvzf mysql-cluster-gpl-6.2.15-linux-x86_64-glibc23.tar.gz.gz
Proceed this on MGMD, NDBD and MySQL servers.
These are not mysql cluster specific, just put it here for complete reference. These are steps on any MySQL instalation on Linux.
/usr/local]# ln -s mysql-cluster-gpl-6.2.15-linux-x86_64-glibc23 mysql
[establish symbolic link /usr/local/mysql to /usr/local/mysql-cluster-gpl-6.2.15-linux-x86_64-glibc23]
/usr/local]# cd mysql
/usr/local/mysql]# groupadd mysql
[create new group 'mysql' under /etc/group]
/usr/local/mysql]# useradd -g mysql mysql
[create new user 'mysql' under the group 'mysql']
/usr/local/mysql]# cp support-files/my-medium.cnf /etc/my.cnf
[the location of my.cnf is searched in the order of: global options - /etc/my.cnf, server-specific options - /usr/local/mysql/data/my.cnf, user-specific options - ~/my.cnf]
/usr/local/mysql]# ./scripts/mysql_install_db --user=mysql
[create the mysql database, privilege tables, and the func table]
/usr/local/mysql]# chown -R root:mysql .
[change user:group ownership to 'root:mysql' under all files and directories of /usr/local/mysql]
/usr/local/mysql]# chown -R mysql:mysql data
This is my my.cnf need to be inside /etc/ or in my case it is /etc/mysql-cluster.
-----------
[mysqld]
ndbcluster
ndb-connectstring='host=192.168.0.11;192.168.0.12'
port = 3306
socket = /tmp/mysql.sock
#Disabling INNODB Engine
skip-innodb
#Maximum number of connections
max_connections=300
#Setting Query Cache
query_cache_size = 32M
#Set Thread Concurrency
thread_cache_size = 8
#Slow Query log
slow_query_log= on
long_query_time= 0.5
-----------
Following is my config.ini which need to be inside MGMD and NDBD nodes. I used /etc/mysql-cluster/ can be specified during service startup
-----------
[TCP DEFAULT]
SendBufferMemory=1M
[ndb_mgmd default]
DataDir = /usr/local/mysql/ndbmgm
[ndb_mgmd]
Id=1
HostName = 192.168.0.11
[ndb_mgmd]
Id=2
HostName = 192.168.0.12
[ndbd default]
NoOfReplicas= 2
DataDir = /usr/local/mysql/data
# reflecting the ratio between Data- and Index Memory
DataMemory=4000M
IndexMemory=600M
MaxNoOfOrderedIndexes=2048
MaxNoOfUniqueHashIndexes=1024
MaxNoOfAttributes=20000
MaxNoOfTriggers = 2048
MaxNoOfTables = 1024
TransactionDeadlockDetectionTimeout=3000
[ndbd]
Id= 3
HostName = 192.168.0.12
[ndbd]
Id= 4
HostName = 192.168.0.13
[mysqld]
Id= 5
HostName = 192.168.0.14
[mysqld]
Id= 6
HostName = 192.168.0.15
[mysqld]
Id= 7
HostName = 192.168.0.11
[mysqld]
Id= 8
HostName = 192.168.0.12
-----------
It’s a good practice to copy ndbd, ndm_mgmd, ndb_mgm to /etc/ini.d. So you can call commands from where ever you are.
On shell
Start ndb_mgmd
>ndb_mgmd -f /etc/mysql-cluster/config.ini
Start ndbd
>ndbd
Start MySQLD
>mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/data1.pid
Use ndb_mgm for checking the cluster and node status. Check for each service on their servers.