运行shell脚本Oozie操作

时间:2017-08-29 23:37:27

标签: oozie oozie-workflow

我正在尝试使用Oozie在我的猪脚本之前执行shell脚本。据我所知,我正在做的事情和我能找到的每个例子都一样。我的行动是:

<action name="shell_action" cred="yca_auth">
    <shell xmlns="uri:oozie:shell-action:0.1">
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <exec>${appPath}/shell_script.sh</exec>
        <file>${appPath}/shell_script.sh#shell_script.sh</file>

        <ok to="pig_script_action"/> <error to="kill"/>
    </shell>
</action>

但我一直收到错误:

Caused by: org.apache.oozie.workflow.WorkflowException: E0701: XML schema error, cvc-complex-type.2.4.a: Invalid content was found starting with element 'ok'. One of '{"uri:oozie:shell-action:0.1":file, "uri:oozie:shell-action:0.1":archive, "uri:oozie:shell-action:0.1":capture-output}' is expected.

我不明白为什么会这样。请帮忙

2 个答案:

答案 0 :(得分:0)

问题是确定和错误不应该在

答案 1 :(得分:0)

正确的配置如下:

<action name="shell_action" cred="yca_auth">
    <shell xmlns="uri:oozie:shell-action:0.1">
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <exec>${appPath}/shell_script.sh</exec>
        <file>${appPath}/shell_script.sh#shell_script.sh</file>
    </shell>
    <ok to="pig_script_action"/> 
    <error to="kill"/>
</action>

相关问题