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/