Adding a New Management Server to the Cluster
Preparing the server
// Append to /etc/hosts on every machine
@everyhost:~#vi /etc/hosts
192.168.100.105 mgm2 # second Management Server
Extracting Config Files
// Login to mgm2 server and extract files (see previous post)
@mgm2:~# tar xzf mysql.tgz -C /usr/local/mysql
// Copy config.ini from mgm1 to mgm2 and Upgrade edit for 4G memory
// Add config.ini on mgm1 server
CONFIG MUST BE SAME ON EACH MGMT SERVER
@mgm2:/usr/local/mysql /# vi config.ini
[ndbd default]
NoOfReplicas = 2
DataDir = /usr/local/mysql/mysql-cluster
DataMemory = 3072M
IndexMemory = 384M
[ndb_mgmd]
NodeId = 1
PortNumber = 1186
HostName = mgm1
DataDir = /usr/local/mysql/mysql-cluster
[ndb_mgmd]
NodeId = 8
PortNumber = 1186
HostName = mgm2
DataDir = /usr/local/mysql/mysql-cluster
[ndbd]
NodeId = 11
HostName = ndb1
LockExecuteThreadToCPU = 1
LockMaintThreadsToCPU = 0
[ndbd]
NodeId = 12
HostName = ndb2
LockExecuteThreadToCPU = 1
LockMaintThreadsToCPU = 0
[api]
NodeId = 31
HostName = app1
[api]
NodeId = 32
HostName = app2
[tcp default]
SendBufferMemory = 2M
ReceiveBufferMemory = 2M
Append config.ini on Management Server1
CONFIG MUST BE SAME ON EACH MGMT SERVER
@mgm1:/usr/local/mysql /# vi config.ini
[ndb_mgmd]
NodeId = 8
PortNumber = 1186
HostName = mgm2
DataDir = /usr/local/mysql/mysql-cluster
Restart Management Server 1
@mgm1:/usr/local/mysql# ./ndbmgm_daemon restart
NDB_MGM daemon stopped.
@mgm1:/usr/local/mysql# bin/ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=11 @192.168.100.106 (mysql-5.6.19 ndb-7.3.6, Nodegroup: 0, *)
id=12 @192.168.100.107 (mysql-5.6.19 ndb-7.3.6, Nodegroup: 0)
[ndb_mgmd(MGM)] 2 node(s)
id=1 @192.168.100.104 (mysql-5.6.19 ndb-7.3.6)
id=8 (not connected, accepting connect from mgm2)
[mysqld(API)] 2 node(s)
id=31 @192.168.100.102 (mysql-5.6.19 ndb-7.3.6)
id=32 @192.168.100.103 (mysql-5.6.19 ndb-7.3.6)
ndb_mgm> 11 restart
Node 11: Node shutdown initiated
Node 11: Node shutdown completed, restarting, no start.
Node 11 is being restarted
Node 11: Start initiated (version 7.3.6)
ndb_mgm> Node 11: Started (version 7.3.6)
ndb_mgm> 12 restart
Node 12: Node shutdown initiated
Node 12: Node shutdown completed, restarting, no start.
Node 12 is being restarted
ndb_mgm> Node 12: Started (version 7.3.6)
Start Management Server 2
@mgm2:/usr/local/mysql# ./ndbmgm_daemon initial
MySQL Cluster Management Server mysql-5.6.19 ndb-7.3.6
NDB_MGM daemon started
Restart MySQL Node on app1 & app2
@app1:/usr/local/mysql# ./mysqld restart
Shutting down MySQL
..... SUCCESS!
Starting MySQL
.... SUCCESS!
@app2:/usr/local/mysql# ./mysqld restart
Shutting down MySQL
..... SUCCESS!
Starting MySQL
.... SUCCESS!
Verify Management Server 2
@mgm2:/usr/local/mysql# bin/ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=11 @192.168.100.106 (mysql-5.6.19 ndb-7.3.6, Nodegroup: 0, *)
id=12 @192.168.100.107 (mysql-5.6.19 ndb-7.3.6, Nodegroup: 0)
[ndb_mgmd(MGM)] 2 node(s)
id=1 @192.168.100.104 (mysql-5.6.19 ndb-7.3.6)
id=8 @192.168.100.105 (mysql-5.6.19 ndb-7.3.6)
[mysqld(API)] 2 node(s)
id=31 @192.168.100.102 (mysql-5.6.19 ndb-7.3.6)
id=32 @192.168.100.103 (mysql-5.6.19 ndb-7.3.6)
ndb_mgm> 11 restart
Node 11: Node shutdown initiated
Node 11 is being restarted
Node 11: Start initiated (version 7.3.6)
ndb_mgm> Node 11: Started (version 7.3.6)
// We can reload ndb using Management Server 2
Post a Comment