因為集群不互通,所以采用手動方式遷移
1、下載目標集群數據
hadoop fs -get /apps/hbase/data/data/default/*c4be21d3000064c0 /mnt/data
2、遠程復制數據,可以壓縮一下
scp ***
3、上傳數據到HDFS,一定要切換到hbase用戶,不然會有錯誤
su hdfs hadoop fs -put /app/hbase/* /apps/hbase/data/data/default/
4、修復元數據等
hbase hbck 只做檢查 hbase hbck -fixMeta 根據region目錄中的.regioninfo,生成meta表 hbase hbck -fixAssignments 把meta表中記錄的region分配給regionserver hbase hbck -fixHdfsOrphans 修復.regioninfo文件
hbase hbck -repair 表名
遇到的問題:
There is a hole in the region chain between and . You need to create a new .regioninfo and region dir in hdfs to plug the hole
Found inconsistency in table
最后發現是上傳數據到hdfs是沒有使用hbase用戶,修改文件owner后重新修復就好了
hadoop fs -chown -R hbase:hdfs /apps/hbase/data/data/default
hbase hbck -repair 表名
