sqoop基于Hadoop与Hive
Hadoop https://www.cnblogs.com/xibuhaohao/p/11772031.html
Hive https://www.cnblogs.com/xibuhaohao/p/11772481.html
一、下载sqoop
sqoop-1.4.7.tar
http://mirror.bit.edu.cn/apache/sqoop/1.4.7/
二、安装sqoop
1、解压缩sqoop
tar -vzxf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz -C /home/hadoop/
2、sqoop文件目录重命名
mv sqoop-1.4.7.bin__hadoop-2.6.0 sqoop-1.4.7.bin
3、配置sqoop环境变量
export SQOOP_HOME=/home/hadoop/sqoop-1.4.7.bin
export PATH=$PATH:$JAVA_HOME/bin:$SQOOP_HOME/bin
三、安装配置sqoop
1、配置sqoop配置文件
cd /home/hadoop/sqoop-1.4.7.bin/conf
cp sqoop-env-template.sh sqoop-env.sh
cat sqoop-env.sh
#Set path to where bin/hadoop is available
export HADOOP_COMMON_HOME=/home/hadoop/hadoop-2.8.5
#Set path to where hadoop-*-core.jar is available
export HADOOP_MAPRED_HOME=/home/hadoop/hadoop-2.8.5
#set the path to where bin/hbase is available
#export HBASE_HOME=
#Set the path to where bin/hive is available
export HIVE_HOME=/home/hadoop/apache-hive-2.3.6-bin
#Set the path for where zookeper config dir is
#export ZOOCFGDIR=
2、验证安装配置
四、sqoop测试
1、MySQL测试
1)mysql-connector-java-5.1.48-bin.jar放入/hadoop/sqoop-1.4.7/lib目录下
cp mysql-connector-java-5.1.48.jar /home/hadoop/sqoop-1.4.7.bin//lib/
2)sqoop连接MySQL测试
进入/hadoop/sqoop-1.4.7/bin 运行(已经设置环境变量则可以在任意目录运行)
sqoop list-databases --connect jdbc:mysql://172.16.100.173:3306/ --username root --P
3)将MySQL数据导入Hive
Sqoop 安装与简单测试
原文:https://www.cnblogs.com/xibuhaohao/p/11775973.html