2016-12-27 68 views
0

我無法通過Oozie工作流執行的shell腳本添加/刪除HDFS上的任何文件或目錄。 用戶名是「scitest」,我試圖編輯/添加/刪除的hdfs路徑是 /user/scitest /。創建目錄時Oozie shell操作問題

在shell腳本中,我試圖從路徑/ user/scitest /中刪除一個名爲test123456的文件夾。

---------------從Oozie的日誌錯誤------------------

[email protected]] 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[[email protected]] ERROR is considered as FAILED for SLA 

---------殼腳本(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> 
+0

錯誤消息對我來說似乎不相關。我能夠執行腳本。還要在workflow.xml中的shell操作的'file'標記中提供完整路徑。謝謝。 – YoungHobbit

+0

@YoungHobbit,謝謝你的迴應.. – abhiroy82

+0

@YoungHobbit,謝謝你的回覆..我嘗試添加shell腳本的完整hdfs路徑,但沒有幫助.. /user/scitest/oozietest/sample.sh #sample.sh但沒有幫助...給了同樣的錯誤...可能是一個權限問題.. – abhiroy82

回答

0

@Abhiroy,也許它的更好,如果你可以檢查與用戶獲取執行你的Oozie的動作。您可以簡單地在您的示例shell腳本中放置不帶引號的'id'並運行工作流程。然後,您可以跟蹤oozie作業日誌以查看oozie正在使用的示例腳本的容器執行器。然後,如果您有任何權限問題,我們可以開始追蹤。

+0

非常感謝你迪帕克..我會給你一個機會。 – abhiroy82