Report of oozie jobs

ⅰ亾dé卋堺 提交于 2019-12-10 12:15:44

问题


How can we get status of Oozie jobs running daily? We have many jobs running in Oozie coordinator and currently we are monitoring through Hue/Oozie browser.

Is there any way we can get a single log file which contains coordinator name/workflow name with date and status? Can we write any program or script to achieve this?


回答1:


Command to get status of all running oozie coordinators

oozie jobs -jobtype coordinator -filter status=RUNNING -len 1000 -oozie http://localhost:11000/oozie 

Command to get status of all running oozie workflows

oozie jobs -filter status=RUNNING -len 1000 -oozie http://localhost:11000/oozie 

Command to get status of all workflows for a specific coordinator ID

oozie job -info COORDINATOR_ID_HERE

Based on these queries you can write required scripts to get what you want.

Terms explanation:

  • oozie : Command to initiate oozie
  • job/jobs : API
  • len: No. of oozie workflows/coordinators to display
  • -oozie: Param to specify oozie url
  • -filter : Param to specify list of filters.

Complete documentation https://oozie.apache.org/docs/3.1.3-incubating/DG_CommandLineTool.html




回答2:


You use the below command and put it into a script to run it daily/cron.

oozie jobs -oozie http://localhost:11000/oozie -filter status=RUNNING -len 2
oozie jobs -oozie http://localhost:11000/oozie -filter startCreatedTime=2016-06-28T00:00Z\;endcreatedtime=2016-06-28T10:00Z -len 2

Basically you are using oozie's jobs api and -filter command to get the information about workflow/coordinator/bundle. The -filter command supports couple of options to get the data based on status/startCreatedTime/name.

By default, it will bring the workflow record information, if you want to get the coordinator/bindle information. You can use the -jobtype parameter and value as coord/bundle.

Let me know if you need anything specifically. The oozie doc is little outdated for this feature.




回答3:


Below command worked for me.

oozie jobs -oozie http://xx.xxx.xx.xx:11000/oozie -jobtype wf -len 300 | grep 2016-07-01 > OozieJobsStatus_20160701.txt

However we need to parse the file.



来源:https://stackoverflow.com/questions/38120983/report-of-oozie-jobs

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