从主节点请求工作节点的YARN属性

时间:2018-01-12 02:44:39

标签: hadoop bigdata yarn distributed-computing

如果我在Hadoop集群的主节点上,我可以转到yarn-site.xml并查看属性yarn.nodemanager.resource.memory-mbyarn.nodemanager.resource.cpu-vcores,例如,仅用于主节点。

如果我的工作节点是与主节点不同的机器类型(例如,有更多的内存或CPU),它们显然会对这些相同的属性有不同的值,但据我所知,我不能在主节点上的任何文件中查看这些值。

有没有办法为工作节点获取这些值而无需连接其中一台机器并访问其yarn-site.xml?我提出这个问题的原因是我希望能够以编程方式部署基于其运行的集群的配置文件的配置,但是这些作业是从主节点提交的(通常与主节点相比非常小)任务节点)。

编辑:This页面介绍了如何向RM REST API提交HTTP请求以获取有关群集的信息。我的yarn-site.xml是属性

<property>
  <name>yarn.resourcemanager.address</name>
  <value><http address>:8032</value>
</property>

但是如果我输入curl http://<http address>:8032/ws/v1/cluster/metrics -XGET,它会响应:

It looks like you are making an HTTP request to a Hadoop IPC port. This is not the correct port for the web interface on this daemon.

我应该尝试另一个端口,还是我应该以不同的方式提出请求?

1 个答案:

答案 0 :(得分:0)

以下作品:

$ curl http://$(hostname):8088/ws/v1/cluster/metrics
{"clusterMetrics":{"appsSubmitted":0,"appsCompleted":0,"appsPending":0,"appsRunning":0,"appsFailed":0,"appsKilled":0,"reservedMB":0,"availableMB":116736,"allocatedMB":0,"reservedVirtualCores":0,"availableVirtualCores":16,"allocatedVirtualCores":0,"containersAllocated":0,"containersReserved":0,"containersPending":0,"totalMB":116736,"totalVirtualCores":16,"totalNodes":1,"lostNodes":0,"unhealthyNodes":0,"decommissionedNodes":0,"decommissioningNodes":0,"rebootedNodes":0,"activeNodes":1}}
相关问题