Database Reference
In-Depth Information
For example, ${wf:user()} returns the name of the user who started the current work-
flow job, and we use it to specify the correct filesystem path. The Oozie specification lists
all the EL functions that Oozie supports.
Packaging and deploying an Oozie workflow application
A workflow application is made up of the workflow definition plus all the associated re-
sources (such as MapReduce JAR files, Pig scripts, and so on) needed to run it. Applica-
tions must adhere to a simple directory structure, and are deployed to HDFS so that they
can be accessed by Oozie. For this workflow application, we'll put all of the files in a base
directory called max-temp-workflow , as shown diagrammatically here:
max-temp-workflow/
├── lib/
│ └── hadoop-examples.jar
└── workflow.xml
The workflow definition file workflow.xml must appear in the top level of this directory.
JAR files containing the application's MapReduce classes are placed in the lib directory.
Workflow applications that conform to this layout can be built with any suitable build
tool, such as Ant or Maven; you can find an example in the code that accompanies this
book. Once an application has been built, it should be copied to HDFS using regular Ha-
doop tools. Here is the appropriate command for this application:
% hadoop fs -put hadoop-examples/target/max-temp-workflow
max-temp-workflow
Running an Oozie workflow job
Next, let's see how to run a workflow job for the application we just uploaded. For this we
use the oozie command-line tool, a client program for communicating with an Oozie serv-
er. For convenience, we export the OOZIE_URL environment variable to tell the oozie
command which Oozie server to use (here we're using one running locally):
% export OOZIE_URL="http://localhost:11000/oozie"
There are lots of subcommands for the oozie tool (type oozie help to get a list), but
we're going to call the job subcommand with the -run option to run the workflow job:
% oozie job -config ch06-mr-dev/src/main/resources/
max-temp-workflow.properties \
-run
job: 0000001-140911033236814-oozie-oozi-W
Search WWH ::




Custom Search