oozie和hue:运行shell脚本时权限被拒绝

ercv8c1e  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(543)

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

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

params\u new.cfg也在hdfs中 /user/user 目录,其内容为:

layer="S"

我是oozie的新手,正在尝试在hue中设置一个oozie工作流,它将执行示例\u 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]

我不明白出了什么问题!如果我移除 source /user/user/params_new.cfg 以及 echo $layer 一行来自sample_shell.sh的代码,工作正常!
权限如下。

-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

相关问题