sqoop安裝須要提早安裝好sqoop依賴:hadoop 、hive、hbase、zookeeperhtml
hadoop安裝步驟請訪問:http://www.cnblogs.com/xningge/articles/8433297.htmljava
hive安裝步驟請訪問:http://www.cnblogs.com/xningge/p/8433792.htmlmysql
hbase安裝步驟請訪問:sql
zookeeper安裝步驟請訪問:http://www.cnblogs.com/xningge/p/8433618.htmlapache
sqoop須要的軟件包:sqoop-1.4.5-cdh5.3.6.tar.gzoop
一、上傳sqoop軟件包到Linux系統指定目錄:/opt/softwares/cdh測試
二、解壓 sqoop軟件包到指定目錄:/opt/modules/cdh/spa
tar -zxvf sqoop-1.4.5-cdh5.3.6.tar.gz -C /opt/modules/cdh/htm
3 、配置conf/sqoop-env.shblog
複製:$ cp -a sqoop-env-template.sh sqoop-env.sh或直接重命名
#Set path to where bin/hadoop is available
export HADOOP_COMMON_HOME=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6
#Set path to where hadoop-*-core.jar is available
export HADOOP_MAPRED_HOME=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6
#set the path to where bin/hbase is available
export HBASE_HOME=/opt/modules/cdh/hbase-0.98.6-cdh5.3.6
#Set the path to where bin/hive is available
export HIVE_HOME=/opt/modules/cdh/hive-0.13.1-cdh5.3.6
#Set the path for where zookeper config dir is
export ZOOCFGDIR=/opt/modules/cdh/zookeeper-3.4.5-cdh5.3.6
四、拷貝jdbc驅動包達到lib目錄
$ cp /opt/modules/apache-hive-0.13.1-bin/lib/mysql-connector-java-5.1.27-bin.jar /opt/modules/cdh/sqoop-1.4.5-cdh5.3.6/lib/
五、測試
查看幫助信息:bin/sqoop help
測試:sqoop 鏈接 mysql
bin/sqoop list-databases --help
bin/sqoop list-databases --connect jdbc:mysql://hadoop01.xningge.com:3306/ --username root --password ???