ExportSnapshot无法加载

时间:2014-11-19 05:31:33

标签: java hadoop export hbase

我正在尝试使用快照将表从cluster1导出到cluster2。但是,无法从cluster1访问cluster2,因此我无法执行:

bin/hbase class org.apache.hadoop.hbase.snapshot.tool.ExportSnapshot -snapshot MySnapshot -copy-to hdfs://cluster2:8020/hbase -mappers 16

但是,我可以导出到hdfs:

hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot snapshot_my_table -copy-to hdfs://cluster1/export

以上命令创建以下目录:

hdfs://cluster1/export/.hbase-snapshot  
hdfs://cluster1/export/archive  

我将'hdfs://cluster1/export/.hbase-snapshot/snapshot_my_table'下的文件复制到本地文件系统,然后tar.gzip'ed它们,然后通过另一台机器将它们scp到cluster2。 / p>

我在hdfs://cluster2/export/.hbase-snapshot/

下取消归档了这些内容

然后我登录了hbase shell,并通过list_snapshots看到了快照。

但是,在发出clone_snapshot命令时,我得到:

ERROR: org.apache.hadoop.hbase.snapshot.CorruptedSnapshotException: Corrupted snapshot 'name: "snapshot_my_table"
table: "my_table"
creation_time: 1416346483927
type: FLUSH
version: 0
'
        at org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil$1.storeFile(SnapshotReferenceUtil.java:176)
        at org.apache.hadoop.hbase.util.FSVisitor.visitRegionStoreFiles(FSVisitor.java:115)
        at org.apache.hadoop.hbase.util.FSVisitor.visitTableStoreFiles(FSVisitor.java:81)
        at org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil.visitTableStoreFiles(SnapshotReferenceUtil.java:114)
        at org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil.verifySnapshot(SnapshotReferenceUtil.java:169)
        at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreSnapshot(SnapshotManager.java:713)
        at org.apache.hadoop.hbase.master.HMaster.restoreSnapshot(HMaster.java:3025)
        at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:38247)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2008)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:92)
        at org.apache.hadoop.hbase.ipc.FifoRpcScheduler$1.run(FifoRpcScheduler.java:73)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.FileNotFoundException: Unable to open link: org.apache.hadoop.hbase.io.HFileLink locations=[hdfs://cluster2/apps/hbase/data/data/default/my_table/d988362b296868d458b9473126ed391e/r/0ff1b8969c3049cc9f9f9852760de544, hdfs://cluster2/apps/hbase/data/.tmp/data/default/my_table/d988362b296868d458b9473126ed391e/r/0ff1b8969c3049cc9f9f9852760de544, hdfs://cluster2/apps/hbase/data/archive/data/default/my_table/d988362b296868d458b9473126ed391e/r/0ff1b8969c3049cc9f9f9852760de544]
        at org.apache.hadoop.hbase.io.FileLink.getFileStatus(FileLink.java:376)
        at org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil$1.storeFile(SnapshotReferenceUtil.java:174)
        ... 15 more

那么我需要在导出中包含哪些其他文件?

提前致谢。

1 个答案:

答案 0 :(得分:1)

如你所说,export创建了两个目录.hbase-snapshot和archive。 你需要两者,.hbase-snapshot只是实际数据在存档中的元数据