目录
- 下载
- 配置
下载
- 本地下载好
- 上传,解压,重命名,注意路径
tar -zxvf /opt/sqoop/sqoop-1.4.6.tar.gz -C /opt/
mv /opt/sqoop-1.4.6.bin__hadoop-2.0.4-alpha /opt/sqoop
配置
- 环境变量
echo 'export SQOOP_HOME=/opt/sqoop/' >> /etc/profile
echo 'export PATH=$PATH:$SQOOP_HOME/bin' >> /etc/profile
source /etc/profile
-
sqoop-env.sh
照着/etc/profile 写好对应路径
-
把mysql驱动添加到$SQOOP_HOME/lib下
cp /opt/mysql/mysql-connector-java-5.1.49.jar /opt/sqoop/lib
- 测试
systemctl status mysqld
sqoop list-databases --connect jdbc:mysql://主机IP:3306/ --username root --P
每次都是连数据库报错:
ERROR manager.CatalogQueryManager: Failed to list databases
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 198 milliseconds ago. The last packet sent successfully to the server was 189 milliseconds ago.
↑ 换了个JDBC驱动解决