【发布时间】:2014-03-13 21:25:53
【问题描述】:
我正在探索 Oozie 管理 Hadoop 工作流的功能。我正在尝试设置一个调用一些配置单元命令的 shell 操作。我的 shell 脚本 hive.sh 看起来像:
#!/bin/bash
hive -f hivescript
hive 脚本(已独立测试)创建一些表的地方等等。我的问题是在哪里保存 hivescript,然后如何从 shell 脚本中引用它。
我尝试了两种方法,首先使用本地路径,如hive -f /local/path/to/file,然后使用如上的相对路径,hive -f hivescript,在这种情况下,我将 hivescript 保存在 oozie 应用程序路径目录中(与 hive 相同) .sh 和 workflow.xml)并将其设置为通过 workflow.xml 进入分布式缓存。
使用这两种方法我都会收到错误消息:
"Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]" 在 oozie Web 控制台上。此外,我尝试在 shell 脚本中使用 hdfs 路径,但据我所知,这不起作用。
我的 job.properties 文件:
nameNode=hdfs://sandbox:8020
jobTracker=hdfs://sandbox:50300
queueName=default
oozie.libpath=${nameNode}/user/oozie/share/lib
oozie.use.system.libpath=true
oozieProjectRoot=${nameNode}/user/sandbox/poc1
appPath=${oozieProjectRoot}/testwf
oozie.wf.application.path=${appPath}
和workflow.xml:
<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>${queueName}</value>
</property>
</configuration>
<exec>${appPath}/hive.sh</exec>
<file>${appPath}/hive.sh</file>
<file>${appPath}/hive_pill</file>
</shell>
<ok to="end"/>
<error to="end"/>
</action>
<end name="end"/>
我的目标是使用oozie通过shell脚本调用hive脚本,请大家给点建议。
【问题讨论】:
-
您是否检查了已启动的 oozie 作业的 mapreduce 日志?它提供了更多细节吗?
-
另外,请详细说明
Additionally I've tried using hdfs paths in shell scripts and this does not work as far as I know。