is it possible to lauch some oozie workflows with only one coordinator?

我是研究僧i 提交于 2020-01-23 12:25:26

问题


I'm not sure to use the good tool for what I want.

I have a lot of workflows which can be dependent or not.

Exemple :

  1. /workflow1
    • /workflow.xml
    • /job.properties
  2. /workflow2
    • /workflow.xml
    • /job.properties
  3. ....

I thought that we can have a corrdinator which can launch (with some data conditions) all the workflow. But I begin to think that is not the good practice.

Should we have one coordinator per workflow with all the conditions of executions + one bundle who launch all the coodinator ? like that :

  1. /wf1
    • /workflow.xml
    • /job.properties
    • /coordinator.xml
  2. /wf2
    • /workflow.xml
    • /job.properties
    • /coordinator.xml
  3. /bundle.xml

OR one coordinator can launch all the workflow (they can be dependant or not) ?

  1. /wf1
    • /workflow.xml
    • /job.properties
  2. /wf2
    • /workflow.xml
    • /job.properties
  3. /coordinator.xml

回答1:


It depends. If wf1 and wf2 are logically related, have the same frequency and have common dataset dependencies, you can put them by one coordinator (and run them simultaneously or one after another). But if they aren't than it's better to put them in separate coordinators.

You can launch several workflows from one using the sub-workflow feature:

<workflow-app name="root-workflow" xmlns="uri:oozie:workflow:0.4">
    <start to="run-wf1"/>
    <action name="run-wf1">
        <sub-workflow>
            <app-path>${appPath}/wf1.xml</app-path>
            <propagate-configuration/>
        </sub-workflow>
        <ok to="run-wf2"/>
        <error to="kill"/>
    </action>
    <action name="run-wf2">
        <sub-workflow>
            <app-path>${appPath}/wf2.xml</app-path>
            <propagate-configuration/>
        </sub-workflow>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

If you'd like to run them simultaneously than use forking.



来源:https://stackoverflow.com/questions/31583408/is-it-possible-to-lauch-some-oozie-workflows-with-only-one-coordinator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!