1

我们已在 Oozie 工作流作业下方提交。它在 Windows 集群中执行,但在 Linux 中失败。

<workflow-app xmlns='uri:oozie:workflow:0.3' name='shell-wf'>
    <start to='shell1' />
    <action name='shell1'>
        <shell xmlns="uri:oozie:shell-action:0.1">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <configuration>
                <property>
                  <name>mapred.job.queue.name</name>
                  <value>${queueName}</value>
                </property>
            </configuration>
            <exec>Java</exec>
            <argument>A</argument>
            <argument>B</argument>
            <file>${EXEC}#${EXEC}</file> <!--Copy the executable to compute node's current working directory -->
        </shell>
        <ok to="end" />
        <error to="fail" />
    </action>
    <kill name="fail">
        <message>Script failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name='end' />
</workflow-app>   

但是当我执行上述工作流文件时,它抛出的异常无法运行java程序。没有这样的文件或目录

4

1 回答 1

0

如果 shell 脚本有 shell 操作,并且 shell 脚本中的任何命令失败,则必须在 shell 脚本中添加该行#!/bin/bash -e以捕获转换的失败代码。然后它将被捕获在输出中,并且只会杀死您的工作流程。否则,即使 shell 操作可能失败,它也会成功退出。

于 2018-04-17T13:36:28.857 回答