Maison > Article > base de données > Alex的Hadoop菜鸟教程:第7课Sqoop2导出教程
承接上节课,现在说说导出教程 检查连接 先看看有没有可用的connection 连接,如果没有就要根据上节课的方法创建一个 sqoop:000 show connector --all1 connector(s) to show: Connector with id 1: Name: generic-jdbc-connector Class: org.apache.sqoop.c
承接上节课,现在说说导出教程
先看看有没有可用的connection 连接,如果没有就要根据上节课的方法创建一个
sqoop:000> show connector --all 1 connector(s) to show: Connector with id 1: Name: generic-jdbc-connector Class: org.apache.sqoop.connector.jdbc.GenericJdbcConnector Version: 1.99.3-cdh5.0.1 Supported job types: [EXPORT, IMPORT] Connection form 1:
CREATE TABLE `employee` ( `id` int(11) NOT NULL, `name` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
1,'michael'
# hdfs dfs -mkdir /user/alex # hdfs dfs -put part-m-00000 /user/alex/ # hdfs dfs -ls /user/alex Found 1 items -rw-r--r-- 2 root supergroup 20 2014-11-27 18:26 /user/alex/part-m-00000
create job --xid 1 --type export
sqoop:000> create job --xid 1 --type export Creating job for connection with id 1 Please fill following values to create new job object Name: export to employee Database configuration Schema name: Table name: employee Table SQL statement: Table column names: Stage table name: Clear stage table: Input configuration Input directory: /user/alex Throttling resources Extractors: Loaders: New job was successfully created with validation status FINE and persistent id 3执行这个任务
sqoop:000> start job --jid 3 Submission details Job ID: 3 Server URL: http://localhost:12000/sqoop/ Created by: root Creation date: 2014-11-27 18:29:27 CST Lastly updated by: root External ID: job_1406097234796_0008 http://xmseapp01:8088/proxy/application_1406097234796_0008/ 2014-11-27 18:29:27 CST: BOOTING - Progress is not available
下节课说下sqoop跟Hbase之间的通讯