YARN ContainerIDs from the client

Is it possible to get container identifiers and host names from the YARN client after the client has sent appContext? I suppose this will mean that after the containers are allocated, can the information be transferred to the client?

If this is not possible, does this RM web interface provide this information?

+4
source share
2 answers

YARN CLI has the ability to get the list of containers from the application attempt identifier. You can get the list of containers by following these steps.

  • Step 1: Get Application Attempt List from Application ID

    From the application identifier YARN, you can get a list of application attempts using the following command:

    yarn applicationattempt -list <Application ID>
    

    :

    -list <Application ID>    List application attempts for application.
    

    ,

    yarn applicationattempt -list application_1452267331813_0009
    
  • 2.

    , :

    yarn container -list <Application Attempt ID>
    

    :

    -list <Application Attempt ID>    List containers for application attempt.
    

    ,

    yarn container -list appattempt_1452267331813_0009_000001
    
+2

, URL- ResourceManager, NodeManager URL- ContainerLog:

# Resource Manager Info for Given Application
curl http://RM:PORT/ws/v1/cluster/apps/<app_id>

amHostHttpAddress = data['app']['amHostHttpAddress']

# List containers with id, nodeId, containerLogsLink, etc
curl http://<amHostHttpAddress>/ws/v1/node/containers

# stdout/stderr for a specific container
curl http://<containerLogsLink>/stdout/?start=0"
curl http://<containerLogsLink>/stderr/?start=0"

, , , YARN JAVA API

0

Source: https://habr.com/ru/post/1623470/


All Articles