我正在尝试运行一个简单的Oozie作业,以使用Sqoop从本地MySQL数据库中提取数据。下面是我的workflow.xml:

<workflow-app name="sqoopoozietest" xmlns="uri:oozie:workflow:0.1">
<start to="sqoopconnect"/>
<action name="sqoopconnect">
    <sqoop xmlns="uri:oozie:sqoop-action:0.2">
        <job-tracker>horton-n2.hdp.local:8050</job-tracker>
        <name-node>hdfs://horton-n1.hdp.local:8020</name-node>
        <prepare>
            <delete path="hdfs://horton-n1.hdp.local:8020/user/mannb/sqoopoozie/sqoopinput"/>
        </prepare>
        <configuration>
            <property>
                <name>mapred.compress.map.output</name>
                <value>true</value>
            </property>
        </configuration>
        <command>import  --connect jdbc:mysql://horton-n1.hdp.local/sqooptest --table sampledata --username sqoop --password sqoop123 --target-dir --driver com.mysql.jdbc.Driver hdfs://horton-n1.hdp.local:8020/user/mannb/sqoopoozie/sqoopinput -m 1</command>
    </sqoop>
    <ok to = "sqoopend"/>
    <error to = "kill"/>
</action>

   <kill name = "kill">
        <message>"Workflow failed."</message>
   </kill>

   <end name = "sqoopend" />
</workflow-app>

主要错误我从/var/log/oozie.log收到错误:

javax.servlet.jsp.el.E​​LException:函数“wf:errorMessage”需要1个参数,但已传递0

我以为这很奇怪,因为我在kill名称消息中传递了一个参数:“工作流失败。”。

以下是我的job.properties文件:
nameNode=hdfs://horton-n1.hdp.local:8020
jobTracker=horton-n2.hdp.local:8050

queueName=default
#oozie.use.system.libpath=true

oozie.wf.application.path=${nameNode}/user/mannb/sqoopoozie/workflow.xml

任何帮助是极大的赞赏。

最佳答案

如下更改代码。

 <error to = "kill_job"/>

 <kill name = "kill_job">
        <message>Workflow failed</message>
 </kill>

关于hadoop - Oozie Job失败了,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39813028/

10-16 21:27