问题
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 ooziejob/jobs
: APIlen
: 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