MySQL cluster多个管理节点和多个sql节点的配置和相关命令

以下技术应用于最优质的水果的鲜果篮

管理节点的config.ini文件:

[ndbd default]
NoOfReplicas=2
DataMemory=160M
IndexMemory=64M
MaxNoOfTables=1024
MaxNoOfAttributes=5000
MaxNoOfOrderedIndexes=1000

[ndb_mgmd]
nodeid=1
hostname=192.168.1.207
datadir=/var/lib/mysql-cluster

[ndb_mgmd]
nodeid=2
hostname=192.168.1.208
datadir=/var/lib/mysql-cluster

[ndbd]
hostname=192.168.1.209
datadir=/usr/local/mysql/data

[ndbd]
hostname=192.168.1.210
datadir=/usr/local/mysql/data

[mysqld]
hostname=192.168.1.203

[mysqld]
hostname=192.168.1.204


数据节点和sql节点的my.cnf文件:

[client]
socket=/var/lib/mysql/mysql.sock

[mysqld]
max_connections=100
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
default_storage_engine=NDBCLUSTER
character-set-server=utf8
ndbcluster
ndb-connectstring=192.168.1.207,192.168.1.208

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql_cluster]
ndb-connectstring=192.168.1.207,192.168.1.208


启动管理节点的命令:

在第一个管理节点上执行  ndb_mgmd -f /var/lib/mysql-cluster/config.ini --configdir=/var/lib/mysql-cluster --initial

在第二个管理节点上执行 ndb_mgmd -c 192.168.1.207 --ndb-nodeid=2 --configdir=/var/lib/mysql-cluster (注意nodeid要和第二个管理节点在config.ini中配置的nodeid一致。)


具体安装请参考另一篇博客 http://blog.csdn.net/atec2000/article/details/39498881


你可能感兴趣的:(数据库)