Oozie bundle定时调度多job
2017-07-06 10:09
246 查看
包含关系
实例
workflow1xml
workflow2xml
coordinator1xml
coordinator2xml
bundlexml
jobproperties
action∈workflow∈coordinatorㄈbundle
就是workflow可以包含多可action,通过coordinator来定时调度workflow,通过bundle来绑定多个coordinator
实例
workflow1xml
workflow2xml
coordinator1xml
coordinator2xml
bundlexml
jobproperties
包含关系
几个包含关系:action∈workflow∈coordinatorㄈbundle
就是workflow可以包含多可action,通过coordinator来定时调度workflow,通过bundle来绑定多个coordinator
实例
workflow1.xml
<workflow-app xmlns="uri:oozie:workflow:0.4" 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>echo</exec> <argument>xx="=======111111...======="</argument> <capture-output/> </shell> <ok to="second"/> <error to="fail"/> </action> <action name="second"> <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>echo</exec> <argument>xx="=======second...======="</argument> <capture-output/> </shell> <ok to="third"/> <error to="fail"/> </action> <action name="third"> <app-path>${workflowAppUri3}</app-path> </action> <kill name="fail"> <message>Shell action failed, error message</message> </kill> <end name="end"/> </workflow-app>
workflow2.xml
<workflow-app xmlns="uri:oozie:workflow:0.4" 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>echo</exec> <argument>xx="=======222222...======="</argument> <capture-output/> </shell> <ok to="end"/> <error to="fail"/> </action> <kill name="fail"> <message>Shell action failed, error message</message> </kill> <end name="end"/> </workflow-app>
coordinator1.xml
<coordinator-app name="cron-coord1" frequency="${coord:minutes(5)}" start="${start}" end="${end}" timezone="UTC" xmlns="uri:oozie:coordinator:0.2"> <action> <workflow> <app-path>${workflowAppUri1}</app-path> <configuration> <property> <name>jobTracker</name> <value>${jobTracker}</value> </property> <property> <name>nameNode</name> <value>${nameNode}</value> </property> <property> <name>queueName</name> <value>${queueName}</value> </property> </configuration> </workflow> </action> </coordinator-app>
coordinator2.xml
<coordinator-app name="cron-coord2" frequency="${coord:minutes(7)}" start="${start}" end="${end}" timezone="UTC" xmlns="uri:oozie:coordinator:0.2"> <action> <workflow> <app-path>${workflowAppUri2}</app-path> <configuration> <property> <name>jobTracker</name> <value>${jobTracker}</value> </property> <property> <name>nameNode</name> <value>${nameNode}</value> </property> <property> <name>queueName</name> <value>${queueName}</value> </property> </configuration> </workflow> </action> </coordinator-app>
bundle.xml
<bundle-app name='bundle-app' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='uri:oozie:bundle:0.1'> <coordinator name='cron-coord1'> <app-path>${coordinator1}</app-path> </coordinator> <coordinator name='cron-coord2'> <app-path>${coordinator2}</app-path> </coordinator> </bundle-app>
job.properties
nameNode=hdfs://nameservice1 jobTracker=cm:8032 queueName=default examplesRoot=examples oozie.libpath=${nameNode}/user/${user.name}/share/lib # 定时任务设置 # 设置bundle路径 oozie.bundle.application.path=${nameNode}/user/${user.name}/shell/bundle.xml start=2017-06-30T08:56Z end=2017-06-30T09:20Z # 定义workflow路径 workflowAppUri2=${nameNode}/user/${user.name}/shell/workflow2.xml workflowAppUri1=${nameNode}/user/${user.name}/shell/workflow1.xml # 定义coordinator coordinator1=${nameNode}/user/${user.name}/shell/coordinator1.xml coordinator2=${nameNode}/user/${user.name}/shell/coordinator2.xml
相关文章推荐
- 使用oozie实现spark定时调度和spark依赖
- elastic-job替换掉原来的spring+quartz的定时任务调度
- Java定时任务调度工具详解(4)— Quartz 之 Job/JobDetail/JobExecutionContext/JobDataMap
- Oracle Job定时调度
- java中quartz 调度在一些定时任务(job)的入门级应用
- oozie调度sqoop Job 数据库密码无法保存
- Play 1.x框架学习之四:定时作业调度 (job scheduler In play framework)
- PL/SQL DEVELOPER ORACLE创建定时调度job
- #研发中间件介绍#定时任务调度与管理JobCenter - 旁观者 - 博客园
- [译]Java定时任务调度-Quartz文档(七)TriggerListeners and JobListeners
- Oracle定时调度(schedule和job结合)
- [译]Java定时任务调度-Quartz文档(二)Quartz API、Job & Scheduler
- Spring使用Quartz定时调度Job无法Autowired注入Service的解决方案
- Spring使用Quartz定时调度Job无法Autowired注入Service的解决方案
- datastage tips 二:使用crontab+shell定时调度datastage job
- SpringBoot整合Quartz定时任务 系统job Spring Boot教程 调度任务
- Spark job在hue-oozie中的另一种方式调度
- [译]Java定时任务调度-Quartz文档(三)进一步讲讲Job和Job Detail
- 任务调度框架Quartz(二) 使用job、trigger、schedule调用定时任务
- Java定时任务调度工具详解之Quartz篇(中级)一:浅谈JobExecutionContext&JobDatai&浅谈Trigger