Wednesday, September 18, 2019

MySQL Cluster Management

Managing Mysql Cluster


Monitor the Cluster

ndb_mgm
Cluster Status

ndb_mgm> show

Data Node status
ndb_mgm> all status

Cluster Memory Usage
ndb_mgm> all report memory


How to Restart a MySQL Cluster without downtime

Start Management Cluster to reload configuration

ndb_mgmd --reload -f /var/lib/mysql-cluster/config.ini


Restart the management cluster
shell> kill $(pidof ndb_mgmd)


Starting the management cluster
shell> ndb_mgmd --config-file=var/lib/mysql-cluster/config.ini


#To restart ndb_mgmd overwritting cache files, the following options can be used on commandline (./ndb_mgmd)
--initial
--skip-config-cache

#or removing cache files with:
shell>rm -rf /var/lib/mysql-cluster/


#Data/Storage Node
The data or storage node, which is implements as ndbd or ndbmtf, handles data storage ans retrieval for specific subset of the cluster's data.

#Purpose of datanodes
to process and retrienve information, being the storage for the whole cluster



#Managing Data Node
Stop data node
ndb_mgm> STOP
ndb_mgm> 3  STOP

#Starting Data Node
ndb_mgm> 3  START


Managing SQL Nodes
#Stop SQL Node
shell>service mysql stop

#Start SQL Node
shell>service mysql start