You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Jae-Hyuck Kwak <jh...@kisti.re.kr> on 2017/12/12 01:49:36 UTC

getting pid for yarn container

Hi,
I'd like to monitor actual resource usage (cpu utilization, memory 
usage, io usage, etc)
of the yarn containers by external tools.

Is there any way to get process id(pid) of yarn container?

BR,
Jae-Hyuck




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@hadoop.apache.org
For additional commands, e-mail: user-help@hadoop.apache.org


Re: getting pid for yarn container

Posted by Sebastian Nagel <wa...@googlemail.com>.
Hi,

I don't know whether there is a more efficient way, but this works:
 1. get the host name or IP of the node the container is running
 2. login to this node
 3. grep the process table for the container ID (it's passed as argument to Java)
    $ ps aux | grep container_...
    yarn  16076  .../bin/java ...
-Dyarn.app.container.log.dir=.../yarn/log/application_1512553291624_0087/container_1512553291624_0087_01_000796
 4. the pid is 16076

Best,
Sebastian

On 12/12/2017 02:49 AM, Jae-Hyuck Kwak wrote:
> Hi,
> I'd like to monitor actual resource usage (cpu utilization, memory usage, io usage, etc)
> of the yarn containers by external tools.
> 
> Is there any way to get process id(pid) of yarn container?
> 
> BR,
> Jae-Hyuck
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@hadoop.apache.org
> For additional commands, e-mail: user-help@hadoop.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@hadoop.apache.org
For additional commands, e-mail: user-help@hadoop.apache.org