サーバ2台でndb_mgmd, ndbd, mysqlを動かした際のメモ
sv1 sv2
+----------+ +----------+
| ndb_mgmd | | ndb_mgmd |
| ndbd | | ndbd |
| mysql | | mysql |
+----------+ +----------+
*****************************************************
// sv1, sv2共通
# vi /var/lib/mysql-cluster/config.ini
-----------------------------------------------------
# Example Ndbcluster storage engine config file.
#
[ndbd default]
NoOfReplicas= 2
ServerPort = 63132
MaxNoOfConcurrentOperations= 10000
# DataMemory= 1G
# IndexMemory= 64M
TimeBetweenWatchDogCheck= 30000
DataDir= /var/lib/mysql-cluster
MaxNoOfOrderedIndexes= 512
[ndb_mgmd default]
DataDir= /var/lib/mysql-cluster
[ndb_mgmd]
Id = 1
HostName = sv1.kickitout.net
[ndb_mgmd]
Id = 2
HostName = sv2.kickitout.net
[ndbd]
Id = 11
HostName = sv1.kickitout.net
[ndbd]
Id = 12
HostName = sv2.kickitout.net
[mysqld]
Id = 21
HostName = sv1.kickitout.net
[mysqld]
Id = 22
HostName = sv2.kickitout.net
# choose an unused port number
# in this configuration 63132, 63133, and 63134
# will be used
[tcp default]
PortNumber= 63132
-----------------------------------------------------
// sv1 抜粋
# vi /etc/my.cnf
-----------------------------------------------------
[mysql_cluster]
ndb-connectstring = sv1.kickitout.net
[mysqld]
ndbcluster
ndb-connectstring = sv1.kickitout.net
[ndb_mgmd]
config_file=/var/lib/mysql-cluster/config.ini
-----------------------------------------------------
// sv2 抜粋
# vi /etc/my.cnf
-----------------------------------------------------
[mysql_cluster]
ndb-connectstring = sv2.kickitout.net
[mysqld]
ndbcluster
ndb-connectstring = sv2.kickitout.net
[ndb_mgmd]
config_file=/var/lib/mysql-cluster/config.ini
-----------------------------------------------------
*****************************************************
あとはiptablesで該当ポート1186,63132を開けておく
(忘れていてこれにはまった)
起動はndb_mgmd(sv1,sv2) -> ndbd(sv1,sv2) -> mysql(sv1,sv2)で順に行う
0 件のコメント :
コメントを投稿