Oozie和猪行动:如何在job-xml中包含猪param?

时间:2015-04-05 04:26:41

标签: hadoop apache-pig oozie

我们可以在job-xml文件中包含一个属性,作为要运行的pig param引用吗?每当我运行代码时,我都会收到“变量无法解析”的错误。

以下是我的代码示例:

猪行动代码:

 <action name="tester-bundle">
        <pig>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
        <job-xml>${nameNode}/user/cloudera/coordb/job.xml</job-xml>
            <configuration>
                <property>
                    <name>oozie.use.system.libpath</name>
                    <value>true</value>
                </property>
            </configuration>
            <script>/user/cloudera/test-inputs/testa3a.pig</script>
              <param>inputdata=${inputdata}</param>
          <param>outdir=${outpath}</param>
        </pig>
        <ok to="end"/>
        <error to="kill"/>
    </action>

Job.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>outpath</name>
        <value>hdfs://localhost.localdomain:8020/user/cloudera/test2/20150318</value>
    </property>
</configuration>

错误日志:

2015-04-05 00:50:03,371 INFO org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@:start:] Start action [0000020-150405004258896-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2015-04-05 00:50:03,371 WARN org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@:start:] [***0000020-150405004258896-oozie-oozi-W@:start:***]Action status=DONE
2015-04-05 00:50:03,371 WARN org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@:start:] [***0000020-150405004258896-oozie-oozi-W@:start:***]Action updated in DB!
2015-04-05 00:50:03,776 INFO org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@create-status] Start action [0000020-150405004258896-oozie-oozi-W@create-status] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2015-04-05 00:50:04,149 WARN org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@create-status] [***0000020-150405004258896-oozie-oozi-W@create-status***]Action status=DONE
2015-04-05 00:50:04,149 WARN org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@create-status] [***0000020-150405004258896-oozie-oozi-W@create-status***]Action updated in DB!
2015-04-05 00:50:04,579 WARN org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@tester-bundle] ELException in ActionStartXCommand 
javax.servlet.jsp.el.ELException: variable [outpath] cannot be resolved
    at org.apache.oozie.util.ELEvaluator$Context.resolveVariable(ELEvaluator.java:106)
    at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
    at org.apache.commons.el.ExpressionString.evaluate(ExpressionString.java:114)
    at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:274)
    at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190)
    at org.apache.oozie.util.ELEvaluator.evaluate(ELEvaluator.java:203)
    at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:171)
    at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:59)
    at org.apache.oozie.command.XCommand.call(XCommand.java:277)
    at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:331)
    at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:260)
    at org.apache.oozie.service.CallableQueueService$CallableWrapper.run(CallableQueueService.java:174)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
2015-04-05 00:50:04,579 WARN org.apache.oozie.command.wf.ActionStartXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@tester-bundle] Failing Job due to failed action [tester-bundle]
2015-04-05 00:50:04,594 WARN org.apache.oozie.workflow.lite.LiteWorkflowInstance: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[0000020-150405004258896-oozie-oozi-W@tester-bundle] Workflow Failed. Failing node [tester-bundle]
2015-04-05 00:50:04,812 INFO org.apache.oozie.command.wf.KillXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[-] STARTED WorkflowKillXCommand for jobId=0000020-150405004258896-oozie-oozi-W
2015-04-05 00:50:04,889 INFO org.apache.oozie.command.wf.KillXCommand: USER[cloudera] GROUP[-] TOKEN[] APP[t3-cloudera-bundle-B] JOB[0000020-150405004258896-oozie-oozi-W] ACTION[-] ENDED WorkflowKillXCommand for jobId=0000020-150405004258896-oozie-oozi-W

0 个答案:

没有答案