1.切换到/export/server
2.上传并解压
tar zxvf sqoop-1.4.7.bin__hadoop-2.6.0
3.设置软连接
ln -s sqoop-1.4.7.bin__hadoop-2.6.0 sqoop
4.切换到/sqoop/conf
将sqoop-env-template.sh改名为sqoop-env.sh
mv sqoop-env-template.sh sqoop-env.sh
5.编辑配置文件(sqoop-env.sh)
vim sqoop-env.sh
插入
export HIVE_HOME=/export/server/hive
export HADOOP_MAPRED_HOME=/export/server/hadoop
export HADOOP_COMMON_HOME=/export/server/hadoop
注意:配置的版本号和路径根据自身情况更改
6.添加JDBC驱动
切换到/hive/lib
cd /export/server/hive/lib
复制mysql驱动文件
cp mysql-connector-java-5.1.34.jar /export/server/sqoop/lib/
7.验证
bin/sqoop list-databases \
--connect jdbc:mysql://localhost:3306/ \
--username root \
--password 123456
注:若验证时出现java.lang.NoClassDefFoundError错误:请看Sqoop 连接mysql 错误 java.lang.NoClassDefFoundError
出现mysql中的数据库,配置成功。
标签:sqoop,Sqoop,server,sh,export,env,mysql,Apache,安装 From: https://www.cnblogs.com/ysk0904/p/17614850.html