简体   繁体   English

如何将 Oozie 工作流操作的状态标记为 OK

[英]How to mark an Oozie workflow action's status as OK

I am using Apache oozie.我正在使用 Apache oozie。 I want to mark the status of one of the shell action as OK, in my oozie workflow.我想在我的 oozie 工作流中将其中一个 shell 操作的状态标记为 OK。 It is in Running state.它处于运行状态。

Can we please share the command to use in Apache Oozie to do this.我们能否分享在 Apache Oozie 中使用的命令来执行此操作。

You don't need to explicitly set the status of an Action.您不需要显式设置操作的状态。 Oozie automatically does that for you based on the action/task execution. Oozie 根据操作/任务执行自动为您执行此操作。 For instance, let's say you have shell action that looks something like this:例如,假设您有如下所示的 shell 操作:

<workflow-app
    xmlns="uri:oozie:workflow:0.3" name="shell-wf">
    <start to="shell-node"/>
    <action name="shell-node">
        <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>some-script.sh</exec>
            <file>/user/src/some-script.sh</file>
        </shell>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

If the /user/src/some-script.sh execution is successful, Oozie will mark the action status as ok and successfully ends the job.如果/user/src/some-script.sh执行成功,Oozie 会将操作状态标记为ok并成功结束作业。 On the other hand if the script execution encounters any error, it will be marked as error immediately kill the job and directed.另一方面,如果脚本执行遇到任何错误,则会立即将其标记为error并终止作业并进行定向。 If you're looking for not to kill the job due to any abnormal execution of the code in your script, you can create another action and direct Oozie to follow that execution path instead of immediately killing the workflow.如果您希望不因脚本中代码的任何异常执行而终止作业,则可以创建另一个操作并指示 Oozie 遵循该执行路径,而不是立即终止工作流。 Checkout more about Oozie Shell Action .查看更多关于Oozie Shell Action 的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM