Mike
Mike

Reputation: 735

How to load arguments from a xml in oozie workflow

I want to load properties from a xml properties file for a oozie job. The file can be specified by -conf argument. Where should the file be placed so that oozie can pick up the properties file when the job starts.

<action name="start">
  <java>
     <main-class>com.oozieexample.Main</main-class>
     <arg>-conf</arg>
     <arg>run_configs.xml</arg>
     .....
     ....

In this example http://www.infoq.com/articles/oozieexample, action.xml file specified as argument file but location is not specified. What is the default location oozie looks for properties and how to give custom location. The workflow will be running from HDFS location.

Upvotes: 1

Views: 994

Answers (1)

Samson Scharfrichter
Samson Scharfrichter

Reputation: 9067

  1. upload your props file to an HDFS directory somewhere
  2. tell Oozie to download the file into the YARN container used for execution with <file>/some/hdfs/dir/run_configs.xml<file>
  3. your Java Action will find run_configs.xml in its current working directory

And now, pleeeeeeease, spend some time reading a tutorial about Oozie such as this one (a bit old but covers a lot of ground).

Upvotes: 1

Related Questions