1.前期准备

1.1统计数据库条数

  1. #1./etc/profile配置
  2. export HBASE_HOME=/opt/module/hbase-1.3.1
  3. export HADOOP_HOME=/opt/module/hadoop-2.7.2
  4. #2.hadoop-env.sh中配置 !!!!!!注意:在for循环之后配!!!!!!
  5. export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/opt/module/hbase/lib/*
  6. #3. 验证命令
  7. yarn jar /module/hbase1.6/lib/hbase-server-1.6.0.jar rowcounter stu

1.2导入数据

fruit.csv

  1. create 'fruit','info'
  2. hdfs dfs -mkdir /input_fruit/
  3. hdfs dfs -put fruit.tsv /input_fruit/
  4. yarn jar lib/hbase-server-1.3.1.jar importtsv \
  5. -Dimporttsv.columns=HBASE_ROW_KEY,info:name,info:color fruit \
  6. hdfs://hadoop102:9000/input_fruit
  7. scan fruit