热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Sqoop2常用命令介绍

命令行操作之CreateCommand1、CreateConnectionFunctioncreateconnection--cid1说明:Createnewco

命令行操作之Create Command

1、Create Connection Function
create connection --cid 1  说明:Create new connection object for connector with id
sqoop:000> create connection --cid 1
Creating connection for connector with id 1
Please fill following values to create new connection object
Name: jdbc
Connection configuration
JDBC Driver Class: com.mysql.jdbc.Driver
JDBC Connection String: jdbc:mysql://hadoop000:3306/hive
Username: root
Password: ****
JDBC Connection Properties:
There are currently 0 values in the map:
entry#
Security related configuration options
Max connections: 100
New connection was successfully created with validation status FINE and persistent id 5
2、Create Job Function
create job --xid 1    说明:Create new job object for connection with id
create job --xid 1 --type import    说明:Create new job object with type (import, export)
sqoop:000> create job --xid 5 --type import
Creating job for connection with id 5
Please fill following values to create new job object
Name: tbls_import
Database configuration
Schema name: hive
Table name: TBLS
Table SQL statement:
Table column names:
Partition column name:
Nulls in partition column:
Boundary query:
Output configuration
Storage type:
  0 : HDFS
Choose: 0
Output format:
  0 : TEXT_FILE
  1 : SEQUENCE_FILE
Choose: 0
Compression format:
  0 : NONE
  1 : DEFAULT
  2 : DEFLATE
  3 : GZIP
  4 : BZIP2
  5 : LZO
  6 : LZ4
  7 : SNAPPY
Choose: 0
Output directory: hdfs://hadoop000:8020/sqoop2/tbls/
Throttling resources
Extractors:
Loaders:
New job was successfully created with validation status FINE  and persistent id 3

 


 

命令行操作之Show Command

1、Show Server Function
说明:Show details about configuration connection to Sqoop server.
sqoop:000> show server --all
Server host: localhost
Server port: 12000
Server webapp: sqoop
sqoop:000> show server --host
Server host: localhost
sqoop:000> show server --port
Server port: 12000
sqoop:000> show server --webapp
Server webapp: sqoop
2、Show Option Function
Show values of various client side options. This function will show all client options when called without arguments.
sqoop:000> show option --name verbose
Verbose = false
3、Show Version Function
Show versions of both client and server as well as supported protocols.
sqoop:000> show version --all
client version:
  Sqoop 1.99.3-cdh5.0.0 revision Unknown
  Compiled by jenkins on Thu Mar 27 23:34:50 PDT 2014
server version:
  Sqoop 1.99.3-cdh5.0.0 revision Unknown
  Compiled by jenkins on Thu Mar 27 23:34:50 PDT 2014
Protocol version:
  [1]
sqoop:000> show version --client
client version:
  Sqoop 1.99.3-cdh5.0.0 revision Unknown
  Compiled by jenkins on Thu Mar 27 23:34:50 PDT 2014
sqoop:000> show version --server
server version:
  Sqoop 1.99.3-cdh5.0.0 revision Unknown
  Compiled by jenkins on Thu Mar 27 23:34:50 PDT 2014
sqoop:000> show version --protocol
Protocol version:
  [1]
4、Show Connector Function
Show connector meta data - parameters that connectors need in order to create new connection and job objects.
show connector --all
5、 Show Connection Function 
show connection -all
show connection --xid 5
6、Show Job Function
show job --all
show job --jid 4

 


命令行操作之Update Command

1、Update Connection Function
update connection --xid 1 
2、Update Job Function 
update job --jid 1

 


 

命令行操作之Delete Command

1、Delete Connection Function

delete connection --xid 1 

2、Delete Job Function

delete job --jid 1

 


 

命令行操作之Clone Command

1、Clone Connection Function

clone connection --xid 3

2、Clone Job Function

clone job --jid 3

 


 

命令行操作之Submission Command

1、Submission Start Function
Start job (submit new submission). Starting already running job is considered as invalid operation.
start job --jid 3 -s
2、Submission Stop Function
Interrupt running job.
stop job  --jid 3
3、Submission Status Function
Retrieve last status for given job.
status job --jid 3

 


推荐阅读
author-avatar
稚气忖托气质_844
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有