运行 oozie 中的猪 shell 动作

Run pig in oozie shell action

我创建了一个简单的 pigscript,它加载 10 条记录并存储在 table。

当我使用 oozie Shell 操作调用这个猪(存储在 HDFS 中)文件时,我得到如下错误:

>>> Invoking Shell command line now >>
Exit code of the Shell command 5
<<< Invocation of Shell command completed <<<
<<< Invocation of Main class completed <<<
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]
Oozie Launcher failed, finishing Hadoop job gracefully

我已将 shell 文件放在工作区的 lib 文件夹中,并将所有需要的 jar 文件添加到同一个 lib 文件夹中。请帮我解决这个问题。

我通过以下步骤解决了这个问题:

1)Created a workflow in hue placing a pig action to invoke pigscript.
2)Generated the workflow.xml file by clicking the run button.
3)Ran the workflow.xml through commandline by adding a shell wrapper class which iterates and gives dates as input parameters.

JOB.PROPERTIES 文件:

oozie.use.system.libpath=True
security_enabled=False
dryrun=False
jobTracker=<jobtracker>
nameNode=<nameNode>
oozie.wf.application.path = /user/hue/oozie/workspaces/hue-oozie-1470122057.79/workflow.xml

shell 文件:

 for date in 20160101 20160102 20160103
 oozie job -oozie http://<serverip>:11000/oozie -config job.properties run