Passing arguments to Oozie workflows 3


Deciding How to Pass Arguments to Oozie Jobs
So far, you have learned about several ways to pass parameters to an Oozie job. To help you decide
which approach to use, you should first understand how Oozie uses parameters:

  • Oozie uses parameters explicitly defined inside an action’s <arg> tag.
  • If any of the parameters cannot be resolved there, Oozie uses parameters defined in the file
    specified inside the <job-xml> tag.
  • If any of the parameters cannot be resolved there, Oozie uses parameters defined inside the
    <configuration> tag.
  • If any of the parameters cannot be resolved there, Oozie uses parameters from the
    command-line invocation.
  • If any of the parameters cannot be resolved there, Oozie uses parameters from a job
    property file.
  • Once everything else fails, Oozie tries to use config-default.xml .

Arguments to Oozie workflows

user@tri03ws-386:~$ oozie job -oozie http://localhost:11000/oozie -D nameNode=hdfs://localhost:9000 -D jobTracker=localhost:8032 -config $OOZIE_HOME/examples/apps/map-reduce/job.properties -run

user@tri03ws-386:~$ export nameNode=hdfs://localhost:9000

user@tri03ws-386:~$ export jobTracker=localhost:8032

user@tri03ws-386:~$ echo $nameNode

hdfs://localhost:9000

user@tri03ws-386:~$ echo ${nameNode}

hdfs://localhost:9000

user@tri03ws-386:~$ oozie job -oozie http://localhost:11000/oozie -config $OOZIE_HOME/examples/apps/map-reduce/job.properties -run -D nameNode=${nameNode} -D jobTracker=${jobTracker}

job: 0000004-150401113103094-oozie-user-W

Additional Oozie Commands:

1) Submit job:
$ oozie job -oozie http://localhost:11000/oozie -config examples/apps/map-reduce/job.properties -submit
job: 0000012-130712212133144-oozie-oozi-W
2) Run job:
$ oozie job -oozie http://localhost:11000/oozie -start 0000014-130712212133144-oozie-oozi-W
3) Check the status:
$ oozie job -oozie http://localhost:11000/oozie -info 0000014-130712212133144-oozie-oozi-W
4) Suspend workflow:
$ oozie job -oozie http://localhost:11000/oozie -suspend 0000014-130712212133144-oozie-oozi-W
5) Resume workflow:
$ oozie job -oozie http://localhost:11000/oozie -resume 0000014-130712212133144-oozie-oozi-W
6) Re-run workflow:
$ oozie job -oozie http://localhost:11000/oozie-config examples/apps/map-reduce/job.properties -rerun 0000014-130712212133144-oozie-oozi-W
7) Should you need to kill the job:
$ oozie job -oozie http://localhost:11000/oozie -kill 0000014-130712212133144-oozie-oozi-W
8) View server logs:
$ oozie job -oozie http://localhost:11000/oozie -logs 0000014-130712212133144-oozie-oozi-W
Logs are available at:
/var/log/oozie on the Oozie server.

Profile photo of Siva

About Siva

Senior Hadoop developer with 4 years of experience in designing and architecture solutions for the Big Data domain and has been involved with several complex engagements. Technical strengths include Hadoop, YARN, Mapreduce, Hive, Sqoop, Flume, Pig, HBase, Phoenix, Oozie, Falcon, Kafka, Storm, Spark, MySQL and Java.


Leave a comment

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

3 thoughts on “Passing arguments to Oozie workflows


Review Comments
default image

I am a plsql developer. Intrested to move into bigdata.

Neetika Singh ITA Hadoop in Dec/2016 December 22, 2016

.