我尝试学习Oozie,我想制作一个非常简单的工作流程。 为此,我使用HUE创建了第一个oozie工作流程。
我的第一个工作流程是执行一个shell命令文件“testhbase.sh”,其中包含:
#!/bin/sh
echo -e "scan 'hbasedepartementcap' " | hbase shell -n
当我试图将它放入Oozie的shell图标时,执行时我得到:没有这样的文件或目录......
我怎么知道在oozie中设置什么参数!! ???
=================================================================
>>> Invoking Shell command line now >>
<<< Invocation of Main class completed <<<
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], main() threw exception, Cannot run program **"testhbase.sh"** (in directory "/var/lib/hadoop-yarn/cache/yarn/nm-local-dir/usercache/cloudera/appcache/application_1497950602840_0001/container_1497950602840_0001_01_000002"): error=2, No such file or directory
java.io.IOException: Cannot run program "testhbase.sh" (in directory "/var/lib/hadoop-yarn/cache/yarn/nm-local-dir/usercache/cloudera/appcache/application_1497950602840_0001/container_1497950602840_0001_01_000002"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at org.apache.oozie.action.hadoop.ShellMain.execute(ShellMain.java:102)
at org.apache.oozie.action.hadoop.ShellMain.run(ShellMain.java:61)
at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:49)
at org.apache.oozie.action.hadoop.ShellMain.main(ShellMain.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:236)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 17 more
Oozie Launcher failed, finishing Hadoop job gracefully
Oozie Launcher, uploading action data to HDFS sequence file: hdfs://quickstart.cloudera:8020/user/cloudera/oozie-oozi/0000001-170620022445649-oozie-oozi-W/shell-3f8f--shell/action-data.seq
Oozie Launcher ends
> Blockquote
答案 0 :(得分:0)
当你有oozie动作时,所有应用程序(bash脚本,jar,hql hive等)必须存在于HDFS路径上,而不是Linux文件系统上。
答案 1 :(得分:0)
您还应在“文件”列表中指定脚本的路径。听起来很奇怪,但如果未指定路径两次,Ooze将无法找到它。
希望这有帮助!