Hadoop Yarn集群中节点全是localhost

Hadoop集群部署后,出现Yarn的节点都是localhost,从而找不到其他的Node下发任务,出现如下的错误。

ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:10020. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)

在Yarn Web UI中和yarn node -list查看,

022-09-30 11:48:54,735 INFO client.DefaultNoHARMFailoverProxyProvider: Connecting to ResourceManager at hadoop2/192.168.56.2:8032
Total Nodes:3
         Node-Id         Node-State Node-Http-Address   Number-of-Running-Containers
 localhost:42975            RUNNING    localhost:8042                              0
 localhost:41913            RUNNING    localhost:8042                              0
 localhost:36595            RUNNING    localhost:8042                              0

搜索到的解决方案是把/etc/hosts中的localhost项给注释掉,但是尝试后发现不能解决问题。

我的服务器系统是CentOS 8 Stream,最后的解决方案是直接改主机名。

  1. hostnamectl set-hostname hadoop1
  2. 修改/etc/hostname

你可能感兴趣的:(Hadoop Yarn集群中节点全是localhost)