Yarn slave节点没有与主节点通信?

时间:2017-03-20 20:10:18

标签: hadoop apache-spark yarn

我执行yarn node -list时无法看到我的节点,即使我已将/etc/hadoop/conf/yarn-site.xml配置为具有正确的属性(在我看来,至少根据此问题Slave nodes not in Yarn ResourceManager })。

这是我到目前为止所做的:

  • 在主人
  • 上安装了resourcemanager
  • 在奴隶上安装nodemanager
  • 在所有节点上检查yarn-site.xml

    <property> <name>yarn.resourcemanager.hostname</name> <value>master-node</value> </property>

  • 修改配置文件后,分别在主设备和从设备上重新启动resourcemanagernodemanager

但是当我yarn node -list时,我只看到

Total Nodes: 0 
Node-Id       Node-state    Node-Http-Address      Number-of-Running-Containers

在我的节点上,我查看了.out中的/var/log/hadoop-yarn/个文件,我看到了这些文件:

ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 244592
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 32768
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 65536
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

修改 当我查看.log文件时,我看到以下内容,但我不确定如何修复它:

    INFO org.apache.hadoop.service.AbstractService: Service NodeManager failed in state STARTED; cause:

org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: <master node ip>:8020:8031 (configuration property 'yarn.resourcemanager.resource-tracker.address')

Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: <master node ip>:8020:8031 (configuration property 'yarn.resourcemanager.resource-tracker.address')

如何将我的从属节点连接到主节点?

3 个答案:

答案 0 :(得分:3)

yarn.resourcemanager.hostname的值设置为所有ResourceManager属性的基值。属性yarn.resourcemanager.resource-tracker.address默认为${yarn.resourcemanager.hostname}:8031的值。有关默认YARN配置的完整列表,请参阅yarn-default.xml

来自nodemanager ERROR日志,

Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: <master node ip>:8020:8031 (configuration property 'yarn.resourcemanager.resource-tracker.address')

看起来yarn.resourcemanager.hostname属性在从属节点上被错误地配置为<master node ip>:8020而不是<master node ip>

编辑所有节点上的yarn-site.xml

<property>
   <name>yarn.resourcemanager.hostname</name>
   <value>master_node</value> <!-- IP address or Hostname of the node where Resource Manager is started, Omit the port number -->
</property>

最后,重新启动YARN服务。

答案 1 :(得分:1)

please set all this properties and try
    <property>
        <name>yarn.resourcemanager.address</name>
        <value>master_node:8032</value>
      </property>
      <property>
        <name>yarn.resourcemanager.admin.address</name>
        <value>master_node:8033</value>
      </property>
      <property>
        <name>yarn.resourcemanager.scheduler.address</name>
        <value>master_node:8030</value>
      </property>
      <property>
        <name>yarn.resourcemanager.resource-tracker.address</name>
        <value>master_node:8031</value>
      </property>
      <property>
        <name>yarn.resourcemanager.webapp.address</name>
        <value>master_node:8088</value>
      </property>
      <property>
        <name>yarn.resourcemanager.webapp.https.address</name>
        <value>master_node:8090</value>
      </property>

答案 2 :(得分:1)

您需要为yarn.resourcemanager.hostname属性设置ip。如果要使用主机名,则计算机需要知道该主机名指向的ip。因此,您需要在 / etc / hosts 文件中添加主机条目。

要做到这一点,

  1. 打开终端

  2. 输入 vim / etc / hosts 并按Enter键

  3. 在文件末尾添加此行(使用键i启用插入)

    <your resourcemanager ip><space><your hostname>

    example: `192.168.1.23 master-node`
    
  4. 输入<Esc> +:wq

  5. 保存文件
  6. 重新启动nodemanager

  7. 我建议使用ambari类管理工具来做这些事情。这允许在hadoop环境中随时轻松修改配置。因为手工工作总是有更多的错误机会。