2
votes

We have two clusters with hbase 0.94, hadoop 1.04 and hbase 0.98, hadoop 2.4 I've created a snapshot from table on 0.94 snapshot and want to migrate it to cluster with hbase 0.98.

After run this command on 0.98 cluster:

hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot snapshot-name -copy-from webhdfs://hadoops-master:9000/hbase -copy-to hdfs://solr1:8020/hbase

I see:

    Exception in thread "main" org.apache.hadoop.hbase.snapshot.ExportSnapshotException: Failed to copy the snapshot directory: from=webhdfs://hadoops-master:9000/hbase/.hbase-snapshot/snapshot-name to=hdfs://solr1:8020/hbase/.hbase-snapshot/.tmp/snapshot-name
    at org.apache.hadoop.hbase.snapshot.ExportSnapshot.run(ExportSnapshot.java:916)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.hadoop.hbase.snapshot.ExportSnapshot.innerMain(ExportSnapshot.java:1000)
    at org.apache.hadoop.hbase.snapshot.ExportSnapshot.main(ExportSnapshot.java:1004)
Caused by: java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:772)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at org.apache.hadoop.hdfs.web.WebHdfsFileSystem$Runner.getResponse(WebHdfsFileSystem.java:596)
    at org.apache.hadoop.hdfs.web.WebHdfsFileSystem$Runner.run(WebHdfsFileSystem.java:530)
    at org.apache.hadoop.hdfs.web.WebHdfsFileSystem.run(WebHdfsFileSystem.java:417)
    at org.apache.hadoop.hdfs.web.WebHdfsFileSystem.getHdfsFileStatus(WebHdfsFileSystem.java:630)
    at org.apache.hadoop.hdfs.web.WebHdfsFileSystem.getFileStatus(WebHdfsFileSystem.java:641)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:337)
    at org.apache.hadoop.hbase.snapshot.ExportSnapshot.run(ExportSnapshot.java:914)
    ... 3 more
3

3 Answers

0
votes

Lars Hofhansl himself (a principal HBase committer and the maintainer of 0.94) has stated that exports are not supported from 0.94 and 0.98. So you are likely going nowehere with this.

Here is an excerpt from his thread just this afternoon:

It's tricky from multiple angles:- replication between 0.94 and 0.98 does not work (there's a gateway process that supposedly does that, but it's not known to be very reliable)- snapshots cannot be exported from 0.94 and 0.98

source: hbase user's mailing list today 12/15/14

UPDATE On the HBase mailing list there was a report that one user was able to find a way to do the export. A piece of that info is:

If exporting from an HBase 0.94 cluster to an HBase 0.98 cluster, you will need to use the webhdfs protocol (or possibly hftp, though I couldn’t get that to work). You also need to manually move some files around because snapshot layouts have changed. Based on the example above, on the 0.98 cluster do the following:

   check whether any imports already exist for the table:

  hadoop fs -ls /apps/hbase/data/archive/data/default

It would not be correct for me to reproduce the entire discussion here: a link to nabble that contains the entire gory details is:

http://apache-hbase.679495.n3.nabble.com/0-94-going-forward-td4066883.html

0
votes

I am digging into this issue and it has more to do with the underlying HDFS.

Once the streams (in my case for distcp) have been written, close is called:

public void close() throws IOException {
try {
      super.close();
    } finally {
      try {
        validateResponse(op, conn, true);
      } finally {
        conn.disconnect();
      }
    }
  }

Wherein it fails in the validate response call (probably the other end of connection has been closed).

This could be due to incompatibility between HDFS 1.0 and 2.4!

0
votes

I've repacked the hadoop and hbase libs with jarjar https://code.google.com/p/jarjar/ It needs to fix some class name issues. Then I've write a mapreduce copyTable job. It reads rows from 94 culster and writes to 98 cluster. Here is the code: https://github.com/fiserro/copy-table-94to98

Thanks github.com/falsecz for the idea and help!