Oozie和Hue:运行shell脚本时拒绝权限

时间:2015-03-19 10:22:42

标签: shell hadoop oozie hue

我在HDFS sample_shell.sh中有一个shell脚本/user/user,如下所示:

 source /user/user/params_new.cfg
 echo "HELLO WORLD"
 echo $layer

params_new.cfg也在HDFS /user/user目录中,其内容为:

layer="S"

我是Oozie的新手并尝试在Hue中设置Oozie工作流程,该工作流程将执行sample_shell.sh脚本。属性如下:

<workflow-app name="shell_sample" xmlns="uri:oozie:workflow:0.4">
<start to="shell_sample"/>
<action name="shell_sample">
    <shell xmlns="uri:oozie:shell-action:0.1">
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <exec>/user/user/sample_shell.sh</exec>
        <file>/user/user/sample_shell.sh#sample_shell.sh</file>
        <file>/user/user/params_new.cfg#params_new.cfg</file>
          <capture-output/>
    </shell>
    <ok to="end"/>
    <error to="kill"/>
</action>
<kill name="kill">
    <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>

但是我收到以下错误:

Log Length: 165
./sample_shell.sh: line 2: /user/user/params_new.cfg: Permission denied
 Failing Oozie Launcher, Main class     [org.apache.oozie.action.hadoop.ShellMain], exit code [1]

我不明白出了什么问题!如果我从sample_shell.sh代码中删除source /user/user/params_new.cfgecho $layer行,则可以正常使用!

权限如下。

 -rwxrwxrwx   3 user_name supergroup       1590 2015-03-19 04:01 /user/user/params_new.cfg
 -rwxrwxrwx   3 user_name supergroup        139 2015-03-19 04:18 /user/user/sample_shell.sh

1 个答案:

答案 0 :(得分:-1)

检查/ user和/ user / user目录的权限