Export HBase Files to Local Machine
To export HBase files to your local system, you can use the HBase export tool hbase org.apache.hadoop.hbase.mapreduce.Export. Here are the steps to export HBase files to your local system:
- First, go to the bin directory under the installation directory of HBase.
- Run the following command to export HBase files to HDFS:
$ hbase org.apache.hadoop.hbase.mapreduce.Export <tablename> <outputdir> [<versions>]
The table name to be exported is the path of the output directory. The brackets [] indicate optional parameters for specifying the number of versions to be exported.
- Schedule the export task. Run the following command in the HBase bin directory:
$ hbase org.apache.hadoop.hbase.mapreduce.Export <tablename> <outputdir> [<versions>]
- Waiting for the export of the assignment to be completed.
- Finally, you can download the exported files from HDFS to your local machine using Hadoop’s command line tools or other methods. For example, you can use the following command to copy the file from HDFS to your local machine:
$ hadoop fs -copyToLocal <hdfs_output_directory> <local_output_directory>
By following the steps above, you can successfully export HBase files to your local machine.