Documentation Home
MySQL 9.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 259.0Kb
Man Pages (Zip) - 366.2Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 Reference Manual  / ...  / MySQL NDB Cluster 9.0  / NDB Cluster Replication  / NDB Cluster Backups With NDB Cluster Replication  /  Point-In-Time Recovery Using NDB Cluster Replication

25.7.9.2 Point-In-Time Recovery Using NDB Cluster Replication

Point-in-time recovery—that is, recovery of data changes made since a given point in time—is performed after restoring a full backup that returns the server to its state when the backup was made. Performing point-in-time recovery of NDB Cluster tables with NDB Cluster and NDB Cluster Replication can be accomplished using a nativeNDB data backup (taken by issuingCREATE BACKUP in thendb_mgm client) and restoring thendb_binlog_index table (from a dump made usingmysqldump).

To perform point-in-time recovery of NDB Cluster, it is necessary to follow the steps shown here:

  1. Back up allNDB databases in the cluster, using theSTART BACKUP command in thendb_mgm client (seeSection 25.6.8, “Online Backup of NDB Cluster”).

  2. At some later point, prior to restoring the cluster, make a backup of themysql.ndb_binlog_index table. It is probably simplest to usemysqldump for this task. Also back up the binary log files at this time.

    This backup should be updated regularly—perhaps even hourly—depending on your needs.

  3. (Catastrophic failure or error occurs.)

  4. Locate the last known good backup.

  5. Clear the data node file systems (usingndbd--initial orndbmtd--initial).

    Note

    Disk Data tablespace and log files are also removed by--initial.

  6. UseDROP TABLE orTRUNCATE TABLE with themysql.ndb_binlog_index table.

  7. Executendb_restore, restoring all data. You must include the--restore-epoch option when you runndb_restore, so that thendb_apply_status table is populated correctly. (SeeSection 25.5.23, “ndb_restore — Restore an NDB Cluster Backup”, for more information.)

  8. Restore thendb_binlog_index table from the output ofmysqldump and restore the binary log files from backup, if necessary.

  9. Find the epoch applied most recently—that is, the maximumepoch column value in thendb_apply_status table—as the user variable@LATEST_EPOCH (emphasized):

    SELECT@LATEST_EPOCH:=MAX(epoch)    FROM mysql.ndb_apply_status;
  10. Find the latest binary log file (@FIRST_FILE) and position (Position column value) within this file that correspond to@LATEST_EPOCH in thendb_binlog_index table:

    SELECT Position,@FIRST_FILE:=File    FROM mysql.ndb_binlog_index    WHERE epoch >@LATEST_EPOCH ORDER BY epoch ASC LIMIT 1;
  11. Usingmysqlbinlog, replay the binary log events from the given file and position up to the point of the failure. (SeeSection 6.6.9, “mysqlbinlog — Utility for Processing Binary Log Files”.)

See alsoSection 9.5, “Point-in-Time (Incremental) Recovery”, for more information about the binary log, replication, and incremental recovery.