dd:192.168.55.138 (NDB mgmd节点,sql节点1)
dd1:192.168.55.139 (sql节点2)
dd2:192.168.55.140 (NDBD节点1)
dd3:192.168.55.141 (NDBD节点2)
后续若添加sql/NDBD节点 基本配置按照下面
#dd NDB mgmd
/usr/local/mysql
mkdir -p /data/mysql/mysql-cluster
mkdir -p /usr/local/mysql/data
vi /data/mysql/mysql-cluster/mgmd.cnf
[ndbd default]
NoOfReplicas=2
DataMemory=80M
IndexMemory=18M
[ndb_mgmd]
hostname=192.168.55.138
datadir=/data/mysql/mysql-cluster
[ndbd]
hostname=192.168.55.140
datadir=/usr/local/mysql/data
[ndbd]
hostname=192.168.55.141
datadir=/usr/local/mysql/data
[mysqld]
hostname=192.168.55.138
[mysqld]
hostname=192.168.55.139
[mysqld]
#首次启动
/usr/local/mysql/bin/ndb_mgmd -f /data/mysql/mysql-cluster/mgmd.cnf --initial
/usr/local/mysql/bin/ndb_mgmd -f /data/mysql/mysql-cluster/mgmd.cnf
ps -ef | grep mgmd
#查看
/usr/local/mysql/bin/ndb_mgm 192.168.55.138
show
#dd dd1 sql
/usr/local/mysql
mkdir -p /usr/local/mysql/data
vi /etc/my.cnf
[client]
socket=/usr/local/mysql/mysql.sock
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
ndbcluster
ndb-connectstring=192.168.55.138
default-storage-engine=ndbcluster
[mysql_cluster]
ndb-connectstring=192.168.55.138
/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
echo 'export PATH=$PATH:/usr/local/mysql/bin'>>/etc/profile
source /etc/profile
service mysql start
#dd2 dd3 NDBD
/usr/local/mysql
mkdir -p /usr/local/mysql/data
mkdir -p /etc/my.cnf.d
vi /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=192.168.55.138
[mysql_cluster]
ndb-connectstring=192.168.55.138
#启动ndb
/usr/local/mysql/bin/ndbd --initial --ndb-connectstring=192.168.55.138
/usr/local/mysql/bin/ndbd --ndb-connectstring=192.168.55.138
ps -ef | grep nbd
#dd mgmd 查看所有节点
/usr/local/mysql/bin/ndb_mgm 192.168.55.138/dd