我想将 Hadoop 作业输出导入到 Hive 表。如何在 Map-Reduce 作业/流程中实现后 Hook ?或者任何其他自动化选项?
此外,我会在工作完成后收到通知,例如向用户发送电子邮件。我发现这个:https://issues.apache.org/jira/browse/HADOOP-1111 ,但我不太明白如何做到这一点,因为我是 map 缩减的新手。
谢谢。
最佳答案
conf.set("mapreduce.job.end-notification.url","url")
就可以了。 url
应该是一个 http url
,您将在其中接收回调。
来自javadoc:
Set the uri to be invoked in-order to send a notification after the job has completed (success/failure).
The uri can contain 2 special parameters: $jobId and $jobStatus. Those, if present, are replaced by the job's identifier and completion-status respectively.
This is typically used by application-writers to implement chaining of Map-Reduce jobs in an asynchronous manner.
请注意,较旧的 hadoop 版本使用 job.end.notification.url
。
它在新版本中已被弃用,取而代之的是 mapreduce.job.end-notification.url
。
关于Hadoop post-hook 和作业完成通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31529174/