id=4 @192.168.0.100 (Version: 4.1.12)6.2 模拟写入一个数据库表,各MysqlServer节点是否能够同步1) 在一个MysqlServer节点上创
1、环境描述
Mysql manager 节点:192.168.0.1
MysqlServer节点:192.168.0.100
Mysql 节点:192.168.0.160
Mysql 节点:192.168.0.161
#groupadd mysql
#useradd -g mysql mysql
#cd /usr/local
#tar xfz mysql-max-4.1.13-pc-linux-gnu-i686.tar.gz
#ln -s /usr/local/mysql-max-4.1.13-pc-linux-gnu-i686 /opt/mysql4.1.13
#cd mysql4.1.13
#scripts/mysql_install_db --user=mysql (必须带目录执行,否则出错)
#chown -R root /opt/mysql4.1.13
#chgrp -R mysql /opt/mysql4.1.13
#chown -R mysql.mysql /opt/mysql4.1.13/data
#cp support-files/mysql.server /etc/rc.d/init.d/ 配置mysql启动设置
#chmod +x /etc/rc.d/init.d/mysql.server
#chkconfig --add mysql.server
[MYSQLD]
ndbcluster
ndb-connectstring=192.168.0.1
[MYSQL_CLUSTER]
ndb-connectstring=192.168.0.1
[NDBD]
hostname=192.168.0.160 # 节点Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's datafiles
# Options for data node "B"(定义群集数据节点.)
[NDBD]
hostname=192.168.0.161 # 节点Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's datafiles
# SQL node options(定义Sql server节点.)
[MYSQLD]
hostname=192.168.0.100 # SQL节点Hostname or IP address
#datadir=/usr/local/mysql/data # Directory for SQL node's datafiles
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[NDB_MGMD]:后面不能有任何注释信息,否则提示:
Error line 17: [TCP] Unknown parameter: [NDB_MGMD] # Management process options
Error line 17: Could not parse name-value pair in config file.
[SHM]: Defines shared-memory connections between nodes. 在MySQL 4.1.9之前,这个功能必须使用--with-ndb-shm option编译进去, 从MySQL 4.1.9-max版本开始, it is enabled by default