1.官网下载安装包:
http://mirrors.hust.edu.cn/apache/sqoop/1.4.6/
2.安装sqoop
- 上传安装包并解压
上传安装包 sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz 到服务器上,进入安装包所在的路径执行解压命令:
tar -zxf sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz -C /opt/module/
mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha sqoop-1.4.6
- 修改配置文件
进入到/opt/module/sqoop-1.4.6/conf 目录,重命名配置文件
mv sqoop-env-template.sh sqoop-env.sh
vim sqoop-env.sh
export HADOOP_COMMON_HOME=/opt/module/hadoop-3.1.3
export HADOOP_MAPRED_HOME=/opt/module/hadoop-3.1.3
export HIVE_HOME=/opt/module/hive-3.1.2
export ZOOKEEPER_HOME=/opt/module/zookeeper-3.5.7
export ZOOCFGDIR=/opt/module/zookeeper-3.5.7/conf
-
拷贝驱动
将jdbc驱动jar包拷贝到sqooplib目录中去 -
测试
sqoop list-databases --connect jdbc:mysql://hadoop101:3306/ --username root --password yourpassword