创建目录时出现Oozie Shell操作问题 [英] Oozie shell action issue while creating directories

查看:529
本文介绍了创建目录时出现Oozie Shell操作问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从我从Oozie工作流程执行的Shell脚本中添加/删除HDFS上的任何文件或目录. 用户名是"scitest",而我要编辑/添加/删除的hdfs路径是 /user/scitest/.

I am unable to add/delete any files or directories on HDFS from a shell script which I am executing from Oozie workflow. The username is "scitest" and the hdfs path I am trying to edit/add/delete is /user/scitest/.

在shell脚本中,我试图从路径/user/scitest/中删除一个名为test123456的文件夹.

In the shell script I am trying to delete a folder named test123456 from the path /user/scitest/.

--------------- oozie日志错误------------------

429737-oozie-oozi-W@shell-node] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]
2016-12-27 05:04:25,553  INFO ActionEndXCommand:520 - SERVER[vscihadoopvm2.manhdev.com] USER[scitest] GROUP[-] TOKEN[] APP[shell.workflow] JOB[0000041-161208225429737-oozie-oozi-W] ACTION[0000041-161208225429737-oozie-oozi-W@shell-node] ERROR is considered as FAILED for SLA

--------- shell-script(sample.sh)内容----------

#!/bin/bash
echo "`date` hi" > output.log
hadoop fs -mkdir test123456

------- job.properties ---------

nameNode=hdfs://vscihadoopvm1.manhdev.com:8020
jobTracker=vscihadoopvm2.manhdev.com:8050
master=yarn-cluster
#user.name=yarn
queueName=default
examplesRoot=oozietest
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}

--- workflow.xml ---

<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.5" name="shell.workflow">
<start to="shell-node"/>
  <action name="shell-node">
    <shell xmlns="uri:oozie:shell-action:0.3">
      <job-tracker>${jobTracker}</job-tracker>
      <name-node>${nameNode}</name-node>
      <configuration>
        <property>
          <name>mapred.job.queue.name</name>
          <value>${queueName}</value>
        </property>
      </configuration>
      <exec>sample.sh</exec>
      <file>sample.sh#sample.sh</file>
    </shell>
    <ok to="end"/>
    <error to="kill"/>
  </action>
  <kill name="kill">
    <message>Error in Shell.Please refer the Oozie Logs</message>
  </kill>
  <end name="end"/>
</workflow-app>

推荐答案

@Abhiroy,如果可以与哪个用户一起执行您的oozie动作,可能会更好.您只需在示例Shell脚本中放置不带引号的'id'即可运行工作流程.然后,您可以跟踪oozie作业日志,以查看oozie正在使用的示例脚本的容器执行器.然后,如果您有任何权限问题,我们可以开始跟踪.

@Abhiroy, Maybe its better if you can check with which user your oozie action is getting executed. you can simply place 'id' without quotes in your sample shell script and run the workflow. Then you can trace the oozie job logs to see the container executer for your sample script that oozie is using. Then we can start tracing if you have any permission issues.

这篇关于创建目录时出现Oozie Shell操作问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆