sqoop 1.4.6安装配置
之所以选择Sqoop1是因为Sqoop2目前问题太多。无法正常使用,综合比较后选择Sqoop1。
Sqoop1安装配置比较简单
一、安装部署
(1)、下载地址:http://archive.cloudera.com/cdh5/cdh/5/sqoop-1.4.6-cdh5.5.2.tar.gz
解压到/opt/cdh5/sqoop
(2)、拷贝MySQL的jdbc驱动包mysql-connector-Java-5.1.31-bin.jar到sqoop/lib目录下。
(3)、配置环境变量
#sqoop
export SQOOP_HOME=/opt/cdh5/sqoop
export PATH=$PATH:$SQOOP_HOME/bin
(4)、复制sqoop/conf/sqoop-env-template.sh为sqoop-env.sh
添加相关的配置
#Setpath to where bin/Hadoop is available
exportHADOOP_COMMON_HOME=/opt/cdh5/hadoop
#Setpath to where hadoop-*-core.jar isavailable
exportHADOOP_MAPRED_HOME=/opt/cdh5/hadoop
#setthe path to where bin/Hbase isavailable
exportHBASE_HOME=/opt/cdh5/hbase
#Setthe path to where bin/Hive is available
exportHIVE_HOME= /opt/cdh5/hive
#Setthe path for where zookeper config diris
exportZOOCFGDIR= /opt/cdh5/zookeeper
(5)、测试Sqoop
sqoop version
sqoop import --connect jdbc:mysql://192.168.0.141:3306/db_blog --username root --password 123456 --table t_blog
更多使用教程
http://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_example_invocations