1.前期准备
1.1统计数据库条数
#1./etc/profile配置
export HBASE_HOME=/opt/module/hbase-1.3.1
export HADOOP_HOME=/opt/module/hadoop-2.7.2
#2.hadoop-env.sh中配置 !!!!!!注意:在for循环之后配!!!!!!
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/opt/module/hbase/lib/*
#3. 验证命令
yarn jar /module/hbase1.6/lib/hbase-server-1.6.0.jar rowcounter stu
1.2导入数据
fruit.csv
create 'fruit','info'
hdfs dfs -mkdir /input_fruit/
hdfs dfs -put fruit.tsv /input_fruit/
yarn jar lib/hbase-server-1.3.1.jar importtsv \
-Dimporttsv.columns=HBASE_ROW_KEY,info:name,info:color fruit \
hdfs://hadoop102:9000/input_fruit
scan ‘fruit’