<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.5" name="shell-wf">
<start to="fork_node" />
<fork name = "fork_node">
<path start = "query1"/>
<path start = "query2"/>
</fork>
<action name="query1">
<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>oozie.sh</exec>
<file>oozie.sh#oozie.sh</file>
<capture-output />
</shell>
<ok to="join_node" />
<error to="postgre"/>
</action>
<action name="query2">
<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>oozie2.sh</exec>
<file>oozie2.sh#oozie2.sh</file>
<capture-output />
</shell>
<ok to="join_node" />
<error to="postgre" />
</action>
<join name = "join_node" to = "postgre"/>
<action name="postgre">
<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>oozie3.sh</exec>
<file>oozie3.sh#oozie3.sh</file>
<capture-output />
</shell>
<ok to="decesion-node" />
<error to="fail" />
</action>
<decision name="decesion-node">
<switch>
<case to="end">
${wf:lastErrorNode()} eq ""
</case>
<default to="fail"/>
</switch>
</decision>
<kill name="fail">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())} ]</message>
</kill>
<end name="end" />
</workflow-app>
尝试运行上述 workflow.xml 时出现以下错误 从节点 [decesion-node] 到节点 [end] 的无效转换 - 在 Fork/Join 中不允许使用“end”类型的节点
我的用例是始终转换到无论作业是被杀死还是成功,postgre 操作一旦执行 postre 操作,如果任何操作失败,它应该去杀死节点,否则到结束节点。