Support Questions

Find answers, ask questions, and share your expertise

list of nodes for an application id from command line

avatar
Rising Star

Is it possible to list the nodes for an application id from command line?

ie i want to see all the nodes involved in a job - from the command line.

Appreciate the feedback.

1 ACCEPTED SOLUTION

avatar
Expert Contributor

Not sure about direct command.

But you can use some shell script.

Script:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

for a in `yarn applicationattempt -list application_1522234336469_0002|grep appattempt|awk '{print $1}'`

do

echo "Attempt $a nodes"

for b in `yarn container -list $a|grep 'container_'| awk '{print $15}'`

do

echo "Node: $b"

done

done

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

Not sure about direct command.

But you can use some shell script.

Script:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

for a in `yarn applicationattempt -list application_1522234336469_0002|grep appattempt|awk '{print $1}'`

do

echo "Attempt $a nodes"

for b in `yarn container -list $a|grep 'container_'| awk '{print $15}'`

do

echo "Node: $b"

done

done

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

avatar
Rising Star

that was cool. thanks!!!

avatar
Expert Contributor

Hi @n c,

Could you please accept answer if you find it useful?

-Shubham

avatar
Expert Contributor

@n cIf above information helped you, Could you please accept answer?