Hadoop YARN:获取可用队列列表

时间:2017-02-17 22:11:58

标签: hadoop yarn

有没有办法从命令行获取所有可用YARN队列的列表,而无需求助于解析capacity-scheduler.xml文件?

我使用的是Hadoop 2.7.2版本

2 个答案:

答案 0 :(得分:7)

一种方法是使用ResourceManager REST API,例如:

curl '<resourcemanager_host>:<http_port>/ws/v1/cluster/scheduler' | jq '.scheduler.schedulerInfo.queues.queue[] | .queueName’

将列出所有热门级别的队列。

curl '<resourcemanager_host>:<http_port>/ws/v1/cluster/scheduler' | jq .

为您提供有关调度程序/队列的所有信息,因此使用jq您可以从中获取任何信息。

答案 1 :(得分:5)

您还可以使用mapred命令行工具

me@here.com$ mapred queue -list
======================
Queue Name : root.tenant1
Queue State : running
Scheduling Info : Capacity: 0.0, MaximumCapacity: UNDEFINED, CurrentCapacity: 0.0
    ======================
    Queue Name : root.tenant1.default
    Queue State : running
    Scheduling Info : Capacity: 0.0, MaximumCapacity: UNDEFINED, CurrentCapacity: 0.0
    ======================
    Queue Name : root.tenant1.users
    Queue State : running
    Scheduling Info : Capacity: 0.0, MaximumCapacity: UNDEFINED, CurrentCapacity: 0.0
======================
Queue Name : root.tenant2
Queue State : running
Scheduling Info : Capacity: 0.0, MaximumCapacity: UNDEFINED, CurrentCapacity: 0.0
    ======================
    Queue Name : root.tenant2.default
    Queue State : running
    Scheduling Info : Capacity: 0.0, MaximumCapacity: UNDEFINED, CurrentCapacity: 0.0
    ======================
    Queue Name : root.tenant2.users
    Queue State : running
    Scheduling Info : Capacity: 0.0, MaximumCapacity: UNDEFINED, CurrentCapacity: 0.0
======================

它提供了带有层次结构的漂亮输出