4.7.2 The backup cluster Command

backup cluster
    [--snapshotstart | --snapshotend]
    [--waitstarted | --waitcompleted]
    cluster_name 

This command creates a backup of the MySQL Cluster named cluster_name. backup cluster takes a backup of the cluster's NDB tables only; tables using other MySQL storage engines (such as InnoDB or MyISAM) are ignored.

The --snapshotstart option causes the backup to match the state of the cluster when the backup began; using --snapshotend causes the backup to reflect the state of the cluster when the backup was finished. If neither option is specified, the MySQL Cluster Manager client acts as though --snapshotend had been used.

When the --waitstarted option is used, the MySQL Cluster Manager client waits until the backup has started before returning control to the user; using --waitcompleted causes the MySQL Cluster Manager client to wait until the backup process is complete before returning control to the user. If neither of these options is specified, the client behaves as if --waitcompleted had been used.

mcm> backup cluster mycluster;
+-------------------------------+
| Command result                |
+-------------------------------+
| Backup completed successfully |
+-------------------------------+
1 row in set (33.50 sec)

You can verify that the backup was performed by checking the output of list backups, as shown here:

mcm> list backups mycluster;
+----------+--------+-----------+---------------------+---------+
| BackupId | NodeId | Host      | Timestamp           | Comment |
+----------+--------+-----------+---------------------+---------+
| 1        | 1      | localhost | 2012-12-01 12:03:52 |         |
| 1        | 2      | localhost | 2012-12-01 12:03:52 |         |
| 2        | 1      | localhost | 2012-12-04 12:05:15 |         |
| 2        | 2      | localhost | 2012-12-04 12:05:15 |         |
+----------+--------+-----------+---------------------+---------+
4 rows in set (0.02 sec)

Each row in the output represents a backup image—that is, a set of backup files specific to a given backup of a named cluster on a given data node. Timestamp values are UTC. By default, each image is stored as a directory named /mcm_data/clusters/cluster_name/node_id/data/BACKUP/BACKUP-backup_id/ in the MySQL Cluster Manager installation directory.

It is possible to remove an unwanted backup from a given node by deleting this image directory and its contents. To remove a given backup completely, you must remove the corresponding image from each data node's BACKUP directory. You can do this as long as a backup or restore operation is not in progress; it is not necessary to stop the cluster or MySQL Cluster Manager agent prior to removing the images.

The BackupId is used with abort backup and restore cluster.

The backup cluster command was added in MySQL Cluster Manager 1.2.1.