20201117 - Sqoop2(1.99.7) 安装运行

一.下载

cd /home/bigdata;

wget http://mirror.bit.edu.cn/apache/sqoop/1.99.7/sqoop-1.99.7-bin-hadoop200.tar.gz;

tar -zxvf sqoop-1.99.7-bin-hadoop200.tar.gz;

chmod -R 777 sqoop-1.99.7-bin-hadoop200;

mv sqoop-1.99.7-bin-hadoop200 sqoop-1.99.7;

 

二.配置

1.sqoop配置hadoop

vim /home/bigdata/sqoop-1.99.7/conf/sqoop.properties;

修改如下配置

org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/home/bigdata/hadoop-3.3.0/etc/hadoop;

 

vim /home/bigdata/hadoop-3.3.0/etc/hadoop/core-site.xml;

修改如下配置

<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>

 

2.配置环境变量

vim /etc/profile;

添加

#hadoop配置
export HADOOP_HOME=/home/bigdata/hadoop-3.3.0
export PATH=$PATH:$HADOOP_HOME/bin

#Sqoop配置
export SQOOP2_HOME=/home/bigdata/sqoop-1.99.7
export CATALINA_BASE=$SQOOP2_HOME/server
#Sqoop外部jar包存放路径,以后mysql-**.jar,odbc*.jar文件都放到extra-lib中即可
export SQOOP_SERVER_EXTRA_LIB=$SQOOP2_HOME/server/lib/extra-lib
export PATH=$PATH:$SQOOP2_HOME/bin

使环境变量生效

source /etc/profile;

 

三.初始化

sqoop2-tool upgrade;

sqoop2-tool verify;

这里有个坑,hadoop-3.3.0目录下的guava和sqoop2下的guava版本号不一样

需要删除sqoop2的并将hadoop-3.3.0复制过来

cd /home/bigdata;

find -name *guava*;

cp /home/bigdata/hadoop-3.3.0/share/hadoop/yarn/csi/lib/guava-20.0.jar /home/bigdata/sqoop-1.99.7/server/lib/guava-20.0.jar;

rm -f /home/bigdata/sqoop-1.99.7/server/lib/guava-11.0.2.jar;

.....省略其他

 

四.运行

sqoop2-server start

sqoop2-shell

show version --all

 

posted @ 2020-11-17 14:38  AlexUni  阅读(163)  评论(0编辑  收藏  举报