为mysql cluster添加sql节点
添加sql節(jié)點(diǎn)相對(duì)比較簡單。
由于資源有限,而且管理節(jié)點(diǎn)平時(shí)也沒有什么負(fù)載,就把管理節(jié)點(diǎn)變成一個(gè)sql節(jié)點(diǎn)。這個(gè)操作比較簡單。
如何配置一個(gè)mysql cluster可以參考http://itlaowu.blog.51cto.com/1358545/1030688
1.只需要修改管理節(jié)點(diǎn)的cong.ini文件,在文件末尾追加
[mysqld]
Hostname=192.168.163.110
2.然后編輯sql節(jié)點(diǎn)的my.cnf文件
[mysqld]
#basedir???????? = /var/lib/mysql/data
#datadir???????? = /var/lib/mysql/data
user??????????? = mysql
port??????????? = 3306
#socket????????? = /tmp/mysql.sock
ndbcluster
ndb-connectstring=192.168.163.110
[MYSQL_CLUSTER]
ndb-connectstring=192.168.163.110
1,? 關(guān)閉管理節(jié)點(diǎn),并使用—reload啟動(dòng)管理節(jié)點(diǎn)
ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]???? 2 node(s)
id=2??? @192.168.163.140? (mysql-5.5.27 ndb-7.2.8, Nodegroup: 0, Master)
id=3??? @192.168.163.170? (mysql-5.5.27 ndb-7.2.8, Nodegroup: 0)
?
[ndb_mgmd(MGM)] 1 node(s)
id=1??? @192.168.163.110? (mysql-5.5.27 ndb-7.2.8)
?
[mysqld(API)]?? 3 node(s)
id=4 (not connected, accepting connect from 192.168.163.160)
ndb_mgm> 1 stop
Node 1 has shutdown.
Disconnecting to allow Management Server to shutdown
?
ndb_mgm> quit
[root@vmhost02 local]# ndb_mgmd -f /var/lib/mysql/config.ini –reload
MySQL Cluster Management Server mysql-5.5.27 ndb-7.2.8
2,? 把其他數(shù)據(jù)節(jié)點(diǎn)的ndb表所在的數(shù)據(jù)庫建庫腳本在新sql節(jié)點(diǎn)執(zhí)行一下,或者把其他sql節(jié)點(diǎn)的數(shù)據(jù)結(jié)構(gòu)文件copy到新sql節(jié)點(diǎn),就完成了。
[root@vmhost02 local]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 192.168.163.110:1186
Cluster Configuration
---------------------
[ndbd(NDB)]???? 2 node(s)
id=2 (not connected, accepting connect from 192.168.163.140)
id=3 (not connected, accepting connect from 192.168.163.170)
?
[ndb_mgmd(MGM)] 1 node(s)
id=1??? @192.168.163.110? (mysql-5.5.27 ndb-7.2.8)
?
[mysqld(API)]?? 3 node(s)
id=4 (not connected, accepting connect from 192.168.163.160)
id=5 (not connected, accepting connect from 192.168.163.110)
轉(zhuǎn)載于:https://blog.51cto.com/itlaowu/1030702
總結(jié)
以上是生活随笔為你收集整理的为mysql cluster添加sql节点的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: word如何输入各种特殊符号(ppt文档
- 下一篇: 剑侠情缘战力提升窍门有哪些