问题
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