How to copy Hbase data to local file system (external drive)

泄露秘密 提交于 2019-12-10 11:53:34

问题


I want to have a backup of hbase data that is in hdfs. I have an external drive ( usb hard disk). How can i copy data from hbase to my drive. I have used a command like

bin/hbase org.apache.hadoop.mapreduce.Drive export table /media/.../mydrive.

but what actually is done, that a new directory in hdfs with path /media/.../mydrive is created and nothing is save in my external hard. Why is this issue. Is there a way to inform that data should be saved in my external driver other than the command, i used above.

Please reply


回答1:


If data is in hdfs you can use below commands to copy data from hdfs to local and then from local system, you can do what ever you want to do with data.

hadoop fs -get path_of_hdfs_system_where_your_data_is  path_of_local_file_system

For example:

hadoop fs -get /user/hive/warehouse/rocky.db/test5_bucket/000002_0 /home/yarn
hadoop fs -copyToLocal /user/hive/warehouse/rocky.db/test5_bucket/000002_0 /home/yarn


来源:https://stackoverflow.com/questions/25906577/how-to-copy-hbase-data-to-local-file-system-external-drive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!