본문 바로가기

Study/Bigdata

Sqoop 1.4.6 설치, 사용 예제(Migrating data using sqoop from Mysql to HBase)

Sqoop2 가 있지만, 1이 익숙한 관계로 다음은 MySQL 에서 Hbase로 Migration 하는 예제 입니다. 



wget http://mirror.apache-kr.org/sqoop/1.4.6/sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz

tar zxvf sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz

mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha /usr/local/sqoop


vim /etc/profile

  export HBASE_HOME=/usr/local/hbase

  export SQOOP_HOME=/usr/local/sqoop

  export PATH=$PATH:$SQOOP_HOME/bin:$HBASE_HOME/bin:$PATH

source /etc/profile



 sqoop import --connect jdbc:mysql://127.0.01:3306/test --username root --password test --table bc_1  --split-by QKEy --table bc_1 --hbase-create-table --hbase-table test2 --column-family test23