Bruckwald
Bruckwald

Reputation: 797

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?

Upvotes: 6

Views: 5934

Answers (2)

qfwfq
qfwfq

Reputation: 2516

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.

Upvotes: 10

Alex
Alex

Reputation: 8937

You can find them using Resource manager UI. Find your application by ID among the existing applications and click on the link with ID you have. You will see your application stats. Fint the tracking URL and click on the link 'History'. There you'll be able to find the tasks in your map operation and recude optration. You can open each task and see the information, to which node it was assigned for, nubmer of attempts, logs for each task and attempts and lots of other usefull information.

For getting the information about the container status from command line you can use yarn container -status command from bash

Upvotes: 0

Related Questions