一、SQOOP Job 使用方法查看
sqoop job --help
usage: sqoop job [GENERIC-ARGS] [JOB-ARGS] [-- [<tool-name>] [TOOL-ARGS]]
Job management arguments:
--create <job-id> Create a new saved job
--delete <job-id> Delete a saved job
--exec <job-id> Run a saved job
--help Print usage instructions
--list List saved jobs
--meta-connect <jdbc-uri> Specify JDBC connect string for the
metastore
--show <job-id> Show the parameters for a saved job
--verbose Print more information while working
Generic Hadoop command-line arguments:
(must preceed any tool-specific arguments)
Generic options supported are
-conf <configuration file> specify an application configuration file
-D <property=value> use value for given property
-fs <local|namenode:port> specify a namenode
-jt <local|resourcemanager:port> specify a ResourceManager
-files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster
-libjars <comma separated list of jars> specify comma separated jar files to include in the classpath.
-archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines.
二、SQOOP Job 使用
1、创建一个Job
sqoop job --create myjob -- \
import --connect jdbc:mysql://hadoop001:3306/sqoop \
--username root \
--password 123456 \
--table udp_dept
2、查看Job列表
sqoop job --list
17/10/11 04:15:48 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.7.0
Available jobs:
myjob
3、执行Job
会让输入root的密码
sqoop job --exec myjob
4、删除Job
sqoop job --delete myjob
三、SQOOP Job与Crontab
SQOOP Job一般与Crontab这样的调度器一起使用,将SQOOP Job创建好,再使用调度器定时执行Job