1

I am trying to restore mysql cluster backup on slave cluster.

When i run ndb_restore command it gives me following error:

$ /usr/local/mysql/bin/ndb_restore -n 6 -b 15 -r ./6

Opening file './6/BACKUP-15.6.log'
File size 1210464 bytes
execute failed: 255: Foreign key constraint violated: No parent row found

NDBT_ProgramExit: 1 - Failed

How can i skip foreign key errors ?

1 Answer 1

0

With any more complex data it is almost impossible to restore data in MySQL Cluster in one step. Usually one needs two steps:

ndb_restore <other_options> --disable-indexes

ndb_restore <other_options> --rebuild-indexes

First step has to be run on all nodes of the cluster. Second step though - just on one node which will rebuild all the indexes.

For foreign keys you can try to split first step into two:

ndb_restore <other_options> --restore_meta

ndb_restore <other_options> --restore_data --disable-indexes

--restore_meta has to be run on one node. --restore_data on all the nodes in cluster.

3
  • Edited the answer. Have not tried suggested way myself though. May 17, 2015 at 16:43
  • Can you try to drop foreign key constraint after --restore_meta and recreate after restoring the data? May 18, 2015 at 5:32
  • Actually disabling indexes while restoring data works. Probably i made a mistake at my first try. I could restore data successfuly following these steps. Thanks for reply :)
    – Gpost
    May 22, 2015 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.