sqoop1.4.6安装
(一)打开安装包所在地 [root@kylin141 conf]# cd /opt/install/ [root@kylin141 install]# ls apache-hive-3.1.2-bin.tar.gz ? ? ? ? ? ? ? ? ? ?mysql-community-embedded-5.7.28-1.el7.x86_64.rpm apache-kylin-3.0.2-bin.tar.gz ? ? ? ? ? ? ? ? ? mysql-community-embedded-compat-5.7.28-1.el7.x86_64.rpm apache-zookeeper-3.5.7-bin.tar.gz ? ? ? ? ? ? ? mysql-community-embedded-devel-5.7.28-1.el7.x86_64.rpm flume-ng-1.6.0-cdh5.14.0.tar.gz ? ? ? ? ? ? ? ? mysql-community-libs-5.7.28-1.el7.x86_64.rpm hadoop-3.1.3.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm hbase-2.0.5-bin.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ?mysql-community-server-5.7.28-1.el7.x86_64.rpm jdk-8u212-linux-x64.tar.gz ? ? ? ? ? ? ? ? ? ? ?mysql-community-test-5.7.28-1.el7.x86_64.rpm kafka_2.11-2.4.1.tgz ? ? ? ? ? ? ? ? ? ? ? ? ? ?mysql-connector-java-5.1.37.jar mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar ? ? ? ?spark-3.0.0-bin-hadoop3.2.tgz mysql-community-client-5.7.28-1.el7.x86_64.rpm ?sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz mysql-community-common-5.7.28-1.el7.x86_64.rpm ?zeppelin-0.9.0-preview1-bin-all.tgz mysql-community-devel-5.7.28-1.el7.x86_64.rpm
(二)解压安装包 [root@kylin141 install]# tar -zxf sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz ?-C /opt/soft/ [root@kylin141 install]# cd /opt/soft [root@kylin141 soft]# ls hadoop313 ?hbase205 ?hive312 ?jdk180 ?sqoop-1.4.6.bin__hadoop-2.0.4-alpha ?zepplin090 ?zookeeper357
(三)重命名 [root@kylin141 soft]# mv sqoop-1.4.6.bin__hadoop-2.0.4-alpha ? sqoop146 [root@kylin141 soft]# ls hadoop313 ?hbase205 ?hive312 ?jdk180 ?sqoop146 ?zepplin090 ?zookeeper357
(四)查看sqoop安装路径 [root@kylin141 soft]# cd ./sqoop146/ [root@kylin141 sqoop146]# pwd /opt/soft/sqoop146
(五)修改sqoop146的conf目录下的文件 [root@kylin141 sqoop146]# cd ./conf/ [root@kylin141 conf]# ls oraoop-site-template.xml ?sqoop-env-template.cmd ?sqoop-env-template.sh ?sqoop-site-template.xml ?sqoop-site.xml
1.文件重命名 ?sqoop-env.sh [root@kylin141 conf]# mv sqoop-env-template.sh sqoop-env.sh [root@kylin141 conf]# ls oraoop-site-template.xml ?sqoop-env.sh ?sqoop-env-template.cmd ?sqoop-site-template.xml ?sqoop-site.xml
2.查询Hadoop ?hbase ?hive ?zookeeper ?的安装路径 [root@kylin141 ~]# cd /opt/soft/ [root@kylin141 soft]# ls hadoop313 ?hbase205 ?hive312 ?jdk180 ?sqoop146 ?zepplin090 ?zookeeper357 [root@kylin141 soft]# cd ./hadoop313/ [root@kylin141 hadoop313]# pwd /opt/soft/hadoop313 [root@kylin141 hadoop313]# cd ../hbase205/ [root@kylin141 hbase205]# pwd /opt/soft/hbase205 [root@kylin141 hbase205]# cd ../hive312/ [root@kylin141 hive312]# pwd /opt/soft/hive312 [root@kylin141 hive312]# cd ../zookeeper357/conf/ [root@kylin141 conf]# pwd /opt/soft/zookeeper357/conf
3.修改文件 ? ?sqoop-env.sh? [root@kylin141 conf]# vi 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=/opt/soft/hbase205 ? ? ?30? ? ? ?31 #Set the path to where bin/hive is available ? ? ?32 export HIVE_HOME=/opt/soft/hive312 ? ? ?33? ? ? ?34 #Set the path for where zookeper config dir is ? ? ?35 export ZOOCFGDIR=/opt/soft/zookeeper357/conf
(六)拷贝hive312的lib目录下的一个jar包到sqoop146的lib目录下 [root@kylin141 conf]# cp /opt/soft/hive312/lib/mysql-connector-java-5.1.37.jar ?../lib/
查看一下 jar包是否拷贝成功 [root@kylin141 conf]# cd /opt/soft/sqoop146/lib/ [root@kylin141 lib]# ls ant-contrib-1.0b3.jar ? ? ? ? ?hsqldb-1.8.0.10.jar ? ? ? ? ? ?kite-hadoop-compatibility-1.0.0.jar ?parquet-generator-1.4.1.jar ant-eclipse-1.0-jvm1.2.jar ? ? jackson-annotations-2.3.0.jar ?mysql-connector-java-5.1.37.jar ? ? ?
(七)配置一下环境 [root@kylin141 conf]# vi /etc/profile #sqoop export SQOOP_HOME=/opt/soft/sqoop146 export PATH=$PATH:$SQOOP_HOME/bin
(八)source一下 [root@kylin141 conf]# source /etc/profile
(九)使用sqoop [root@kylin141 conf]# sqoop version Sqoop 1.4.6 git commit id c0c5a81723759fa575844a0a1eae8f510fa32c25 Compiled by root on Mon Apr 27 14:38:36 CST 2015
[root@kylin141 conf]# sqoop help
[root@kylin141 conf]# sqoop help list-databases
[root@kylin141 conf]# sqoop list-databases --connect jdbc:mysql://kylin141:3306 --username root --password 123456 2022-05-11 16:11:00,996 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset. information_schema metastore mysql performance_schema sys
|