Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YARN: get containers by applicationId

I'd like to list the nodes on which the containers are running for a particular MR job.
I only have the application_id.
Is it possible to do it with Hadoop REST API and/or through command line?

like image 479
Bruckwald Avatar asked Feb 07 '23 12:02

Bruckwald


1 Answers

This can be done using the yarn command.

  1. Run yarn applicationattempt -list <Application Id> to get an app attempt id
  2. Run yarn container -list <Application Attempt Id> to get the container ids
  3. Run yarn container -status <Container Id> to get the host for any particular container.

If you want this in a bash script or want to get every host for an application with a large number of containers you will probably want to parse out the attempt/container id and host, but this is at least a start.

like image 173
qfwfq Avatar answered Feb 09 '23 01:02

qfwfq