繁体   English   中英

使用Oozie执行shell脚本,作业始终只在运行状态

[英]execution of shell script using Oozie, job always in running state only

我需要oozie的帮助,我正在尝试运行一个创建HDFS文件夹的脚本,当我执行Oozie时它只显示在Running状态,任何人都可以帮我识别我的workflow.xml或jo.properties有什么问题。 我尝试验证workflow.xml,但没有显示任何错误。

workflow.xml

<workflow-app xmlns='uri:oozie:workflow:0.3' name='shell-wf'>
  <start to='shell1' />
  <action name='shell1'>
 <shell xmlns="uri:oozie:shell-action:0.1">
  <job-tracker>${jobTracker}</job-tracker> 
  <name-node>${nameNode}</name-node> 
  <exec>/user/nathalok/run.sh</exec>  
  <file>/user/nathalok/run.sh#run.sh</file> 
  </shell>
       <ok to="end" />
        <error to="fail" />
    </action>
    <kill name="fail">
        <message>Script failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name='end' />
</workflow-app>

Job.properties

nameNode=hdfs://myserver:8020
jobTracker=myserver.com:8032
oozie.wf.application.path=hdfs://myserver/user/nathalok
oozie.use.system.libpath=true
oozie.libpath= hdfs://myserver/user/oozie/share/lib/lib_20150312161328/oozie
user.name=oozie

按顺序执行以下命令:

-bash-4.1$ oozie job -oozie http://myserver.com:11000/oozie -config job.properties -submit
job: 0000209-150501165011472-oozie-oozi-W

-bash-4.1$ oozie job -oozie http://myserver.com:11000/oozie -start 0000209-150501165011472-oozie-oozi-W

-bash-4.1$ oozie job -oozie http://myserver.com:11000/oozie -info 0000209-150501165011472-oozie-oozi-W
Job ID : 0000209-150501165011472-oozie-oozi-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : shell-wf
App Path      : hdfs://hdfspath/user/userid
Status        : RUNNING
Run           : 0
User          : userid
Group         : -
Created       : 2015-05-06 12:16 GMT
Started       : 2015-05-06 12:16 GMT
Last Modified : 2015-05-06 12:16 GMT
Ended         : -
CoordAction ID: -

Actions
------------------------------------------------------------------------------------------------------------------------------------
ID                                                                            Status    Ext ID                 Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
0000209-150501165011472-oozie-oozi-W@:start:                                  OK        -                      OK         -
------------------------------------------------------------------------------------------------------------------------------------
0000209-150501165011472-oozie-oozi-W@shell1                                   PREP      -                      -          -
------------------------------------------------------------------------------------------------------------------------------------

使用Oozie时,您不需要使用shell脚本来创建HDFS文件夹,而是使用Fs(HDFS)中的内置操作 -

例如:

<action name="createFolder">
    <fs>
        <mkdir path="/my/folder" />
    </fs>
    <ok to="end"/>
    <error to="fail"/>
</action>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM