[ 
https://issues.apache.org/jira/browse/YARN-561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13630626#comment-13630626
 ] 

Xuan Gong commented on YARN-561:
--------------------------------

when container starts as a process, it does not know its containerId. Does it 
mean when we execute the script to launch the container, the script does not 
include this containerId ? 
If I understand it correctly, we can solve this issue like this:
1. We need to add some content into enum Environment, such as 
ContainerId(String)(Which can be converted back by using 
ConverterUtils.toContainerId(String containerId)), NM hostName(String), 
NMPort(int).
2. The container Launch script is write out at ContainerLaunch::call(), and the 
environment is also set here. At ContainerLaunch, we already have 
org.apache.hadoop.yarn.server.nodemanager.containermanager.container, so 
containerId can be simply get. The NM hostName and NMPort can be get from 
NM_NodeId which is in NMContext. And ContainerLaunch is initialized from 
ContainerLauncher which already has NMContext. So, we can make changes here, 
when we initialize the ContainerLaunch, we either input NMContext as parameter, 
or simply give NM_NodeId, or just give NM_hostName and NMPort, then we can get 
all the information we need. 
Any other suggestions ??
                
> Nodemanager should set some key information into the environment of every 
> container that it launches.
> -----------------------------------------------------------------------------------------------------
>
>                 Key: YARN-561
>                 URL: https://issues.apache.org/jira/browse/YARN-561
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Hitesh Shah
>            Assignee: Xuan Gong
>              Labels: usability
>
> Information such as containerId, nodemanager hostname, nodemanager port is 
> not set in the environment when any container is launched. 
> For an AM, the RM does all of this for it but for a container launched by an 
> application, all of the above need to be set by the ApplicationMaster. 
> At the minimum, container id would be a useful piece of information. If the 
> container wishes to talk to its local NM, the nodemanager related information 
> would also come in handy. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to