需要一些建议 我正在尝试在 oozie 中运行 sqoop 作业,但它突然被杀死并且 oozie-error.log 中有这个警告
2018-01-21 17:30:12,473 WARN SqoopActionExecutor:523 - SERVER[edge01.domain.com] USER[linknet] GROUP[-] TOKEN[] APP[sqoop-wf] JOB[0000006-180121122345026-oozie-link-W] ACTION[0000006-180121122345026-oozie-link-W@sqoop-node] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]
工作属性
nameNode=hdfs://hadoop01.domain.com:8020
jobTracker=hadoop01.domain.com:18032
queueName=default
oozie.use.system.libpath=true
examplesRoot=examples
oozie.libpath=${nameNode}/share/lib/oozie
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/sqoop
工作流.xml
<workflow-app xmlns="uri:oozie:workflow:0.2" name="sqoop-wf">
<start to="sqoop-node"/>
<action name="sqoop-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/sqoop"/>
<mkdir path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data"/>
</prepare>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<command>job --exec ingest_cpm_alarm</command>
</sqoop>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Sqoop failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
这就是我创建 sqoop 作业 ingest_cpm_alarm 的方式
$ sqoop job --create ingest_cpm_alarm -- import --connect jdbc:postgresql://xxx.xxx.xxx.xxx:5432/snapshot --username "extractor" -P \
--incremental append \
--check-column snapshot_date \
--table cpm_snr_history \
--as-avrodatafile \
--target-dir /tmp/trash/cpm_alarm
我可以成功运行这个 sqoop 作业,但不能在 Oozie 调度程序中运行。 此外,jar 文件 postgresql-42.1.4.jar 和 $SQOOP_HOME/lib 下的所有内容都已复制到 libpath 目录 (/share/lib/oozie) 中。
Oozie 和 sqoop 驻留在同一台服务器上。在我的 sqoop-site.xml 中,我只设置了这些参数。
sqoop.metastore.client.enable.autoconnect=true
sqoop.metastore.client.record.password=true
sqoop.metastore.client.record.password=true
我在这里错过了什么吗?
最佳答案
它已解决,我错过了 sqoop-site.xml,它应该在 HDFS 的相同工作流目录中可用。
这篇文章有类似的问题: sqoop exec job in oozie is not working
谢谢。
关于hadoop - 无法在 oozie 中运行 "sqoop job --exec",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48366155/