MySQL群集双机模拟2008-02-18硬件配置普通PC server * 2 (最小集群环境需要4台服务器)模拟环境red hat linux9 for x86 (or red hat AS 2以上版本),glibc-2.2, static, gccMySQL版本4.1.12 binaresmysql-max binary版本目前只支持linux、max os x和solaris本方案不涉及从源代码编译安装主机 IP地址 用途ndb1_mgmd_sqld 1192.168.1.100 Ndb node1+mgmd node1+sqld node1ndb2_sqld2 192.168.1.200 Ndb node2+sqld node2Mgmd:management serversqld:mysql serverndb:storaged node (share-nothing,base in memory)安装从http://dev.mysql.com/downloads/mysql/4.1.html下载mysql-max-4.1.12-pc-linux-gnu-i686.tar.gz到/var/tmpStorage and SQL Node Installation在两台主机上执行如下过程shell>groupadd mysqlshell>useradd -g mysql mysqlshell>tar zxfv mysql-max-4.1.12-pc-linux-gnu-i686.tar.gzshell>cp -vr mysql-max-4.1.12-pc-linux-gnu-i686 /usr/local/mysql-max-4.1.12-pc-linux-gnu-i686shell>cd /usr/localshell>ln -s mysql-max-4.1.12-pc-linux-gnu-i686 mysqlshell>cd mysql;scripts/mysql_install_db –user=mysqlshell>chown -R root .;chown -R mysql data;chgrp -R mysql .shell>cp support-files/mysql.server /etc/rc.d/init.d/shell>chmod +x /etc/rc.d/init.d/mysql.servershell>chkconfig --add mysql.servershell>chkconfig –level 3 mysql.server offManagement Node Installation在主机ndb1_mgmd_sqld1上执行如下过程shell>cd /var/tmpshell>tar -zxvf mysql-max-4.1.12a-pc-linux-gnu-i686.tar.gz /usr/local/bin "*/bin/ndb_mgm*"ConfigurationConfiguring the Storage and SQL Nodes在两台主机上执行如下过程:shell>vi /etc/my.cnf[MYSQLD] # Options for mysqld process:ndbcluster # run NDB enginendb-connectstring=192.168.1.100 # location of MGM node[MYSQL_CLUSTER] # Options for ndbd process:ndb-connectstring=192.168.1.100 # location of MGM nodeConfiguring the Management Node