Hadoop找到任务尝试的主机名 [英] Hadoop find hostname of task attempt

查看:114
本文介绍了Hadoop找到任务尝试的主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图以编程方式确定在将映射减少作业提交到hadoop时,哪些任务尝试在我的集群中的哪个任务跟踪器上运行。我发现我可以从JobClient获得大部分任务数据,如下所示:



jobClient.getMapTaskReports(jobID)



但不是任务尝试成功的机器的主机名。是否有人知道如何从任务尝试ID中获取主机名?

JobClient 给你一个所谓的 NetworkedJob 时提交。它有一个名为 getTaskCompletionEvents 的方法。

返回一个 TaskCompletionEvent 发生了那些包含执行任务的tasktracker的HTTP地址。



从这一点开始,您可以解析主机网址。


I am trying to programatically determine which task attempts run on which tasktracker in my cluster when submitting map reduce jobs to hadoop. I have found that I can get most of the task data from the JobClient like so:

jobClient.getMapTaskReports(jobID)

but not the hostname of the machine that a task attempt succeeded on. Does anybody know how to get the hostname from the task attempt id?

解决方案

The JobClient gives you a so called NetworkedJob when submitting. It has a method called getTaskCompletionEvents.

That returns you an array of TaskCompletionEvent that happened, those contain the HTTP address of the tasktracker that ran a task.

From that point you can parse the host from the URL.

这篇关于Hadoop找到任务尝试的主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆