Hadoop纱线节点列表将slave显示为localhost.localdomain:#somenumber。连接拒绝异常 [英] Hadoop yarn node list shows slaves as localhost.localdomain:#somenumber. connection refuse exception

查看:188
本文介绍了Hadoop纱线节点列表将slave显示为localhost.localdomain:#somenumber。连接拒绝异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行wordcount程序时,出现了localhost.localdomain / 127.0.0.1到localhost.localdomain:55352的连接拒绝异常。
yarn node -list给出

pre $ hduser @ localhost:/ usr / local / hadoop / etc / hadoop $ yarn node -list
15/05/27 07:23:54信息client.RMProxy:连接到master / 192.168.111.72处的ResourceManager:8040
总节点数:2
节点ID节点状态Node-Http-Address-Running-Containers
localhost.localdomain:32991 RUNNING localhost.localdomain:8042 0
localhost.localdomain:55352 RUNNING localhost.localdomain:8042 0
code>

master / etc / hosts:

  127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 
#127.0.1.1 ubuntu-Standard-PC-i440FX-PIIX-1996
192.168.111.72 master
192.168.111.65 slave1
192.168.111.66 slave2

#对于支持IPv6的主机,以下几行是可取的:
:: 1 ip6-localhost ip6-loopback
fe00 :: 0 ip6-localnet
ff00 :: 0 ip6-mcastp refix
ff02 :: 1 ip6-allnodes
ff02 :: 2 ip6-allrouters

slave / etc / hosts:

  127.0.0.1 localhost.localdomain localhost 
#127.0.1.1 ubuntu-Standard -PC-i440FX-PIIX-1996
192.168.111.72 master
#192.168.111.65 slave1
#192.168.111.66 slave2

#以下几行适用于IPv6有能力的主机
:: 1 ip6-localhost ip6-loopback
fe00 :: 0 ip6-localnet
ff00 :: 0 ip6-mcastprefix
ff02 :: 1 ip6-allnodes
ff02 :: 2 ip6-allrouters

我理解的是master错误地尝试连接到slave在本地主机上。请帮我解决这个问题。任何建议表示赞赏。谢谢。

解决方案

这里是代码如何 NodeManager 构建 NodeId



pre $ private $ NodeId buildNodeId(InetSocketAddress connectAddress,
String hostOverride){
if(hostOverride!= null){
connectAddress = NetUtils.getConnectAddress(
new InetSocketAddress(hostOverride,connectAddress.getPort()));
}
返回NodeId.newInstance(
connectAddress.getAddress()。getCanonicalHostName(),
connectAddress.getPort());

NodeManager 尝试从绑定地址获取规范主机名, localhost 将会被给定地址 127.0.0.1



因此,对于你的情况,在奴隶主机上, localhost.localdomain 是地址的默认主机名, 127.0.0.1 ,并且可能的解决方案可能会将您的从站上的 / etc / hosts 的第一行分别更改为:

  127.0.0.1 slave1 localhost.localdomain localhost 





  127.0.0.1 slave2 localhost.localdomain localhost 


I have got connection refuse exception from localhost.localdomain/127.0.0.1 to localhost.localdomain:55352 when trying to run wordcount program. yarn node -list gives

hduser@localhost:/usr/local/hadoop/etc/hadoop$ yarn node -list
15/05/27 07:23:54 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.111.72:8040
Total Nodes:2
         Node-Id         Node-State Node-Http-Address   Number-of-Running-Containers
localhost.localdomain:32991         RUNNING localhost.localdomain:8042                             0
localhost.localdomain:55352         RUNNING localhost.localdomain:8042                             0

master /etc/hosts:

127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
#127.0.1.1    ubuntu-Standard-PC-i440FX-PIIX-1996
192.168.111.72  master
192.168.111.65  slave1
192.168.111.66  slave2

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

slave /etc/hosts:

127.0.0.1       localhost.localdomain localhost
#127.0.1.1      ubuntu-Standard-PC-i440FX-PIIX-1996
192.168.111.72  master
#192.168.111.65  slave1
#192.168.111.66  slave2

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

What I understood is master is wrongly trying to connect to slaves on localhost. Please help me resolve this. Any suggestion is appreciated. Thank you.

解决方案

Here is the code how NodeManager builds the NodeId:

private NodeId buildNodeId(InetSocketAddress connectAddress,
  String hostOverride) {
  if (hostOverride != null) {
    connectAddress = NetUtils.getConnectAddress(
      new InetSocketAddress(hostOverride, connectAddress.getPort()));
  }
  return NodeId.newInstance(
    connectAddress.getAddress().getCanonicalHostName(),
    connectAddress.getPort());
}

NodeManager tries to get the canonical hostname from the binding address, localhost will be gotten by given address 127.0.0.1.

So in your case, on the slave host, localhost.localdomain is the default host name for address 127.0.0.1, and the possible solution might be changing the first line of /etc/hosts on your slaves respectively to:

  127.0.0.1  slave1 localhost.localdomain localhost

and

  127.0.0.1  slave2 localhost.localdomain localhost

这篇关于Hadoop纱线节点列表将slave显示为localhost.localdomain:#somenumber。连接拒绝异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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