CentOS6.5安裝sqoop2

獵手家園發表於2016-05-17

1、下載軟體:http://archive.cloudera.com/cdh5/cdh/5/

2、解壓:tar -zxvf mysofts/sqoop2-1.99.5-cdh5.6.0.tar.gz

3、配置環境變數

[root@Hadoop-NN-01 ~]# vim /etc/profile

#
sqoop2 export SQOOP2_HOME=/home/hadoopuser/sqoop2-1.99.5-cdh5.6.0 export CATALINA_BASE=$SQOOP2_HOME/server export PATH=$PATH:$SQOOP2_HOME/bin [root@Hadoop-NN-01 ~]# source /etc/profile #使用環境變數生效

 

4、複製mysql驅動包到 $SQOOP2_HOME/server/lib下

驅動包下載:http://dev.mysql.com/downloads/connector/j/

[hadoopuser@Hadoop-NN-01 ~]$ cp mysql-connector-java-5.1.10-bin.jar $SQOOP2_HOME/server/lib/

 

5、修改hadoop配置檔案所屬路徑

[hadoopuser@Hadoop-NN-01 ~]$ vim $SQOOP2_HOME/server/conf/sqoop.properties
org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/etc/hadoop

 

6、把/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop下所有*.jar包加入到類路徑裡:

[hadoopuser@Hadoop-NN-01 ~]$ vim $SQOOP2_HOME/server/conf/catalina.properties

#修改後
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/common/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/common/lib/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/hdfs/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/hdfs/lib/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/mapreduce/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/mapreduce/lib/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/tools/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/tools/lib/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/yarn/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/yarn/lib/*.jar,/home/hadoopuser/hadoop-2.6.0-cdh5.6.0/share/hadoop/httpfs/tomcat/lib/*.jar

注:如果想修改tomcat的埠號等資訊可以在$SQOOP2_HOME/server/conf/server.xml中進行設定。

 

7、啟停sqoop-server

[hadoopuser@Hadoop-NN-01 sqoop2-1.99.5-cdh5.6.0]$ bin/sqoop.sh server start
[hadoopuser@Hadoop-NN-01 sqoop2-1.99.5-cdh5.6.0]$ bin/sqoop.sh server stop

 

8、驗證是否啟動成功

方式一:jps檢視程式:Bootstrap

方式二:http://Hadoop-NN-01:12000/sqoop/version

 

9、進入sqoop客戶端

[hadoopuser@Hadoop-NN-01 sqoop2-1.99.5-cdh5.6.0]$ bin/sqoop.sh client

 

10、為客戶端配置伺服器

sqoop:000> set server --host Hadoop-NN-01 --port 12000 --webapp sqoop
Server is set successfully 

檢視伺服器端資訊:

sqoop:000> show server --all
Server host: Hadoop-NN-01
Server port: 12000
Server webapp: sqoop

 

相關文章