How to import/export hbase data via hdfs (hadoop commands)

前端 未结 2 1596
攒了一身酷
攒了一身酷 2020-12-28 22:00

I have saved my crawled data by nutch in Hbase whose file system is hdfs. Then I copied my data (One table of hbase) from hdfs directly to some local directory by command

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-28 22:35

    If you want to export the table from one hbase cluster and import it to another, use any one of the following method:

    Using Hadoop

    • Export

      $ bin/hadoop jar  export \
             [ [ []]
      

      NOTE: Copy the output directory in hdfs from the source to destination cluster

    • Import

      $ bin/hadoop jar  import  
      

    Note: Both outputdir and inputdir are in hdfs.

    Using Hbase

    • Export

      $ bin/hbase org.apache.hadoop.hbase.mapreduce.Export \
           [ [ []]]
      
    • Copy the output directory in hdfs from the source to destination cluster

    • Import

      $ bin/hbase org.apache.hadoop.hbase.mapreduce.Import  
      

      Reference: Hbase tool to export and import

提交回复
热议问题