测试start backup和ndb_restore
//数据节点创建表
10.10.54.67
mysql> create table aa(a int)engine=ndbcluster;
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| aa |
+----------------+
10.10.64.63自动
root@test 20:22>show tables;
+----------------+
| Tables_in_test |
+----------------+
| aa |
+----------------+
//管理节点上备份
10.10.54.64
ndb_mgm> start backup 8
//删除表aa
10.10.54.67
root@test 20:18>drop table aa;
//10.10.64.67还原aa表
[root@Cent67 BACKUP]# ndb_restore -n2 -b8 -r -m --backup_path=/data/backup/BACKUP/BACKUP-8/
-b 备份号,
-n 节点号,
-r 恢复数据,
–m 恢复表结构,
//只备份表结构 -m只在第一次恢复时使用
ndb_restore -n2 -b8 -m --backup_path=/data/backup/BACKUP/BACKUP-8/
//在备份表数据
ndb_restore -n2 -b8 -r --backup_path=/data/backup/BACKUP/BACKUP-8/
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| aa |
+----------------+
//10.10.64.63自动
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| aa |
+----------------+
来源:oschina
链接:https://my.oschina.net/u/1458120/blog/204008