Maison >base de données >tutoriel mysql >MySQL的集群的安装与配置(6台机器)
具体安装与配置:1)准备工作:6台机器,IP地址分别为192.168.0.(231-236)MGM节点:192.168.0.231(232) SQL 节点:192.168.0.
具体安装与配置:
1)
准备工作:
6台机器,,IP地址分别为
192.168.0.(231-236)
MGM节点:192.168.0.231(232)
SQL 节点:192.168.0.233-234
NDBD 节点:192.168.0.235-236
)
4)配置NDBD节点:
[root@localhost mysql]# cat /etc/my.cnf
[mysqld]
ndbcluster
#ndb-connectstring=192.168.0.231
#ndb-connectstring=192.168.0.232
这样写是可以连接成功。不过我今天来的时候发现全部DOWN掉了。
ndb-connectstring=192.168.0.231,192.168.0.232
[mysql_cluster]
#ndb-connectstring=192.168.0.231
#ndb-connectstring=192.168.0.232
ndb-connectstring=192.168.0.231,192.168.0.232
[root@localhost mysql]#
5)配置SQL 节点:
[root@localhost mysql]# cat /etc/my.cnf
[mysqld]
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/
port=3306
user=nobody
socket=/tmp/mysql.sock
ndbcluster
#ndb-connectstring=192.168.0.231
#ndb-connectstring=192.168.0.232
ndb-connectstring=192.168.0.231,192.168.0.232
[ndbd]
connect-string=192.168.0.235
[ndbd]
connect-string=192.168.0.236
[ndbd_mgm]
connect-string=192.168.0.231
[ndbd_mgm]
connect-string=192.168.0.232
[ndbd_mgmd]
config-file=/etc/config.ini
[mysql_cluster]
#ndb-connectstring=192.168.0.231
#ndb-connectstring=192.168.0.232
ndb-connectstring=192.168.0.231,192.168.0.232
[root@localhost mysql]#