在同一节点上执行所有oozie动作

时间:2019-07-19 17:10:20

标签: oozie oozie-workflow

我需要执行oozie工作流程来使用Java程序处理某些文件,但是在执行jar之前,我需要从HDFS中获取文件,并在处理完后将其删除。

我想出了带有3个shell动作的工作流程,它可以运行,但是在挖掘日志文件后,只有第一个shell动作起作用了,我才意识到从来没有执行过shell动作2和3。因此,除非它们在不同的节点上执行,否则没有理由它们不起作用,我会在边缘节点品尝3个shell脚本,它们就会起作用。

 <start to="shellAction"/>
<action name="shellAction">
    <shell xmlns="uri:oozie:shell-action:0.3">
        <exec>${shellCmd1}</exec>
        <file>${shellCmd1}#${shellCmd1}</file>
    </shell>
    <ok to="shellAction2"/>
    <error to="fail" />
</action>
    <action name="shellAction2">
        <shell xmlns="uri:oozie:shell-action:0.3">
             <exec>java</exec>
             <argument>arg</argument>
             <argument>./${EXEC}:`classpath` MainClass</argument>
             <argument>"${arg1}"</argument>
             <argument>"${arg2}"</argument>
             <argument>${arg3}</argument>
             <file>${EXEC}#${EXEC}</file>
        </shell>
        <ok to="shellAction3"/>
        <error to="shellAction3" />
     </action>
     <action name="shellAction3">
            <shell xmlns="uri:oozie:shell-action:0.3">
            <exec>${shellCmd3}</exec>
            <file>${shellCmd3}#${shellCmd3}</file>
     </shell>
       <ok to="end"/>
       <error to="fail" />
     </action>

所以我的问题是,有没有办法保证在同一容器/节点上执行这3个操作?

0 个答案:

没有答案