Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
Labels (2)
avatar
Master Mentor

Part 1: https://community.hortonworks.com/articles/82964/getting-started-with-apache-ambari-workflow-design....

Part 2: https://community.hortonworks.com/articles/82967/apache-ambari-workflow-designer-view-for-apache-oo....

Part 3: https://community.hortonworks.com/articles/82988/apache-ambari-workflow-designer-view-for-apache-oo-...

Part 4: https://community.hortonworks.com/articles/83051/apache-ambari-workflow-designer-view-for-apache-oo-...

Part 5: https://community.hortonworks.com/articles/83361/apache-ambari-workflow-manager-view-for-apache-ooz....

Part 6: https://community.hortonworks.com/articles/83787/apache-ambari-workflow-manager-view-for-apache-ooz-...

Part 7: https://community.hortonworks.com/articles/84071/apache-ambari-workflow-manager-view-for-apache-ooz-...

Part 8: https://community.hortonworks.com/articles/84394/apache-ambari-workflow-manager-view-for-apache-ooz-...

Part 9: https://community.hortonworks.com/articles/85091/apache-ambari-workflow-manager-view-for-apache-ooz-...

Part 11: https://community.hortonworks.com/articles/85361/apache-ambari-workflow-manager-view-for-apache-ooz-...

Part 12: https://community.hortonworks.com/articles/131389/apache-ambari-workflow-manager-view-for-apache-ooz...

In this tutorial, I will cover how to create Oozie coordinators via Workflow Manager View. I'm also going to leverage Publish/Import Asset functionality demonstrated in my last tutorial only now using local database rather than HDFS.

We're going to publish the two actions nodes from part 9 (shell action doing echo and email action) using the next to last icon when you click on the action node.

12911-01-local-publish.png

So just like I did in part 9 to publish an asset to HDFS, same steps except there's no HDFS path.

You're greeted with dialog to give asset a name and description.

12912-02-give-asset-name-desc.png

I already published shell action to assets database in the same manner. I'd like to glance at what assets I have in my local Ambari Views instance. To do that, I'm going to click on manage assets button in the top right hand corner.

12913-03-manage-local-assets.png

You're going to see a list of any saved assets so far. In the same manner, you can delete assets by hitting red trash icon to the right of them.

12914-04-view-assets-in-manager.png

Asset manager also allows you to search through all saved assets.

12916-05-search-local-assets.png

Keep in mind that local asset database is exactly that, local, it is not being shared across instances of Ambai Views nodes. For that, please use publish/import from HDFS functionality just like in part 9.

We're ready to tie it all together, we're going to create a new workflow, name it part-10, then begin to add new nodes, though now instead of adding pre-existing nodes, we're going to click on import asset

12917-06-import-1st-asset.png

You'll get a pop-up to select an asset from asset manager. Click on it and hit import.

12919-09-select-asset-to-import-2.png

Now we're ready to import 2nd asset

12921-08-import-2nd-asset.png

Select the asset and import it.

12922-07-import-shell-action.png

Your workflow should look like so

12923-10-finished-wf.png

I gave the action nodes more meaningful names. We pretty much built this wf from the wf in part 9 using publish/import assets. We can now submit the job. (The path mistakenly points to /user/centos/email, I then submitted this workflow and saved path to /user/centos/part-10).

12924-11-submit-wf.png

Great, now we know it works, we're ready to create a coordinator workflow.

On the WFM page, in the right top hand corner, find create button and select coordinator.

12925-12-create-coord.png

You'll be prompted to fill out the details.

12926-13-fill-out-coord.png

This beats working with XML as all I need to do is fill out 5 fields and I have a working coordinator for an existing workflow, by clicking the button next to the browse, you get an option to create a brand new workflow, since we already have one, we're going to enter the path of the existing one. I'm ready to submit the coordinator.

12928-15-submit-coord.png

I prefer to save coordinator and workflow in the same directory, though my screenshots do not show that, I chose /user/centos/part-10 as the HDFS path for both workflow and coordinator in my recent work. This is what my directory looks like

hdfs dfs -ls part-10
Found 2 items
-rw-r--r--   3 centos hdfs        364 2017-02-23 17:58 part-10/coordinator.xml
-rw-r--r--   3 centos hdfs        971 2017-02-23 17:09 part-10/workflow.xml

Let's preview coordinator XML.

12929-14-preview-xml.png

Ignore the app-path in my XML, I have two one in /user/centos/email and another one in /user/centos/part-10. I grabbed the wrong screenshot :).

Let's look at our coordinator running and this will allow me to demonstrate some more cool features of WFM like chaining of search tags.

Let's click on dashboard button and see our workflow in action, notice the clock icon to the left of it to identify it as part of a coordinator.

12930-17-dashboard-coord-has-clock.png

This still shows workflows, if you click on the left of the page where workflow drop down is and select coordinator instead, you can see only coordinators.

12931-18-dashboard-filter-by-coord.png

It makes it easy to filter out coordinators from workflows and as you see soon bundles by toggling the drop down to select the type of job you're looking for. Here's an example of what a coordinator triggered every 5min will do to your dashboard.

12932-19-dashboard-many-wfs.png

Another cool feature in the dashboard is multi-tag search. In Oozie UI, you can click on name and it will sort ASC/DESC, here we can filter out using pre-defined tags instead to narrow down output to what's relevant.

12933-20-sort-by-name.png

Notice I added name filter. What if I also want to filter by status:SUCCEEDED and not just name of wf?

12934-21-sort-by-name-status.png

I can also add more tags, now I want to also filter out only running workflows.

12935-22-sort-by-name-status-running.png

Now I want to also filter by user name

12938-24-three-sorts.png

The other available options are below

12937-23-more-sort-options.png

Finally, since my coordinator is configured to execute a workflow called part-10 every 5min, I'm getting a lot of emails every time it runs and succeeds. I want to kill the coordinator. I can do it directly from the dashboard. To the right of the running coordinator, I have an option to kill highlighted in red, click that.

12939-25-kill-coord.png

once clicked, coordinator goes into Killed stated.

12940-26-after-kill.png


32-fill-out-bundle.png23-more-sort-options.png33-add-coord-to-bundle.png31-fill-out-bundle.png30-create-bundle.png
3,272 Views