標籤:cat user att alt exec .sh last ble exe
- 拷貝預設的shell目錄來進行修改
$ cp -r ./examples/apps/shell/ my-apps/
- 定義job.properties
nameNode=hdfs://bigdata-00:8020jobTracker=bigdata-00:8032queueName=defaultexamplesRoot=user/wulei/my-apps/shell#定義workflow.xml路勁oozie.wf.application.path=${nameNode}/${examplesRoot}/workflow.xml#定義一個變數名儲存shell檔案名稱EXEC=oozie.sh
- 定義workflow.properties
<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>${EXEC}</exec> <!-- 定義shell指令碼路勁 --> <file>${nameNode}/${examplesRoot}/${EXEC}#${EXEC}</file> <!--Copy the executable to compute node‘s current working directory --> </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>
- 定義要實現的指令碼
19.png
- 上傳到hdfs後運行
20.png
- 查看運行結果
21.png
22.png
Oozie-自訂實現WorkFlow中shell action