从源hbase集群中复制出HBase数据库表到本地目录
- hadoop fs -get
- scp到目的集群
- hadoop fs -put 到目的集群HDFS
亦可使用distcp将集群复制至目标集群
具体办法参考:DistCp
修复.META.表和重新分配数据到各RegionServer
在.META.表没修复时执行重新分配,会报错
#hbase hbck -fixAssignment
...
ERROR: Region { meta => null, hdfs => hdfs://h185:54310/hbase/toplist_ware_total_1009_201232/0403552001eb2a31990e443dcae74ee8, deployed => } on HDFS, but not listed in META or deployed on any region server
...
先修复.META.表
#hbase hbck -fixMeta
重新分配到各分区服务器
# hbase hbck -fixAssignments
将刷一下类型日志
12/08/14 18:28:01 INFO util.HBaseFsckRepair: Region still in transition, waiting for it to become assigned: {NAME => 'toplist_ware_total_1009_201232,,1344187094829.0403552001eb2a31990e443dcae74ee8.', STARTKEY => '', ENDKEY => '', ENCODED => 0403552001eb2a31990e443dcae74ee8,}
12/08/14 18:28:02 INFO util.HBaseFsckRepair: Region still in transition, waiting for it to become assigned: {NAME => 'toplist_ware_total_1009_201232,,1344187094829.0403552001eb2a31990e443dcae74ee8.', STARTKEY => '', ENDKEY => '', ENCODED => 0403552001eb2a31990e443dcae74ee8,}
参考:
distcp相关问题可以参考以下博客:https://www.jianshu.com/p/cbace52602aa