2012年7月11日 星期三

Bulkload data from Hadoop dfs to HBase

To bulkload data from Hadoop dfs to Hbase, the following steps requires to be ready before the importation.

1. Create table in HBase
     create 't1', 'c1'

2. Make sample directory in dfs
     hadoop dfs -mkdir sampledir

3. Put sample data into hadoop dfs
     hadoop dfs -put input.data sampledir

4. Pull the data from hadoop dfs to hbase
    ./hadoop jar /opt/hbase/hbase-0.90.3.jar importtsv -Dimporttsv.columns=HBASE_ROW_KEY,c1 t1 sampledir

If the following error encounters:
 Error: java.lang.ClassNotFoundExceptionorg.apache.zookeeper.KeeperException


copy the jar file into /hbase/lib
cp zookeeper-3.3.3.jar /hadoop/lib

沒有留言:

張貼留言