Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Re: YARN Container's App ID


Copy link to this message
-
Re: YARN Container's App ID
Yes - this is currently on trunk. There were some changes done to make the container id available to all containers ( and not only the AM ).

However, for 2.0.3-alpha, I believe you should have access to ApplicationConstants.AM_CONTAINER_ID_ENV in the AM's environment.

-- Hitesh

On Jun 11, 2013, at 12:14 PM, Brian C. Huffman wrote:

> Hitesh,
>
> Is this only in trunk?  I'm currently running 2.0.3-alpha and I don't see it there.  I also don't see it in the latest 2.0.5.
>
> Thanks,
> Brian
>
> On 06/11/2013 02:54 PM, Hitesh Shah wrote:
>> Hello Brian,
>>
>> org.apache.hadoop.yarn.api.ApplicationConstants.Environment should have a list of all the information set in the environment.
>>
>> One of these is the container ID. ApplicationAttemptID can be obtained from a container ID object which in turn can be used to get the App Id.
>>
>> -- Hitesh
>>
>> On Jun 11, 2013, at 11:47 AM, Brian C. Huffman wrote:
>>
>>> How can a YARN container get its own Application ID?
>>>
>>> I tried getting the ApplicationConstants.AM_APP_ATTEMPT_ID_ENV similar to how the Distributed Shell example does for the AppMaster, but that variable doesn't seem to exist in the environment for the container.  Does the App Master have to set it?
>>>
>>> Thanks,
>>> Brian
>>>
>
>