hadoop节点列表将从节点显示为localhost.localdomain:#somenumber连接拒绝异常

2g32fytz  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(458)

我收到localhost.localdomain/127.0.0.1到localhost.lo的连接拒绝异常caldomain:55352 when 正在尝试运行wordcount程序。Yarn节点-列表

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

主机/etc/主机:

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

从属/etc/主机:

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

据我所知,master错误地试图连接到localhost上的从属服务器。请帮我解决这个问题。任何建议都将不胜感激。谢谢您。

jyztefdp

jyztefdp1#

下面是代码 NodeManager 构建 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` 尝试从绑定地址获取规范主机名, `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

相关问题