MySQL Cluster Configurationmysql-cluster 7.x -------------------------- (1) Mysql cluster architecture : 192.168.1.10 (mgm) --> ndb management servers 192.168.1.11 (ndb) --> ndb nodes 192.168.1.12 (ndb) --> ndb nodes 192.168.1.13 (sql) --> mysqld api nodes 192.168.1.14 (sql) --> mysqld api nodes -------------------------- (2) Install mysql-cluster groupadd mysql useradd -g mysql mysql wget http://dev.mysql.com/get/Downloads/MySQL-Cluster-7.2/mysql-cluster-gpl-7.2.4-linux2.6-x86_64.tar.gz/from/http://ftp.iij.ad.jp/pub/db/mysql/ tar -zxvf mysql-cluster-gpl-7.2.4-linux2.6-x86_64.tar.gz mv mysql-cluster-gpl-7.2.4-linux2.6-x86_64.tar.gz /usr/local/mysql chown mysql.mysql -R /usr/local/mysql -------------------------- (3) Setup ndb management service in all ndb management servers (mgm): vi /usr/local/mysql/config.ini [NDBDDEFAULT] NoOfReplicas=2 [NDB_MGMD] NodeId=1 hostname=192.168.1.10 [NDBD] NodeId=11 hostname=192.168.1.11 datadir=/usr/local/mysql/ndbdata [NDBD] NodeId=12 hostname=192.168.1.12 datadir=/usr/local/mysql/ndbdata [MYSQLD] NodeId=13 hostname=192.168.1.13 [MYSQLD] NodeId=14 hostname=192.168.1.14 chown mysql.mysql -R /usr/local/mysql start NDB management in (mgm) servers : /usr/local/mysql/bin/ndb_mgmd -f /usr/local/mysql/config.ini --configdir=/usr/local/mysql -------------------------- (4) Setup ndb service in all (ndb) ndb nodes vi /etc/my.cnf [mysqld] ndbcluster ndb-connectstring=192.168.1.10 [mysql_cluster] ndb-connectstring=192.168.1.10 # make ndbdata folder mkdir /usr/local/mysql/ndbdata # start ndb service /usr/local/mysql/bin/ndbd --initial -------------------------- (5) Setup mysql service in all mysql api nodes (mysql) # initial sql database and my.cnf cd /usr/loca/mysql scripts/mysql_install_db --user=mysql cp support-files/my-medium.cnf /etc/my.cnf vi /etc/my.cnf [mysqld] ndbcluster ndb-connectstring=192.168.1.10 [mysql_cluster] ndb-connectstring=192.168.1.10 # start mysql service (mysql) cp -p /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql chkconfig --add mysql chkconfig --list |grep mysql /etc/init.d/mysql start -------------------------- (6) Chech mysql cluster function in (mgm) server /usr/local/mysql/bin/ndb_mgm ndb_mgm> show Connected to Management Server at: localhost:1186 Cluster Configuration [ndbd(NDB)] 2 node(s) id=11 @192.168.1.11 (mysql-5.5.19 ndb-7.2.4, Nodegroup: 0, Master) id=12 @192.168.1.12 (mysql-5.5.19 ndb-7.2.4, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @192.168.1.10 (mysql-5.5.19 ndb-7.2.4) [mysqld(API)] 2 node(s) id=13 @192.168.1.13 (mysql-5.5.19 ndb-7.2.4 ndb-7.1.15) id=14 @192.168.1.14 (mysql-5.5.19 ndb-7.2.4 ndb-7.1.15) Server is hosted by Alanstudio Linux Operating System Recommend screen resolution 1024 x 768 / IE / FireFox Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved. |