Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to direct Oozie to kill all jobs?

Tags:

oozie

I have tried

oozie job -oozie http://sandbox.hortonworks.com:11000/oozie -config ./job.properties -kill *

...to no effect. I have done a few Google searches and checked Oozie's documentation, and there does not appear to be a command for this.

Would any one know of a way to accomplish this?

like image 844
Ego Avatar asked Dec 14 '22 19:12

Ego


2 Answers

It seems that the recent versions of oozie (tested on 4.2) have made this a lot easier.

Here is a oneliner that I now use to kill all jobs that I created.

oozie jobs -oozie  http://myserver:11000/oozie -kill -filter user=dennis -jobtype bundle & oozie jobs -oozie  http://myserver:11000/oozie -kill -filter user=dennis -jobtype coordinator & oozie jobs -oozie  http://myserver:11000/oozie -kill -filter user=dennis

First it kills all bundles, then it kills all coordinators and finally all workflows. Note that I set a filter to my own username, as it appears to be mandatory to have a filter set.


Update: As mentioned in the comments by @Nutle:

Worth noting that (on 4.3 and win7 x64) the suggested command returned a syntax error, solved by enclosing the filter terms in quotes, i.e. oozie jobs <...> -kill -filter "user=dennis"

like image 157
Dennis Jaheruddin Avatar answered May 15 '23 01:05

Dennis Jaheruddin


To my knowledge there is no such command.

Try a shell script that lists the jobs (sadly, workflow jobs, coordinators and bundles should be listed separately), then greps the captions and fancy formatting out, cuts the job id and kills them one by one.

like image 41
patrungel Avatar answered May 14 '23 23:05

patrungel