Sqoop2简单命令(linux)

Sqoop 2

1 启动客户端

sqoop.sh client

2 设置服务器

set server –host localhost –port 12000 –webapp sqoop

3 查看版本

show version –all 

4 查看所有连接器

show connector –all 

5 创建连接对象

create connection --cid 1

要把mysql的driver放到server的lib下

输入如下

Name: First connection

Configuration configuration

JDBC Driver Class: com.mysql.jdbc.Driver

JDBC Connection String: jdbc:mysql://localhost/test

Username: root

Password: *****

 

6 建job

create job --xid 1 --type import

Creating job for connection with id 1

Please fill following values to create newjob object

Name: First job

 

Database configuration

Table name: users

Table SQL statement:

Table column names:

Partition column name:

Boundary query:

 

Output configuration

Storage type:

  0 :HDFS

Choose: 0

Output directory: /user/jarcec/users

New job was successfully created withvalidation status FINE and persistent id 1

 

 

7 执行job

Start job –jid 1

sqoop:000> submission start --jid 1

Submission details

Job id: 1

Status: BOOTING

Creation date: 2012-12-23 13:20:34 PST

Last update date: 2012-12-23 13:20:34 PST

External Id: job_1353136146286_0004

       http://hadoop.cluster.com:8088/proxy/application_1353136146286_0004/

Progress: Progress is not available

 

8 查看正在执行的job的状态

Status job –jid 1

sqoop:000> submission status --jid 1

Submission details

Job id: 1

Status: RUNNING

Creation date: 2012-12-23 13:21:45 PST

Last update date: 2012-12-23 13:21:56 PST

External Id: job_1353136146286_0005

       http://hadoop.cluster.com:8088/proxy/application_1353136146286_0004/

Progress: 0.00 %

 

更新job

Update job –jid 2

 

9 停止job

sqoop:000> submission stop --jid 1

Submission details

Job id: 1

Status: FAILED

Creation date: 2012-12-23 13:22:39 PST

Last update date: 2012-12-23 13:22:42 PST

External Id: job_1353136146286_0006

       http://hadoop.cluster.com:8088/proxy/application_1353136146286_0004/

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值