Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hadoop YARN: Get a list of available queues

Is there a way to get a list of all available YARN queues from the command line, without resorting to parsing the capacity-scheduler.xml file?

I'm using Hadoop version 2.7.2

like image 662
foglerit Avatar asked Feb 17 '17 22:02

foglerit


People also ask

How do you list applications on yarn?

Call "yarn application -list": Shows all applications in states "SUBMITTED", "ACCEPTED" and "RUNNING" For e.g. for me output is below (there are zero applications in default states)

What is yarn queue in Hadoop?

The Yarn Capacity Scheduler allows for multiple tenants in an HDP cluster to share compute resources according to configurable workload management policies. The YARN Queue Manager View is designed to help Hadoop operators configure these policies for YARN.


2 Answers

You can use the hadoop builtin mapred command-line tool

[email protected]$ 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
======================

it provides a simple and nice output with hierarchy

like image 62
Baptiste Mille-Mathias Avatar answered Oct 24 '22 03:10

Baptiste Mille-Mathias


One way is to use ResourceManager REST API, for example:

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

will list all top level queues.

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

gives you all kind of information about scheduler/queues, thus using jq you can get any information out of it.

like image 39
rav Avatar answered Oct 24 '22 03:10

rav