注意:在啟動資料節點後會預分配2G的硬碟空間(preallocate the space for the logs (used for recovery). This is to avoid problems during running of waiting for the OS to allocate disk space or running out of space),在分配成功後再啟動服務節點!
配置過程:http://www.cnblogs.com/jinzhenshui/archive/2009/12/18/1627364.html
#
管理節點設定檔my_cluster.ini:
[NDBD DEFAULT]
NoOfReplicas=2 # 預設值是2.
DataDir= E:\Program Files\MySQL\MySQL Server 7.0\Data\user_data #如果不存在就建立一個
# Managment Server
[NDB_MGMD]
nodeid=40
HostName=192.168.1.102 #管理節點伺服器db1的IP地址
# Storage Engines
[NDBD]
nodeid=11
HostName=192.168.1.102 #MySQL叢集db1的IP地址
[NDBD]
nodeid=12
HostName=192.168.1.102 #MySQL叢集db2的IP地址
[MYSQLD]
nodeid=1
HostName=192.168.1.102
[MYSQLD]
nodeid=2
HostName=192.168.1.102
[MYSQLD]
nodeid=3
HostName=192.168.1.102
------------------------------------------
每個的mysql設定檔(指定連接埠與datadir):
[mysqld]
basedir="e:/Program Files/MySQL/MySQL Server 7.0"
default-character-set=utf8
default-storage-engine=NDBCLUSTER
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
port=33061
datadir="e:/Program Files/MySQL/MySQL Server 7.0/data/user_data/node1/"
general_log_file="e:/Program Files/MySQL/MySQL Server 7.0/data/user_data/node1/general_log.log"
#
ndbcluster
ndb_connectstring="192.168.1.102"
#
skip_innodb
#
[ndbd]
ndb_connectstring="192.168.1.102"
------------------------------------------
將mysql資料庫複寫到datadir下
運行:
管理節點(mgmd)bat:
"E:\Program Files\MySQL\MySQL Server 7.0\bin\ndb_mgmd.exe" --config-file="E:/Program Files/MySQL/MySQL Server 7.0/data/mysql_cfg/my_cluster.ini" --initial
pause
資料節點(ndbd):
"e:\Program Files\MySQL\MySQL Server 7.0\bin\ndbd.exe" --defaults-file="e:\Program Files\MySQL\MySQL Server 7.0\data\user_data\node1\my_node1.ini"
(ndb_mgm.exe )show:
服務節點(mysqld):
"e:\Program Files\MySQL\MySQL Server 7.0\bin\mysqld.exe" --defaults-file="e:\Program Files\MySQL\MySQL Server 7.0\data\user_data\node1\my_node1.ini" --console
pause
show: