4.4.2 The delete cluster Command

delete cluster [--removedirs] cluster_name

This command deletes the cluster named cluster_name; that is, it removes the process from the listing from this cluster. Configuration and data files relating to this cluster are preserved unless the command is invoked with the --removedirs option, added in MySQL Cluster Manager 1.3.0.

delete cluster does not remove any MySQL Cluster binaries from hosts.

This example demonstrates how to delete a cluster named mycluster, without removing the cluster configuration and data files:

mcm> delete cluster mycluster;
+------------------------------+
| Command result               |
+------------------------------+
| Cluster deleted successfully |
+------------------------------+
1 row in set (1.22 sec)

To remove the configuration and data files, the command must be invoked with the --removedirs option, like this:

mcm> delete cluster --removedirs mycluster;
+------------------------------+
| Command result               |
+------------------------------+
| Cluster deleted successfully |
+------------------------------+
1 row in set (1.22 sec)

delete cluster fails if the cluster to be deleted is running, as shown here:

mcm> delete cluster mycluster;
ERROR 5010 (00MGR): All processes must be stopped to delete cluster mycluster

You must shut down the cluster first, using stop cluster.