Hi,

I forget what version this was added, but there is a "-poll" option for the
Oozie CLI that will block until a job hits a terminal state (e.g.
SUCCEEDED, FAILED, KILLED).  It also has optional timeout and interval
options.
http://oozie.apache.org/docs/4.2.0/DG_CommandLineTool.html#Polling_an_Oozie_job

Another option is to use the Java command with the Oozie Java API, where
you'll have a lot more control over how things run.

- Robert

On Sat, Jun 20, 2015 at 1:39 PM, Kristopher Kane <[email protected]>
wrote:

> Hi,
>
> You should use Oozie REST APIs for this.  Submitting the WF via REST will
> return the WF:id in JSON, similar to how you get it back from the CLI.
>
> You can use this loop as a starting point to monitoring a running wf:
> https://github.com/kristopherkane/oozietop/blob/master/oozietop.py  - This
> was a pet project but could be extended to receive a wf id then poll Oozie
> for status completion.
>
> If Oozie is 'kerberized' and that is difficult for you to work with,
> consider using knox.apache.org in front which will allow you to use HTTP
> basic auth over SSL.
>
> Kris
>
> On Sat, Jun 20, 2015 at 5:40 AM, Bijoy Deb <[email protected]>
> wrote:
>
> > Hi,
> >
> > I have created a workflow using Oozie that comprises of multiple action
> > nodes and have been successfully able to run those via coordinator.But I
> > want to invoke the Oozie workflow via some wrapper shell script.The
> wrapper
> > script should invoke the Oozie command,wait till the oozie job
> > completes(success or error) and return back the Oozie success status code
> > (0) or the error code of the failed oozie action node(if any node of the
> > oozie workflow has failed).
> >
> > From what I have seen so far,I know that as soon as I invoke the oozie
> > command to run a workflow,the command exits with the job id getting
> printed
> > on linux console,while the oozie job keeps running asynchronously in the
> > backend.But I want my wrapper script to block till the oozie coordinator
> > job completion and return back the success/error code.
> >
> > Can you please let me know how/if I can achieve this using any of the
> oozie
> > features.
> >
> > I am using Oozie version 3.3.2 and bash shell in Linux.
> >
> > Note: In case anyone is curious about why I need such kind of feature -
> the
> > requirement is that my wrapper shell script should know how long has an
> > oozie job run for,when an oozie job has completed,and accordingly return
> > back the exit code so that the parent process that is calling the wrapper
> > script knows whether the job completed successfully or not,and if errored
> > out,raise an alert/ticket for the support team.
> >
> > Thanks,
> > Bijoy
> >
>

Reply via email to