硬體設定
普通PC server * 2 (最小叢集環境需要4台伺服器)
類比環境
red hat linux9 for x86 (or red hat AS 2以上版本),glibc-2.2, static, gcc
MySQL版本4.1.12 binares
mysql-max binary版本目前只支援linux、max os x和solaris
本方案不涉及從原始碼編譯安裝
主機 IP地址 用途
ndb1_mgmd_sqld 1192.168.1.100 Ndb node1+mgmd node1+sqld node1
ndb2_sqld2 192.168.1.200 Ndb node2+sqld node2
Mgmd:management server
sqld:mysql server
ndb: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/tmp
Storage and SQL Node Installation
在兩台主機上執行如下過程
shell>groupadd mysql
shell>useradd -g mysql mysql
shell>tar zxfv mysql-max-4.1.12-pc-linux-gnu-i686.tar.gz
shell>cp -vr mysql-max-4.1.12-pc-linux-gnu-i686 /usr/local/mysql-max-4.1.12-pc-linux-gnu-i686
shell>cd /usr/local
shell>ln -s mysql-max-4.1.12-pc-linux-gnu-i686 mysql
shell>cd mysql;scripts/mysql_install_db –user=mysql
shell>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.server
shell>chkconfig --add mysql.server
shell>chkconfig –level 3 mysql.server off
Management Node Installation
在主機ndb1_mgmd_sqld1上執行如下過程
shell>cd /var/tmp
shell>tar -zxvf mysql-max-4.1.12a-pc-linux-gnu-i686.tar.gz /usr/local/bin '*/bin/ndb_mgm*'
Configuration
Configuring the Storage and SQL Nodes
在兩台主機上執行如下過程:
shell>vi /etc/my.cnf
[MYSQLD] # Options for mysqld process:
ndbcluster # run NDB engine
ndb-connectstring=192.168.1.100 # location of MGM node
[MYSQL_CLUSTER] # Options for ndbd process:
ndb-connectstring=192.168.1.100 # location of MGM node
Configuring the Management Node