Hadoop YARN:获取可用队列列表
Hadoop YARN: Get a list of available queues
有没有办法从命令行获取所有可用 YARN 队列的列表,而无需解析 capacity-scheduler.xml
文件?
我使用的是 Hadoop 版本 2.7.2
一种方法是使用 ResourceManager REST API,例如:
curl '<resourcemanager_host>:<http_port>/ws/v1/cluster/scheduler' | jq '.scheduler.schedulerInfo.queues.queue[] | .queueName’
将列出所有 top 级队列。
curl '<resourcemanager_host>:<http_port>/ws/v1/cluster/scheduler' | jq .
为您提供有关 scheduler/queues 的各种信息,因此使用 jq
您可以从中获取任何信息。
您可以使用内置的 hadoop 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
======================
它提供了一个简单而漂亮的层次结构输出
有没有办法从命令行获取所有可用 YARN 队列的列表,而无需解析 capacity-scheduler.xml
文件?
我使用的是 Hadoop 版本 2.7.2
一种方法是使用 ResourceManager REST API,例如:
curl '<resourcemanager_host>:<http_port>/ws/v1/cluster/scheduler' | jq '.scheduler.schedulerInfo.queues.queue[] | .queueName’
将列出所有 top 级队列。
curl '<resourcemanager_host>:<http_port>/ws/v1/cluster/scheduler' | jq .
为您提供有关 scheduler/queues 的各种信息,因此使用 jq
您可以从中获取任何信息。
您可以使用内置的 hadoop 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
======================
它提供了一个简单而漂亮的层次结构输出