使用Hive查询运行Oozie工作流时出错。 这是工作流程
<workflow-app xmlns='uri:oozie:workflow:0.5' name='reporting_W_errorAuditHiveQueryExe'>
<start to="hive_report_fork"/>
<fork name="hive_report_fork">
<path start="hiveGSRLfile"/>
<path start="hiveNGSRLfile"/>
<path start="hiveNGsrlRAfile"/>
</fork>
<action name="hiveGSRLfile">
<hive xmlns='uri:oozie:hive-action:0.2'>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<script>${dir}/gsrlQery.hql</script>
<param>OutputDir=${jobOutput}</param>
</hive>
<ok to="joining"/>
<error to="joining"/>
</action>
<action name="hiveNGSRLfile">
<hive xmlns='uri:oozie:hive-action:0.2'>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<script>${dir}/nongsrlQuery.hql</script>
<param>OutputDir=${jobOutput}</param>
</hive>
<ok to="joining"/>
<error to="joining"/>
</action>
<action name="hiveNGsrlRAfile">
<hive xmlns='uri:oozie:hive-action:0.2'>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<script>${dir}/nongsrlRAQuery.hql</script>
<param>OutputDir=${jobOutput}</param>
</hive>
<ok to="joining"/>
<error to="joining"/>
</action>
<join name= "joining" to="Success"/>
<action name="Success">
<email xmlns="uri:oozie:email-action:0.1">
<to>${failureEmailToAddress}</to>
<subject>Success</subject>
<body>
The workflow ${wf:name()} with id ${wf:id()} failed
[${wf:errorMessage(wf:lastErrorNode())}].
</body>
</email>
<ok to="end" />
<error to="fail" />
</action>
<action name="failure">
<email xmlns="uri:oozie:email-action:0.1">
<to>${failureEmailToAddress}</to>
<subject>Failure</subject>
<body>
The workflow ${wf:name()} with id ${wf:id()} failed
[${wf:errorMessage(wf:lastErrorNode())}].
</body>
</email>
<ok to="end" />
<error to="fail" />
</action>
<kill name="fail">
<message>Workflow failed</message>
</kill>
<end name="end"/>
这是oozie属性文件
oozie.wf.application.path=${deploymentPath}/workflows/errorAuditHiveQueryExe.xml
deploymentPath=/user/amin/deploy_178
jobTracker=localhost:8032
nameNode=hdfs://nameservice1
dir=${deploymentPath}/data-warehouse/temp
failureEmailToAddress=amin@dnb.com
jobOutput=${dir}
oozie.use.system.libpath=true
这是我得到的错误:
FAILED: SemanticException [Error 10072]: Database does not exist: testnamespace
Intercepting System.exit(10072)
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [10072]
但是命名空间存在,我可以查询其中的表。
这里有什么问题?请帮忙。 我使用CDH 5.5.2 Running Hive 1.0
答案 0 :(得分:3)
经过对互联网的不懈研究,我能够解决问题的解决方案。 我添加了一个配置,以便将Metastore服务器用于Hive作业,并且它可以工作。
以下是我对Hive行动的所作所为。
....
<hive xmlns='uri:oozie:hive-action:0.2'>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://10.155.1.63:9083</value>
</property>
</configuration>
<script>${dir}/gsrlQery.hql</script>
<param>OutputDir=${jobOutput}</param>
</hive>
....
注意:如果您正在尝试修复类似问题,请相应地更换hive metatore ip。要获取Metastore详细信息,请检查位于/ etc / hive / conf目录中的hive-site.xml文件。
信用:MapR