在 HUE 的 作业设计器中 运行sqoop 作业,调用命令:
sqoop import --connect jdbc:mysql://localhost:3306/test --username root --password mysql-password --table t1 --hive-import
时报错,错误如下:
33782 [main] INFO org.apache.sqoop.hive.HiveImport - Loading uploaded data into Hive Intercepting System.exit(1) <<< Invocation of Main class completed <<< Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1] Oozie Launcher failed, finishing Hadoop job gracefully Oozie Launcher, uploading action data to HDFS sequence file: hdfs://rhel072:8020/user/admin/oozie-oozi/0000003-141029091352918-oozie-oozi-W/mysqlTableData2hive--sqoop/action-data.seq Oozie Launcher ends
分析发现 数据再导入hdfs的时候成功了,但是在往 hive 写数据的时候中断了,这里找到的解决办法如下
- Hive metastore service is not running. It should be running in remote mode and a separate service should be started. Here's a quick way to check if its running:
service hive-metastore status
- hive-site.xml does not contain hive.metastore.uris. Here's an example hive-site.xml with hive.metastore.uris set:
<configuration>
...
<property>
<name>hive.metastore.uris</name>
<value>thrift://sqoop2.example.com:9083</value>
</property>
...
</configuration>
-
- hive-site.xml is not included in your Sqoop action (or its properties). Try adding your hive-site.xml to a <file> element in your Sqoop action. Here's an example workflow.xml with <file>in it:
<workflow-app name="sqoop-to-hive" xmlns="uri:oozie:workflow:0.4"> ... <action name="sqoop2hive"> ... <sqoop xmlns="uri:oozie:sqoop-action:0.2"> ... <file>/tmp/hive-site.xml#hive-site.xml</file> </sqoop> ... </action> ... </workflow-app>