Note: After the data node is started, 2 GB of Hard Disk Space (preallocate the space for the logs (used for recovery) will be pre-allocated ). this is to avoid problems during running of waiting for the OS to allocate disk space or running out of space), and then start the service node after the allocation is successful!
Procedure: http://www.cnblogs.com/jinzhenshui/archive/2009/12/18/1627364.html
#
Manage the node configuration file my_cluster.ini:
[Ndbd default]
Noofreplicas = 2 # The default value is 2.
Datadir = E: \ Program Files \ mysql server 7.0 \ data \ user_data # create
# Managment Server
[Ndb_mgmd]
Nodeid = 40
Hostname = 192.168.1.102 # manage the IP address of node server db1
# Storage engines
[Ndbd]
Nodeid = 11
Hostname = 192.168.1.102 # IP address of MySQL cluster db1
[Ndbd]
Nodeid = 12
Hostname = 192.168.1.102 # IP address of MySQL cluster DB2
[Mysqld]
Nodeid = 1
Hostname = 192.168.1.102
[Mysqld]
Nodeid = 2
Hostname = 192.168.1.102
[Mysqld]
Nodeid = 3
Hostname = 192.168.1.102
------------------------------------------
Each MySQL configuration file (specified port and datadir ):
[Mysqld]
Basedir = "E:/program files/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 Server 7.0/data/user_data/node1 /"
General_log_file = "E:/program files/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"
------------------------------------------
Copy the MySQL database to datadir.
Run:
Management node (mgmd) BAT:
"E: \ Program Files \ mysql server 7.0 \ bin \ ndb_mgmd.exe" -- config-file = "E: /program files/MySQL Server 7.0/data/mysql_cfg/my_cluster.ini "-- Initial
Pause
Data Node (ndbd ):
"E: \ Program Files \ mysql server 7.0 \ bin \ ndbd.exe" -- defaults-file = "E: \ Program Files \ mysql server 7.0 \ data \ user_data \ node1 \ my_node1.ini"
(Ndb_mgm.exe) show:
Service Node (mysqld ):
"E: \ Program Files \ mysql server 7.0 \ bin \ mysqld.exe" -- defaults-file = "E: \ Program Files \ mysql server 7.0 \ data \ user_data \ node1 \ my_node1.ini "-- Console
Pause
Show: