虚拟机windows xp 下安装配置mysql cluster 7.3.2
1、虛擬機(jī)環(huán)境下安裝的
1?192.168.131.21(管理節(jié)點(diǎn),存儲(chǔ)節(jié)點(diǎn),sql節(jié)點(diǎn))
2?192.168.131.22(存儲(chǔ)節(jié)點(diǎn),sql節(jié)點(diǎn))
?
2、安裝程序
在兩臺(tái)機(jī)器上面同時(shí)進(jìn)行
第一步:
下載安裝軟件地址:http://dev.mysql.com/downloads/cluster/?
我的用的版本是MySQL Cluster 5.6.11(mysql cluster 7.3.2 MSI安裝出來以后就是mysql cluster 5.6.11)
第二步:
安裝MSI軟件,安裝時(shí)不會(huì)創(chuàng)建mysql instance
我安裝在c:\mysql cluster 7.3下
第三步:
cd到你的安裝目錄的bin文件夾,執(zhí)行mysqld.exe --install mysql?????????? /*設(shè)置環(huán)境變量后仍需執(zhí)行此命令,不然就會(huì)被安裝在c:/program files/mysql/mysql-5.6.10下,這樣無法運(yùn)行)
第四步:
設(shè)置環(huán)境變量
3、創(chuàng)建配置文件
第一步:
創(chuàng)建config.ini文件
在c:\cluster\config.ini文件
內(nèi)容為:
[NDBD DEFAULT]
NoOfReplicas= 2
#Managment Server
[NDB_MGMD]
hostname=192.168.131.21
Nodeid=1
datadir=C:\MySQL Cluster 7.3\data
#數(shù)據(jù)節(jié)點(diǎn)?
[NDBD]
NodeId=5
hostname=192.168.131.21
datadir=d:/data
[NDBD]
NodeId=6
hostname=192.168.131.22
datadir=d:/data
#SQL節(jié)點(diǎn)
[MYSQLD]
ArbitrationRank=2
hostname=192.168.131.21
NodeId=7
[MYSQLD]
ArbitrationRank=2
hostname=192.168.131.22
NodeId=8
[MYSQLD]
[MYSQLD]
第二步:
創(chuàng)建mysql配置文件my.ini
在安裝路徑下找一個(gè)my-**.ini文件
復(fù)制到當(dāng)前目錄并重命名為my.ini
在文件中[mysqld]的起始加入
#Path to installation directory. All paths are usually resolved relative to this.
basedir = "C:\MySQL Cluster 7.3"
datadir = "C:\MySQL Cluster 7.3\data"
在[mysqld]結(jié)尾加入
ndbcluster
ndb-connectstring = 192.168.131.21
在my.ini文件的最末端加入
[mysql_cluster]
ndb-connectstring=192.168.131.21 #此處兩臺(tái)虛擬機(jī)都一樣的設(shè)置
保存文件
4、啟動(dòng)mysql cluster(以下操作均在CMD下執(zhí)行)
第一:在管理節(jié)點(diǎn)服務(wù)器上(也就是本文中的192.168.131.21)
ndb_mgmd.exe --config-file=c:\cluster\config-ini --configdir=c:\cluster
新開CMD窗口
ndbd.exe --initial???????? /*第一個(gè)啟動(dòng)的節(jié)點(diǎn)加入--initial參數(shù) 第二個(gè)不需要*/
新開CMD窗口
mysqld.exe --default-file="C:\MySQL Cluster 7.3\my.ini"
執(zhí)行完以后啟動(dòng)mysql
net start mysql
第二:在192.168.131.22在執(zhí)行
ndbd.exe
新開CMD窗口
mysqld.exe --default-file="C:\MySQL Cluster 7.3\my.ini"
執(zhí)行完以后啟動(dòng)mysql
net start mysql
5、查看安裝情況
在192.168.131.21服務(wù)器上打開CMD窗口
ndb_mgm.exe
ndb_mgm>show
Connected to Management Server at: 192.168.2.57:1186
Cluster Configuration
———————
[ndbd(NDB)] 2 node(s)
id=5 @192.168.131.21 (mysql-5.6.10 ndb-7.3.2, Nodegroup: 0, Master)
id=6 @192.168.2.56 (mysql-5.6.10 ndb-7.3.2, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.131.21(mysql-5.6.10 ndb-7.3.2)
[mysqld(API)] 2 node(s)
id=7 @192.168.131.21 (mysql-5.6.10 ndb-7.3.2)
id=8 @192.168.131.22(mysql-5.6.10ndb-7.3.2)
出現(xiàn)以上的信息說明安裝成功
然后在某臺(tái)服務(wù)器上登錄mysql
mysql -uroot
show engines;
可查看ndbcluster是否安裝成功
創(chuàng)建數(shù)據(jù)庫及表
create database test;
create table tt(id int(10)) engine=ndbcluster;
insert into tt(1);
然后到另一臺(tái)服務(wù)器上去查看
查看數(shù)據(jù)庫是否同步
?
轉(zhuǎn)載于:https://www.cnblogs.com/dyllove98/p/3233735.html
總結(jié)
以上是生活随笔為你收集整理的虚拟机windows xp 下安装配置mysql cluster 7.3.2的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: wiki-editor语法
- 下一篇: Sublime Text的使用技巧