Monitor and get alerts for your workflows with the Oozie SLAs

Monitor and get alerts for your workflows with the Oozie SLAs

Hue now makes Oozie SLAs easy to use! With SLAs, you can automatically be alerted when some workflows are not done within a certain window of time. Oozie SLAs have been improved a lot in Oozie 4, hence this new feature requires Oozie 4.x.

SLAs can be setup in the Editor in the advanced tabs of:

  • Workflow properties

  • Workflow action properties

  • Coordinator properties

SLAs can be visualized In the Dashboard:

  • New main SLA tab for searching and graphing

  • Individual SLA tab for single workflow or coordinator

We do not cover setup of JMS notifications here. JMS enables clients to be alerted in real time of the notifications (instead of pooling like in this tutorial). With Hue, you can visualize the success of your job in a timelime and setup email-notification in case of alerts.

As usual feel free to comment on the hue-user list or @gethue!

Note
How to enable SLA in Oozie itself?

First make sure you are using Oozie 4. If you need to upgrade from Oozie 3, don’t forget to update the Oozie sharelib with:

sudo -u oozie /usr/lib/oozie/bin/oozie-setup.sh sharelib create -fs hdfs://localhost:8020 -locallib /usr/lib/oozie/oozie-sharelib-yarn.tar.gz

If for some reason you need to reset the Oozie DB, delete it and recreate it with:

sudo -u oozie /usr/lib/oozie/bin/ooziedb.sh create -sqlfile oozie.sql -run

Note
In order to avoid the exception below, you should not have the SLA properties in oozie-site.xml.

Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)

Then open oozie-site.xml and add these properties and restart Oozie:

<property>
  <name>oozie.services.ext</name>
  <value>
    org.apache.oozie.service.EventHandlerService,
    org.apache.oozie.sla.service.SLAService
  </value>
</property>
<property>
  <name>oozie.service.EventHandlerService.event.listeners</name>
  <value>
    org.apache.oozie.sla.listener.SLAJobEventListener,
    org.apache.oozie.sla.listener.SLAEmailEventListener
  </value>
</property>

13 Comments

  1. David Burke 4 years ago

    Could you clarify: “We do not cover setup of JMS notifications here. JMS enables clients to be alerted in real time of the notifications (instead of pooling like in this tutorial). With Hue, you can visualize the success of your job in a timelime and setup email-notification in case of alerts.”

    What I need to know is: do I need to setup JMS notifications in order for the email-notification to work? Or is it just sufficient to enter the email adress in Hue? Is there any other configuration needed for emails, e.g. set up of SMPT server details in cloudera manager etc?

    • Hue Team 4 years ago
      • David Burke 4 years ago

        Here is a clarified answer.
        JMS is NOT needed, only the configurations of oozie.services.ext and oozie.service.EventHandlerService.event.listeners mentioned above.

        The oozie.services.ext configuration is exposed in cloudera manager.
        The oozie.service.EventHandlerService.event.listeners configuration should be added as an xml snippet in the Oozie ‘safety valve’ configuration property in cloudera manager.

  2. Dr.Rizz 3 years ago

    Hue, Oozie and SLA combination is very promising for us as it saves us effort in developing a custom GUI and SLA solution to monitor if Oozie SLAs are met.

    I enabled SLA with the instructions provided [1]. Restarted my Oozie service. I extend the simple workflow [2] with sla enhancement [3] and submit the workflow using command line.

    -bash-4.1$ oozie job -oozie http://:11000/oozie -config examples/apps/map-reduce/job.properties -run
    Error: E0803 : E0803: IO error, E1004: Expression language evaluation error, Validation error :variable [nominal_time] cannot be resolved

    Oozie server build version: 4.1.0-cdh5.5.2
    Hue™ 3.9.0

    Any input is appreciated!

    [1] http://gethue.com/hadoop-tutorial-monitor-and-get-alerts-for-your-workflows-with-the-oozie-slas/
    [2] https://oozie.apache.org/docs/3.1.3-incubating/DG_Examples.html
    [3] https://oozie.apache.org/docs/4.0.0/DG_SLAMonitoring.html

    • Hue Team 3 years ago

      Not sure if there is Hue involved in the question but ‘nominal_time’ needs to be specified in your job.properties

  3. Miles Y. 3 years ago

    Thanks – Can you also explain the “Upstream Apps” property? I am hoping to implement dependency with it, but can’t find usage documented anywhere (incl. official Oozie documentation page).

    • Hue Team 3 years ago

      Where do we talk about this? 🙂

  4. Miles Y. 3 years ago

    Also, the video glossed over a minor issue – Romain’s WF failed b/c Hue used local time for $nominal_time, which expects UTC. I ran into this same issue when I tested, and had to manually change the nominal time when submitting the workflow. Is this what we have to do until the next Hue release? (we are running 3.9 as part of CDH 5.6.0).

    Thanks!

    • Hue Team 3 years ago

      Yes, then the timezone is picked from the user browser instead in the next version

  5. venugopal 2 years ago

    Hi Team,

    I am working on oozie services using HUE to connect to hive but iam unable to work when i am running the script it is throwing an error “java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient” , could you please look and revert me as soon as yo can please.

    • Hue Team 2 years ago

      Hi, which version of Hue are you using? How did you configure all the other Hadoop components? Does Hive (query editor) work normally?

  6. Srinivas 2 years ago

    Hi , How do we configure SLA from workflow.xml file in oozie , we are using CDH 5.8.2 with oozie 4.1.0 , Can you please specify the configuration are required to trigger SLA from workflow.xml file

    • Author
      Hue Team 2 years ago

      Each workflow has a ‘Setting’ menu with ‘SLA’ and each workflow action has a little ‘SLA’ tab with a checkbutton like in the video.

Leave a reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.