1. 获取
wget http://mirrors.hust.edu.cn/apache/sqoop/1.4.7/sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz
tar -zxvf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz
2.环境配置
vi /etc/profile
#Sqoop
export SQOOP_HOME=/usr/local/src/sqoop-1.4.7.bin__hadoop-2.6.0
export PATH=$PATH:$SQOOP_HOME/bin
source /etc/profile
vi $SQOOP_HOME/conf/sqoop-env.sh
export HADOOP_COMMON_HOME=/usr/local/src/hadoop
export HADOOP_MAPRED_HOME=/usr/local/src/hadoop
export HBASE_HOME=/usr/local/src/hbase-1.2.11
export HIVE_HOME=/usr/local/src/apache-hive-2.3.6-bin
export JAVA_HOME=/usr/local/src/jdk1.8
#加入 mysql 驱动包到 $SQOOP_HOME/lib 目录下
cp $HIVE_HOME/lib/mysql-connector-java-5.1.27.jar $SQOOP_HOME/lib/mysql-connector-java-5.1.27.jar
# hive-site.xml复制至$SQOOP_HOME/conf中
cp $HIVE_HOME/conf/hive-site.xml $SQOOP_HOME/conf/hive-site.xml
3.测试
#查看版本
sqoop version
sqoop list-databases -connect jdbc:mysql://sandbox:3308 -username admin -password 123456
网友评论