Support Questions

Find answers, ask questions, and share your expertise

How to get job status notifications from oozie?

Explorer

In an application, oozie jobs get submitted to be executed on the cluster.

We want to track when the job starts, runs and completes so that the application is updated.

Oozie provides a way to send the job status via a property called ‘oozie.wf.workflow.notification.url’ which can be configured in the workflow.xml.

Oozie sends a GET request to whatever the url they configure it to. However, it doesn’t seem to be generating these notifications.

Does anything else need to be configured on the Oozie side in addition to the above modification to the workflow.xml? Does anything need to be set elsewhere?

Here is what the workflow.xml looks like:

<workflow-app xmlns="uri:oozie:workflow:0.4" name="ingest-tblrig-wf">
   <start to="run-ingest-script" />
   <action name="run-ingest-script">
      <shell xmlns="uri:oozie:shell-action:0.2">
         <job-tracker>${jobTracker}</job-tracker>
         <name-node>${nameNode}</name-node>
         <configuration>
            <property>
               <name>mapred.job.queue.name</name>
               <value>${queueName}</value>
            </property>
            <property>
               <name>mapred.job.user.name</name>
               <value>${jobUserName}</value>
            </property>
            <property>
               <name>oozie.wf.workflow.notification.url</name>
               <value>http://server_name:8080/oozieNotification/jobUpdate?jobId=$jobId%26status=$status</value>
            </property>
         </configuration>
         <exec>ingest_script_invoker.sh</exec>
         <env-var>HADOOP_USER_NAME=DKari</env-var>
         <file>ingest_script_invoker.sh</file>
         <file>ingest_tblRig.sh</file>
         <file>test_expect.sh</file>
         <capture-output />
      </shell>
      <ok to="end" />
      <error to="fail" />
   </action>
   <kill name="fail">
      <message>Workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
   </kill>
   <end name="end" />
</workflow-app>
1 ACCEPTED SOLUTION

I think you've set the value in the wrong place. Try adding the value to your job.properties file and try again.

In this case, you embedded it in an action, when I believe it's meant to be a job level variable.

View solution in original post

3 REPLIES 3

I think you've set the value in the wrong place. Try adding the value to your job.properties file and try again.

In this case, you embedded it in an action, when I believe it's meant to be a job level variable.

Mentor

If the oozie.wf.workflow.notification.url property is present in the workflow job properties when submitting the job, Oozie will make a notification to the provided URL when the workflow job changes its status.

If the URL contains any of the following tokens, they will be replaced with the actual values by Oozie before making the notification:

  • $jobId : The workflow job ID
  • $status : the workflow current state

New Contributor

@dstreever , I am using this oozie.wf.workflow.notification.url property but I am facing an issue :

https://myknoxurl:8443/gateway/default/myproject/services/job/?user.name=tejwinder_singh

I am using knox to connect to remote tomcat (which will capture oozie's statuses)

How do I add my password to the URL ? Or Is there a better solution to do this via Knox ?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.