1.準備編 → 2.管理ノード編 → 3.データー/SQLノード編
データー/SQLノードインストール&設定
MySQLクラスタのrpmを本家から拾ってきてインストール
cent6-cluster-1とcent6-cluster-2両方で実施
shell
cd /usr/local/src/
wget http://dev.mysql.com/get/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-server-gpl-7.3.3-1.el6.x86_64.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-client-gpl-7.3.3-1.el6.x86_64.rpm
rpm -ivh MySQL-Cluster*.rpm
結果
準備中... ########################################### [100%]
1:MySQL-Cluster-server-gp########################################### [ 50%]
2:MySQL-Cluster-client-gp########################################### [100%]
MySQLパスワード確認
cent6-cluster-1とcent6-cluster-2両方で実施
shell
cat /root/.mysql_secret
# The random password set for the root user at Tue Jan 14 09:20:12 2014 (local time): 5jDoixlD
一旦起動
cent6-cluster-1とcent6-cluster-2両方で実施
shell
/etc/init.d/mysql start
result
Starting MySQL..... SUCCESS!
セキュリティ回りの設定を行い停止する
(ここでMySQLのパスワード変更する)
cent6-cluster-1とcent6-cluster-2両方で実施
shell
mysql_secure_installation
rm /root/.mysql_secret
/etc/init.d/mysql stop
result
Shutting down MySQL.. SUCCESS!
設定ファイルの編集
cent6-cluster-1とcent6-cluster-2両方で実施
shell
vi /etc/my.cnf
/etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=192.168.1.100
>
[mysql_cluster]
ndb-connectstring=192.168.1.100
ndbを起動起動
cent6-cluster-1とcent6-cluster-2両方で実施
shell
ndbd --initial
結果
2014-01-14 17:56:27 [ndbd] INFO -- Angel connected to '192.168.1.100:1186'
2014-01-14 17:56:27 [ndbd] INFO -- Angel allocated nodeid: 11
確認
shell
ndb_mgm -e show
結果
Connected to Management Server at: 192.168.1.100:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=11 @192.168.1.101 (mysql-5.6.14 ndb-7.3.3, Nodegroup: 0, *)
id=12 @192.168.1.102 (mysql-5.6.14 ndb-7.3.3, Nodegroup: 0)
>
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.100 (mysql-5.6.14 ndb-7.3.3)
>
[mysqld(API)] 2 node(s)
id=21 (not connected, accepting connect from 192.168.1.101)
id=22 (not connected, accepting connect from 192.168.1.102)
MySQL起動
cent6-cluster-1とcent6-cluster-2両方で実施
shell
/etc/init.d/mysql start
結果
Starting MySQL............................................. SUCCESS!
確認
shell
ndb_mgm -e show
結果
Connected to Management Server at: 192.168.1.100:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=11 @192.168.1.101 (mysql-5.6.14 ndb-7.3.3, Nodegroup: 0, *)
id=12 @192.168.1.102 (mysql-5.6.14 ndb-7.3.3, Nodegroup: 0)
>
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.100 (mysql-5.6.14 ndb-7.3.3)
>
[mysqld(API)] 2 node(s)
id=21 @192.168.1.101 (mysql-5.6.14 ndb-7.3.3)
id=22 @192.168.1.102 (mysql-5.6.14 ndb-7.3.3)
おしまい