16.6.5.3. How to Restore a Cluster Backup
The cluster restoration program is implemented as a separate
command-line utility ndb_restore, which
reads the files created by the backup and inserts the stored
information into the database. The restore program must be
executed once for each set of backup files. That is, as many
times as there were database nodes running when the backup was
created.
The first time you run the ndb_restore
restoration program, you also need to restore the metadata. In
other words, you must re-create the database tables. (Note
that the cluster should have an empty database when starting
to restore a backup.) The restore program acts as an API to
the cluster and therefore requires a free connection to
connect to the cluster. This can be verified with the
ndb_mgm command SHOW
(you can accomplish this from a system shell using
ndb_mgm -e SHOW). The -c
connectstring
option may
be used to locate the MGM node (see
Section 16.4.4.2, “The MySQL Cluster connectstring
”, for information
on connectstrings). The backup files must be present in the
directory given as an argument to the restoration program.
It is possible to restore a backup to a database with a
different configuration than it was created from. For example,
suppose that a backup with backup ID 12
,
created in a cluster with two database nodes having the node
IDs 2
and 3
, is to be
restored to a cluster with four nodes. Then
ndb_restore must be run twice — once
for each database node in the cluster where the backup was
taken.
Note: For rapid restoration,
the data may be restored in parallel, provided that there is a
sufficient number of cluster connections available. However,
the data files must always be applied before the logs.