PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.2Kb
Man Pages (Zip) - 402.4Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0
Before starting a backup, make sure that the cluster is properly configured for performing one. (SeeSection 25.6.8.3, “Configuration for NDB Cluster Backups”.)
TheSTART BACKUP command is used to create a backup, and has the syntax shown here:
START BACKUP [backup_id] [encryption_option] [wait_option] [snapshot_option]encryption_option:ENCRYPT [PASSWORD=password]password:{'password_string' | "password_string"}wait_option:WAIT {STARTED | COMPLETED} | NOWAITsnapshot_option:SNAPSHOTSTART | SNAPSHOTEND Successive backups are automatically identified sequentially, so thebackup_id, an integer greater than or equal to 1, is optional; if it is omitted, the next available value is used. If an existingbackup_id value is used, the backup fails with the errorBackup failed: file already exists. If used, thebackup_id must follow immediately after theSTART BACKUP keywords, before any other options are used.
In NDB 8.0.22 and later,START BACKUP supports the creation of encrypted backups usingENCRYPT PASSWORD=. Thepasswordpassword must meet all of the following requirements:
Uses any of the printable ASCII characters except
!,',",$,%,\, and^Is no more than 256 characters in length
Is enclosed by single or double quotation marks
WhenENCRYPT PASSWORD=' is used, the backup data record and log files written by each data node are encrypted with a key derived from the user-providedpassword'password and a randomly-generated salt using a key derivation function (KDF) that employs the PBKDF2-SHA256 algorithm to generate a symmetric encryption key for that file. This function has the form shown here:
key = KDF(random_salt,password)The key so generated is then used to encrypt the backup data using AES 256 CBC inline, and symmetric encryption is employed for encrypting the backup fileset (with the generated key).
NDB Clusternever saves the user-furnished password or generated encryption key.
Starting with NDB 8.0.24, thePASSWORD option can be omitted fromencryption_option. In this case, the management client prompts the user for a password.
It is possible usingPASSWORD to set an empty password ('' or""), but this is not recommended.
An encrypted backup can be decrypted using any of the following commands:
ndbxfrm
--decrypt-password=passwordinput_fileoutput_filendb_print_backup_file
-Ppasswordfile_name
NDB 8.0.24 and later supports the additional commands listed here:
See the descriptions of these programs for more information, such as additional options that may be required.
Thewait_option can be used to determine when control is returned to the management client after aSTART BACKUP command is issued, as shown in the following list:
If
NOWAITis specified, the management client displays a prompt immediately, as seen here:ndb_mgm> START BACKUP NOWAITndb_mgm>In this case, the management client can be used even while it prints progress information from the backup process.
With
WAIT STARTEDthe management client waits until the backup has started before returning control to the user, as shown here:ndb_mgm> START BACKUP WAIT STARTEDWaiting for started, this may take several minutesNode 2: Backup 3 started from node 1ndb_mgm>WAIT COMPLETEDcauses the management client to wait until the backup process is complete before returning control to the user.
WAIT COMPLETED is the default.
Asnapshot_option can be used to determine whether the backup matches the state of the cluster whenSTART BACKUP was issued, or when it was completed.SNAPSHOTSTART causes the backup to match the state of the cluster when the backup began;SNAPSHOTEND causes the backup to reflect the state of the cluster when the backup was finished.SNAPSHOTEND is the default, and matches the behavior found in previous NDB Cluster releases.
If you use theSNAPSHOTSTART option withSTART BACKUP, and theCompressedBackup parameter is enabled, only the data and control files are compressed—the log file is not compressed.
If both await_option and asnapshot_option are used, they may be specified in either order. For example, all of the following commands are valid, assuming that there is no existing backup having 4 as its ID:
START BACKUP WAIT STARTED SNAPSHOTSTARTSTART BACKUP SNAPSHOTSTART WAIT STARTEDSTART BACKUP 4 WAIT COMPLETED SNAPSHOTSTARTSTART BACKUP SNAPSHOTEND WAIT COMPLETEDSTART BACKUP 4 NOWAIT SNAPSHOTSTARTThe procedure for creating a backup consists of the following steps:
Start the management client (ndb_mgm), if it not running already.
Execute the
START BACKUPcommand. This produces several lines of output indicating the progress of the backup, as shown here:ndb_mgm> START BACKUPWaiting for completed, this may take several minutesNode 2: Backup 1 started from node 1Node 2: Backup 1 started from node 1 completed StartGCP: 177 StopGCP: 180 #Records: 7362 #LogRecords: 0 Data: 453648 bytes Log: 0 bytesndb_mgm>When the backup has started the management client displays this message:
Backupbackup_id started from nodenode_idbackup_idis the unique identifier for this particular backup. This identifier is saved in the cluster log, if it has not been configured otherwise.node_idis the identifier of the management server that is coordinating the backup with the data nodes. At this point in the backup process the cluster has received and processed the backup request. It does not mean that the backup has finished. An example of this statement is shown here:Node 2: Backup 1 started from node 1The management client indicates with a message like this one that the backup has started:
Backupbackup_id started from nodenode_id completedAs is the case for the notification that the backup has started,
backup_idis the unique identifier for this particular backup, andnode_idis the node ID of the management server that is coordinating the backup with the data nodes. This output is accompanied by additional information including relevant global checkpoints, the number of records backed up, and the size of the data, as shown here:Node 2: Backup 1 started from node 1 completed StartGCP: 177 StopGCP: 180 #Records: 7362 #LogRecords: 0 Data: 453648 bytes Log: 0 bytes
It is also possible to perform a backup from the system shell by invokingndb_mgm with the-e or--execute option, as shown in this example:
$> ndb_mgm -e "START BACKUP 6 WAIT COMPLETED SNAPSHOTSTART" When usingSTART BACKUP in this way, you must specify the backup ID.
Cluster backups are created by default in theBACKUP subdirectory of theDataDir on each data node. This can be overridden for one or more data nodes individually, or for all cluster data nodes in theconfig.ini file using theBackupDataDir configuration parameter. The backup files created for a backup with a givenbackup_id are stored in a subdirectory namedBACKUP- in the backup directory.backup_id
Cancelling backups. To cancel or abort a backup that is already in progress, perform the following steps:
Start the management client.
Execute this command:
ndb_mgm> ABORT BACKUPbackup_idThe number
backup_idis the identifier of the backup that was included in the response of the management client when the backup was started (in the messageBackup).backup_idstarted from nodemanagement_node_idThe management client acknowledges the abort request with
Abort of backup.backup_idorderedNoteAt this point, the management client has not yet received a response from the cluster data nodes to this request, and the backup has not yet actually been aborted.
After the backup has been aborted, the management client reports this fact in a manner similar to what is shown here:
Node 1: Backup 3 started from 5 has been aborted. Error: 1321 - Backup aborted by user request: Permanent error: User defined errorNode 3: Backup 3 started from 5 has been aborted. Error: 1323 - 1323: Permanent error: Internal errorNode 2: Backup 3 started from 5 has been aborted. Error: 1323 - 1323: Permanent error: Internal errorNode 4: Backup 3 started from 5 has been aborted. Error: 1323 - 1323: Permanent error: Internal errorIn this example, we have shown sample output for a cluster with 4 data nodes, where the sequence number of the backup to be aborted is
3, and the management node to which the cluster management client is connected has the node ID5. The first node to complete its part in aborting the backup reports that the reason for the abort was due to a request by the user. (The remaining nodes report that the backup was aborted due to an unspecified internal error.)NoteThere is no guarantee that the cluster nodes respond to an
ABORT BACKUPcommand in any particular order.The
Backupmessages mean that the backup has been terminated and that all files relating to this backup have been removed from the cluster file system.backup_idstarted from nodemanagement_node_idhas been aborted
It is also possible to abort a backup in progress from a system shell using this command:
$> ndb_mgm -e "ABORT BACKUPbackup_id" If there is no backup having the IDbackup_id running when anABORT BACKUP is issued, the management client makes no response, nor is it indicated in the cluster log that an invalid abort command was sent.
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.2Kb
Man Pages (Zip) - 402.4Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0