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.ClassNotFoundException: org.apache.zookeeper.
copy the jar file into /hbase/lib
cp zookeeper-3.3.3.jar /hadoop/lib
沒有留言:
張貼留言