- Copy the default shell directory for modification
$ cp -r ./examples/apps/shell/ my-apps/
- Define 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
- Define Workflow.properties
<Workflow-appxmlns="uri:oozie:workflow:0.4"Name="SHELL-WF" ><Startto="Shell-node"/><ActionName="Shell-node" ><Shellxmlns="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><!--define shell script Road---<file>${NameNode}/${Examplesroot}/${EXEC}#${EXEC}</File><!--Copy the executable to compute node's current working directory--</Shell><Okto="End"/><error to= " Fail "/> </action> <kill name= "fail" > << Span class= "Hljs-name" >message>shell action failed, error Message[${WF: ErrorMessage (Wf:lasterrornode ())}]</ message> </kill> <end name=" end "/></< Span class= "Hljs-name" >WORKFLOW-APP>
- Define the script to be implemented
19.png
- Run after uploading to HDFs
20.png
- View Run Results
21.png
22.png
oozie-Custom Implementation Workflow Shell action