when i run workflow on oozie that contain shell script i have error. yarn application log show error:
>>> Invoking Shell command line now >>
Exit code of the Shell command 1
<<< Invocation of Shell command completed <<<
i am going to download file from ftp server an put file to hdfs path with oozie workflow. i define workflow with shell script
in shell script i download file with wget and then use hdfs dfs -put command to load file from local to hdfs
when run shell script on master node it work correctly. this is shell script: (sample.sh)
wget ftp://ftpserver/test.txt
hdfs dfs -put test.txt hdfs://master1:8020/user/ambari-qa
i have tow problem:
1- when i run wget alone. my job in oozie finished succeeded state. but i do not know where test.txt is located??? (which path saved test.txt). i try this command to define path for wget ftp://ftpserver/test.txt -P /home/ambari-qa but job is killed when i use /home/ambari-qa local path in script.
2- when i use hdfs dfs -put alone, job is killed. i do not know when i use hdfs dfs command in my script then my job is killed.
consider my shell script have problem when i use that in oozie and i have to change that. please advise correct command in my shell script
oozie workflow.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<workflow-app xmlns="uri:oozie:workflow:0.5" name="test">
<start to="shell_1"/>
<action name="shell_1">
<shell xmlns="uri:oozie:shell-action:0.3">
<job-tracker>${resourceManager}</job-tracker>
<name-node>${nameNode}</name-node>
<exec>/user/ambari-qa/sample.sh</exec>
<file>/user/ambari-qa/sample.sh</file>
</shell>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>${wf:errorMessage(wf:lastErrorNode())}</message>
</kill>
<end name="end"/>
</workflow-app>
<file>tells Oozie to downloadhdfs:///user/ambari-qa/sample.shto the local filesystem of the YARN container, without renaming it. Therefore you should simply<exec>sample.sh</exec>- Samson Scharfrichter<exec>sample.sh</exec>but my result did not change - ahmad