[root@qphone01 software]# tar -zxvf sqoop-1.4.6-cdh5.7.6.tar.gz -C /opt/apps/[root@qphone01 sqoop-1.4.6-cdh5.7.6]# vi /etc/profileexport SQOOP_HOME=/opt/apps/sqoop-1.4.6-cdh5.7.6
export PATH=$PATH:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$FLUME_HOME/bin:$SQOOP_HOME/bin
[root@qphone01 conf]# mv sqoop-env-template.sh sqoop-env.sh[root@qphone01 conf]# vi sqoop-env.sh#Set path to where bin/hadoop is availableexport HADOOP_COMMON_HOME=/opt/apps/hadoop-2.6.0-cdh5.7.6
#Set path to where hadoop-*-core.jar is availableexport HADOOP_MAPRED_HOME=/opt/apps/hadoop-2.6.0-cdh5.7.6
#set the path to where bin/hbase is availableexport HBASE_HOME=/opt/apps/hbase-1.2.0-cdh5.7.6
#Set the path to where bin/hive is availableexport HIVE_HOME=/opt/apps/hive-1.1.0-cdh5.7.6
#Set the path for where zookeper config dir isexport ZOOCFGDIR=/opt/apps/zookeeper-3.4.5-cdh5.7.6/conf
将mysql的jdbc驱动拷贝到sqoop的lib目录下即可
[root@qphone01 conf]# cp /opt/apps/hive-1.1.0-cdh5.7.6/lib/mysql-connector-java-5.1.47-bin.jar ../lib/[root@qphone01 sqoop-1.4.6-cdh5.7.6]# sqoop version
20/07/21 10:02:29 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.7.6
Sqoop 1.4.6-cdh5.7.6
git commit id
Compiled by jenkins on Tue Feb 21 15:04:07 PST 2017
3. 命令
帮助命令
-- 帮助命令
[root@qphone01 ~]# sqoop help
Warning: /opt/apps/sqoop-1.4.6-cdh5.7.6/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/apps/sqoop-1.4.6-cdh5.7.6/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
20/07/28 19:03:03 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.7.6
usage: sqoop COMMAND [ARGS]
Available commands:
codegen Generate code to interact with database records
create-hive-table Import a table definition into Hive
eval Evaluate a SQL statement and display the results
export Export an HDFS directory to a database table
help List available commands
import Import a table from a database to HDFS
import-all-tables Import tables from a database to HDFS
import-mainframe Import datasets from a mainframe server to HDFS
job Work with saved jobs
list-databases List available databases on a server
list-tables List available tables in a database
merge Merge results of incremental imports
metastore Run a standalone Sqoop metastore
version Display version information
See 'sqoop help COMMAND' for information on a specific command.