workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.4" name="shell-wf"> <start to="shell-node"/> <action name="shell-node"> <shell xmlns="uri:oozie:shell-action:0.2"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <configuration> <property> <name>mapred.job.queue.name</name> <value>${queueName}</value> </property> </configuration> <exec>t.sh</exec> <argument>/dp/bin/test.sh</argument> <file>t.sh</file> <!--Copy the executable to compute node's current working directory --> <capture-output/> </shell> <ok to="end"/> <error to="fail"/> </action> <kill name="fail"> <message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> </kill> <end name="end"/> </workflow-app>
job.properties
nameNode=hdfs://oozie jobTracker=master1:8032 queueName=default exampleRoot=example oozie.wf.application.path=${nameNode}/user/${user.name}/${exampleRoot}/apps/shell/test
a.sh
ssh hadoop@master2 ${1}