I am trying to run a shell script from oozie, when I use Hadoop commands in a shell script, oozie is working fine, but when I try to run shell commands inside script I am getting an error.
Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]
<workflow-app xmlns="uri:oozie:workflow:0.5" name="wf_shell">
<start to="shell1"/>
<action name = "shell1">
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>default</value>
</property>
</configuration>
<exec>sample.sh</exec>
<file>/user/example/path/sample.sh</file>
<capture-output/>
</shell>
<ok to= "end" />
<error to= "fail" />
</action>
<kill name = "fail">
<message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
sample.sh
echo "sample script execution" > /exam/user/example/path/test.txt #assume this is local path
this is not working but when I write Hadoop query in the shell script like below it is working.
hadoop fs -touchz /exam/user/example/path/test.txt
I need to run other oozie jobs from the shell script which I mentioned above. thanks in advance.