解压
[root@guo147 install]# tar -zxvf sqoop-1.4.7.tar.gz -C ../soft/
修改名称
[root@guo147 soft]# mv sqoop-1.4.7/ sqoop147
添加jar包
把sqoop-1.4.7.bin__hadoop-2.6.0/lib 下的avro-1.8.1.jar复制到/opt/soft/sqoop147/lib
[root@guo147 lib]# pwd
/opt/soft/sqoop147/lib
[root@guo147 lib]# cp /opt/soft/hive312/lib/hive-common-3.1.2.jar ./
[root@guo147 lib]# cp /opt/soft/hive312/lib/mysql-connector-java-8.0.29.jar ./
修改配置文件
[root@guo147 conf]# pwd
/opt/soft/sqoop147/conf
[root@guo147 conf]# cp sqoop-env-template.sh sqoop-env.sh
[root@guo147 conf]# vim sqoop-env.sh
22 #Set path to where bin/hadoop is available
23 export HADOOP_COMMON_HOME=/opt/soft/hadoop313
24
25 #Set path to where hadoop-*-core.jar is available
26 export HADOOP_MAPRED_HOME=/opt/soft/hadoop313
27
28 #set the path to where bin/hbase is available
29 #export HBASE_HOME=
30
31 #Set the path to where bin/hive is available
32 export HIVE_HOME=/opt/soft/hive312
33 export HIVE_CONF_DIR=/opt/soft/hive312/conf
34 #Set the path for where zookeper config dir is
35 export ZOOCFGDIR=/opt/soft/zk345/conf
[root@guo147 sqoop147]# pwd
/opt/soft/sqoop147
添加环境变量
[root@guo147 sqoop147]# vim /etc//profile
110 #SQOOP_HOME
111 export SQOOP_HOME=/opt/soft/sqoop147
112 export PATH=$PATH:$SQOOP_HOME/bin
[root@guo147 sqoop147]# source /etc/profile
测试
[root@guo147 sqoop147]# sqoop version
连接MySQL
查看数据库
[root@guo147 sqoop147]# sqoop list-databases --connect jdbc:mysql://192.168.153.143:3306 --username root --password 941006