gpt4 book ai didi

shell - 使用 Oozie 执行 shell 脚本,作业始终仅处于运行状态

转载 作者:可可西里 更新时间:2023-11-01 14:40:54 26 4
gpt4 key购买 nike

我需要 oozie 的帮助,我正在尝试运行一个创建 HDFS 文件夹的脚本,当我执行 Oozie 时它仅显示在运行状态,任何人都可以帮助我确定我的 workflow.xml 是否有问题或乔.属性。我尝试验证 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 中的构建-

例如:

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

关于shell - 使用 Oozie 执行 shell 脚本,作业始终仅处于运行状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30092424/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com