我执行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>
修改配置文件后,分别在主设备和从设备上重新启动resourcemanager
和nodemanager
。
但是当我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')
如何将我的从属节点连接到主节点?
答案 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 文件中添加主机条目。
要做到这一点,
打开终端
输入 vim / etc / hosts 并按Enter键
在文件末尾添加此行(使用键i启用插入)
<your resourcemanager ip><space><your hostname>
example: `192.168.1.23 master-node`
输入<Esc>
+:wq
重新启动nodemanager
我建议使用ambari类管理工具来做这些事情。这允许在hadoop环境中随时轻松修改配置。因为手工工作总是有更多的错误机会。