您好,登錄后才能下訂單哦!
(1)安裝環境
操作系統:Linux(centos6.5)
JDK版本:1.7.0_45
Hadoop版本:hadoop2.6.0
Sqoop2版本:sqoop-1.99.4-bin-hadoop200
hadoop安裝目錄:/usr/local/hadoop/hadoop-2.2.0
Sqoop2安裝目錄:/usr/local/sqoop/sqoop-1.99.4-bin-hadoop200
Hadoop和Sqoop都是同一個用戶hadoop下面,hadoop用戶的的家目錄:/home/hadoop
(2)修改Sqoop2的配置文件
1、首先修改配置文件/home/hadoop/sqoop-1.99.4-bin-hadoop200/server/conf/sqoop.properties指定hadoop的配置文件所屬路徑。
將原來的如下配置:
# Hadoop configuration directory
org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/etc/hadoop/conf/
修改為:
# Hadoop configuration directory
org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/usr/local/hadoop/hadoop-2.6.0/etc/hadoop/
2、修改配置文件/home/hadoop/sqoop-1.99.4-bin-hadoop200/server/conf/catalina.properties。
這里即時把/home/hadoop/hadoop-2.2.0/share/hadoop下全部的*.jar包加入到sqoop2的類路徑中去。
將原來的如下配置:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/usr/lib/hadoop/*.jar,/usr/lib/hadoop/lib/*.jar,/usr/lib/hadoop-hdfs/*.jar,/usr/lib/hadoop-hdfs/lib/*.jar,/usr/lib/hadoop-mapreduce/*.jar,/usr/lib/hadoop-mapreduce/lib/*.jar,/usr/lib/hadoop-yarn/*.jar,/usr/lib/hadoop-yarn/lib/*.jar
修改為:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/common/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/common/lib/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/hdfs/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/hdfs/lib/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/mapreduce/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/mapreduce/lib/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/tools/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/tools/lib/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/yarn/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/yarn/lib/*.jar,/usr/local/hadoop/hadoop-2.6.0/share/hadoop/httpfs/tomcat/lib/*.jar
(3)修改環境變量
直接修改~/.bashrc在文件末尾追加如下內容即可:
export SQOOP_HOME=/usr/local/sqoop/sqoop-1.99.4-bin-hadoop200
export PATH=$SQOOP_HOME/bin:$PATH
export CATALINA_HOME=$SQOOP_HOME/server
export LOGDIR=$SQOOP_HOME/logs
當然完成上述修改后需要在hadoop用戶下執行命令來讓配置即可生效:
啟停sqoop-server:
$SQOOP2_HOME/bin/sqoop.sh server start $SQOOP2_HOME/bin/sqoop.sh server stop 或者 $SQOOP2_HOME/bin/sqoop2-server start $SQOOP2_HOME/bin/sqoop2-server stop
驗證是否啟動成功:
方式一:jps查看進程: Bootstrap
方式二:http://hadoop000:12000/sqoop/version
方式三:wget -qO - hadoop000:12000/sqoop/version
啟動sqoop客戶端:
$SQOOP2_HOME/bin/sqoop.sh client 或者 $SQOOP2_HOME/bin/sqoop2-shell
為客戶端配置服務器:
sqoop:000> set server --host hadoop000 --port 12000 --webapp sqoop
查看服務器端信息:
sqoop:000> show server --all
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。