问题
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 :
- /workflow1
- /workflow.xml
- /job.properties
- /workflow2
- /workflow.xml
- /job.properties
- ....
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 :
- /wf1
- /workflow.xml
- /job.properties
- /coordinator.xml
- /wf2
- /workflow.xml
- /job.properties
- /coordinator.xml
- /bundle.xml
OR one coordinator can launch all the workflow (they can be dependant or not) ?
- /wf1
- /workflow.xml
- /job.properties
- /wf2
- /workflow.xml
- /job.properties
- /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