赞
踩
博客地址:http://www.oratea.net
hbase-0.94.0有效,HBase权威指南上的介绍过时。
可以通过Export工具将hbase中的表的数据导到hhdfs上
语法为:
bin/hbase org.apache.hadoop.hbase.mapreduce.Export
[ [ []]]
下面拿表sunwg01做测试
hbase org.apache.hadoop.hbase.mapreduce.Export sunwg01 /test/sunwg01
将表sunwg01的数据导出到/test/sunwg01下
[hadoop@sunwg ~]$ hadoop fs -ls /test/sunwg01
Found 3 items
drwxr-xr-x – hadoop supergroup 0 2012-04-05 09:31 /test/sunwg01/_logs
drwxr-xr-x – hadoop supergroup 0 2012-04-05 09:31 /test/sunwg01/_temporary
-rw-r–r– 1 hadoop supergroup 318 2012-04-05 09:31 /test/sunwg01/part-m-00000
查看文件内容,因为文件是seq格式的,所以要使用-text来查看
[hadoop@sunwg ~]$ hadoop fs -text /test/sunwg01/part-m-00000
12/04/05 09:33:59 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
12/04/05 09:33:59 WARN snappy.LoadSnappy: Snappy native library not loaded
72 31 keyvalues={r1/f1:k1/1332849843554/Put/vlen=3}
72 32 keyvalues={r2/f1:k1/1332853651327/Put/vlen=3}
72 33 keyvalues={r3/f1:k1/1332853655990/Put/vlen=3}
72 34 keyvalues={r4/f1:k1/1332853661049/Put/vlen=3}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。