gpt4 book ai didi

hadoop - 无法在Oozie的Sqoop工作流程中加载HiveConf

转载 作者:行者123 更新时间:2023-12-02 21:10:57 25 4
gpt4 key购买 nike

我在Oozie中创建了一个Sqoop工作流,以将来自MySQL的数据压缩到Hive表中。

如果我在终端中运行Sqoop作业,它运行良好并且数据已成功插入到Hive表中,但是如果我将该作业放在Oozie中并运行它,则会给我一个错误:

Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.

Encountered IOException running import job: java.io.IOException: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf

谁能帮我这个?

我在这里使用HDP 2.5。

以下是我的Oozie属性文件:
nameNode=hdfs://master.nodes:8020
jobTracker=master.nodes:8050
queueName=default
examplesRoot=jas-oozie

oozie.use.system.libpath=true
oozie.libpath=${nameNode}/user/oozie/share/lib
oozie.action.sharelib.for.pig=hive,pig,hcatalog
oozie.action.sharelib.for.hive=pig,hcatalog,atlas,hive

oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/jas-oozie-workflow.xml
outputDir=jas

以下是Oozie的xml文件:
<?xml version="1.0" encoding="UTF-8"?>

<workflow-app xmlns="uri:oozie:workflow:0.2" name="jas-import-wf">
<start to="sqoop-import-air-quality-node"/>

<action name="sqoop-import-air-quality-node">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data"/>
<!-- <mkdir path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data"/> -->
</prepare>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<arg>import</arg>
<arg>--connect</arg>
<arg>jdbc:mysql://xx.xx.xx.xx:3306/xxxx?dontTrackOpenResources=true&amp;defaultFetchSize=1000&amp;useCursorFetch=true&amp;zeroDateTimeBehavior=convertToNull</arg>
<arg>--driver</arg>
<arg>com.mysql.jdbc.Driver</arg>
<arg>--username</arg>
<arg>xx</arg>
<arg>--password</arg>
<arg>xx</arg>
<arg>--query</arg>
<arg>
select <fields> from <table> where $CONDITIONS
</arg>
<arg>--hive-import</arg>
<arg>--hive-drop-import-delims</arg>
<arg>--hive-overwrite</arg>
<arg>--hive-table</arg>
<arg>table</arg>
<arg>--target-dir</arg>
<arg>/user/${wf:user()}/${examplesRoot}/output-data/sqoop-import</arg>
<arg>-m</arg>
<arg>1</arg>
</sqoop>
<ok to="end"/>
<error to="import-air-quality-fail"/>
</action>

<kill name="import-air-quality-fail">
<message>Sqoop from ICP failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>

<end name="end"/>
</workflow-app>

谢谢。

最佳答案

1)在路径lib中创建目录${nameNode}/user/${user.name}/${examplesRoot}/
2)在hive-exec jar路径中添加${nameNode}/user/${user.name}/${examplesRoot}/lib/,然后重试

关于hadoop - 无法在Oozie的Sqoop工作流程中加载HiveConf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40328177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com