How to shut down and restart the cluster
On the management server (MGM) use the commands below.
This command causes the ndb_mgm, ndb_mgmd and any ndbd processes shut down:
# ndb_mgm -e shutdown
Command for restarting the cluster:
# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
On storage servers (NDBD) use the following command on each node “DB2″and “DB3”.
Command to start The “ndbd”
# ndbd
Command to start The MySQL:
# service mysql start
If everything is configured correctly, the cluster must be up.
Type the following command on the management server (MGM) for administration of the nodes:
— NDB Cluster — Management Client —
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
———————
[ndbd(NDB)] 2 node(s)
id=2 @172.16.3.242 (Version: 5.0.90, Nodegroup: 0)
id=3 @172.16.3.243 (Version: 5.0.90, Nodegroup: 0, Master)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @172.16.3.241 (Version: 5.0.90)
[mysqld(API)] 3 node(s)
id=4 @172.16.3.242 (Version: 5.0.90)
id=5 @172.16.3.243 (Version: 5.0.90)
ndb_mgm>
Lets create a test database in the storage servers (NDBD), “DB2″or “DB3”
# mysql
mysql> use test;
mysql> CREATE TABLE ctest (i INT) ENGINE=NDBCLUSTER;
As the table ctest “was created using the database engine” NDBCLUSTER “, all changes in the database changed in any one of the nodes will be automatically replicated to the others.
We can do a simple test including a row in the table “ctest” in one of the nodes and check that the line was automatically sent to the table ctest “of another node.
mysql> INSERT INTO ctest () VALUES (1);
mysql> SELECT * FROM ctest