注意事项:1.HBase版本需要保持一致,否则数据无法恢复
本方案使用export及import方法,还有其他方法可以实现,暂不涉及。
1.备份,以表为单位进行导出
./bin/hbase org.apache.hadoop.hbase.mapreduce.Export $table_name $dst_path
2.恢复
在新集群创建表,可以用describe从源集群获取表schema
describe $table_name
导入数据
./bin/hbase org.apache.hadoop.hbase.mapreduce.Import $table_name $dst_path