更新时间:2023-04-18 GMT+08:00
分享

建议

节点的命名,需要体现出节点的实际用途

规范的命名如下:

<action name="copyData">
   <fs>
     <delete path='${nameNode}/user/result'/>
     <mkdir path='${nameNode}/user/result'/>
     <move source='${nameNode}/output-data/map-reduce'
           target='${nameNode}/user/result'/>
     <chmod path='${nameNode}/user/result' 
           permissions='-rwxrw-rw-' dir-files='true'></chmod>
   </fs>
   <ok to="end"/>
   <error to="fail"/>
 </action> 

不规范的命名如下:

<action name="fsNode">
   <fs>
     <delete path='${nameNode}/user/result'/>
     <mkdir path='${nameNode}/user/result'/>
     <move source='${nameNode}/output-data/map-reduce'
           target='${nameNode}/user/result'/>
     <chmod path='${nameNode}/user/result'
            permissions='-rwxrw-rw-' dir-files='true'></chmod>
   </fs>
   <ok to="end"/>
   <error to="fail"/>
 </action>

涉及数据覆盖的任务,需要在prepare中设置预清理操作

正确示例:

<workflow-app name="foo-wf" xmlns="uri:oozie:workflow:0.1">
     ...
     <action name="myfirstHadoopJob">
         <map-reduce>
             <resource-manager>foo:8021</resource-manager>
             <name-node>bar:8020</name-node>
             <prepare> 
                <delete path="hdfs://foo:8020/usr/tucu/output-data"/>
             </prepare> 
            <job-xml>/myfirstjob.xml</job-xml>
             <configuration>
                 <property>
                     <name>mapred.input.dir</name>
                     <value>/usr/tucu/input-data</value>
                 </property>
                 <property>
                     <name>mapred.output.dir</name>
                     <value>/usr/tucu/input-data</value>
                 </property>
                 <property>
                     <name>mapred.reduce.tasks</name>
                     <value>${firstJobReducers}</value>
                 </property>
                 <property>
                     <name>oozie.action.external.stats.write</name>
                     <value>true</value>
                 </property>
             </configuration>
         </map-reduce>
         <ok to="myNextAction"/>
         <error to="errorCleanup"/>
     </action>
     ...
 </workflow-app>
分享:

    相关文档

    相关产品