Details
Description
bash files that saved on shared mount, cannot be execute by the ShellAction in proper way.
Example:
Worker-1,Worker-2,Worker-3 have shared mount /mnt/hadoop
on /mnt/hadoop there is a file script.sh
Right now there is two options to submit it using ShellAction:
- Upload it to hdfs, add it as a file and submit script.sh
- use bash as exec and file location (/mnt/hadoop/script.sh) as argument (e.g <exec>bash>/exec><argument>/mnt/hadoop/script.sh</argument>
Best option is that the <exec> command will support shared mounted file :
<exec>/mnt/hadoop/script.sh</exec>
This code is taking only the file name instead it full path:
String exec = actionXml.getChild("exec", ns).getTextTrim(); String execName = new Path(exec).getName(); actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName);
Best option to support shared mount file is to support file:// starting for bash files that are local (or shared by mount), e.g:
String exec = actionXml.getChild("exec", ns).getTextTrim(); String execName; String localFilePrefix = "file://"; // When exec starts with 'file://' refer it as local file. if (exec.startsWith(localFilePrefix)) execName = exec.substring(localFilePrefix.length()); else execName = new Path(exec).getName(); actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName);
Attachments
Attachments
Issue Links
- duplicates
-
OOZIE-3567 Oozie ShellAction should support absolute bash file path
- Patch Available
- is duplicated by
-
OOZIE-3086 Oozie shell action ignores absolute path
- Resolved
- links to