Oozie : Trigger Oozie workflow via RestAPI calls

It is also possible to execute the Oozie workflow using Rest API. It helps us to run it from any machine which doesnt have oozie client installed.

Create an xml file – oozie-testxml.xml – in the local of your Unix machine.

$ cat oozie-testxml.xml

user.name baseDir${nameNode}/user/ oozie.wf.application.path${baseDir}/ queueNamedefault nameNodehdfs://:8020 jobTracker:8021oozie.libpath

Execute the workflow using the command

curl -X POST -H “Content-Type: application/xml” -d @oozie-testxml.xml “http://:11000/oozie/v2/jobs?action=start”

There is an easy way to get the xml file mentioned above. Set the following property.

export OOZIE_DEBUG=1

Then execute the workflow using the normal oozie command

oozie job -oozie http://:11000/oozie -config localjob.properties -run

This would print the xml required to execute the workflow.

Advertisements

About shalishvj : My Experience with BigData

6+ years of experience using Bigdata technologies in Architect, Developer and Administrator roles for various clients. • Experience using Hortonworks, Cloudera, AWS distributions. • Cloudera Certified Developer for Hadoop. • Cloudera Certified Administrator for Hadoop. • Spark Certification from Big Data Spark Foundations. • SCJP, OCWCD. • Experience in setting up Hadoop clusters in PROD, DR, UAT , DEV environments.
This entry was posted in oozie. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s