Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BDEA1862A for ; Thu, 10 Mar 2016 22:43:52 +0000 (UTC) Received: (qmail 17281 invoked by uid 500); 10 Mar 2016 22:43:47 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 17176 invoked by uid 500); 10 Mar 2016 22:43:46 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 17144 invoked by uid 99); 10 Mar 2016 22:43:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2016 22:43:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DAFE91806D3 for ; Thu, 10 Mar 2016 22:43:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.721 X-Spam-Level: X-Spam-Status: No, score=-0.721 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=amakuru-net.20150623.gappssmtp.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id VxGHDHTQW1uk for ; Thu, 10 Mar 2016 22:43:43 +0000 (UTC) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id E3FB55F2C3 for ; Thu, 10 Mar 2016 22:43:42 +0000 (UTC) Received: by mail-wm0-f47.google.com with SMTP id p65so6677739wmp.1 for ; Thu, 10 Mar 2016 14:43:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amakuru-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3elwgvW3Ka7drcRRHmg5lTfJFTYz/2tpcdH8HyOgCSQ=; b=1/bP17z6gFTJC/wvSEu8odERKl+zynP9qfRIV3RUaSSzXaSpZfVTvb+PvQWd/frOL5 xfDumNtTuJcqQWzAMdCyUKcitMnhVY+aZ9TCpNIbHrS2OxJu5amgpNXqDzSFD1l71Hp9 MQSC03mara34Gp85ZlKZDCnhFPhTBX/bcsrJrIx7sIJNcBD/0ETRNXCXl6f/uEVPZWPO kWVK30O3CiTHY6F0sPfH5uiKutSCNNdoMP7/u0CtttVWolPIbya7o2DsYJDwWImoJ9yV LNnojC+ZHMZ9eu5SSuNI2BC3ufkOafueMDtnGVLl1K8tSLbURJlA3t4N1yKKNp7MG7H1 0i2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3elwgvW3Ka7drcRRHmg5lTfJFTYz/2tpcdH8HyOgCSQ=; b=JpUC1lIncBqysMY0ZVH1+sacs5oa/xXx4fwyPzVAGVM+biDyyiFZ5oYXvuDxgf5APK gFQp716Zqg8TxuSAodNy+y6UjotnZXE9Z+x+Om4KwQMETEyYKz2odrWegoKoOIcxAsrt sE/YXXEyX4XxfHWgc2y8qqxjUKs4Jl6gJ76CEfl83nhBq4C4gyTzhzmwkvcr/QTP/uq7 DBJWPO4I7KqhYsf3ADKOBUMboDt9aiSX2mnWdC4Uj4EHclgko1yjENmg+YtAUESNeNEw KvspAAv/Ni8+AWKP74TlhpgO8K1yq5qp4GXCwn+FbjzBr/oUmK7vejuHLxRcgbGhMEPb hZJw== X-Gm-Message-State: AD7BkJKxZgvaw42WN/7mrJ1mu339qa1b+f80BM6dWe5QXpGRRtUsEyfSNb5kwsMDIdBckw== X-Received: by 10.194.90.229 with SMTP id bz5mr6893385wjb.143.1457649822591; Thu, 10 Mar 2016 14:43:42 -0800 (PST) Received: from [192.168.0.12] (ip-196.net-89-2-124.rev.numericable.fr. [89.2.124.196]) by smtp.gmail.com with ESMTPSA id 63sm688336wms.1.2016.03.10.14.43.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 Mar 2016 14:43:41 -0800 (PST) From: "David Morel" To: "Frank Luo" Cc: "David Morel" , "Jeff Zhang" , "user@hadoop.apache.org" Subject: Re: how to use Yarn API to find task/attempt status Date: Thu, 10 Mar 2016 23:43:40 +0100 Message-ID: <07509848-66BA-40DB-84CE-D11085FCAE67@amakuru.net> In-Reply-To: <1EFFC0EDF85B044A99A02C925FDA3755200DECA4@HQITEXCH07.pclc0.merkle.local> References: <1EFFC0EDF85B044A99A02C925FDA3755200DE06B@HQITEXCH07.pclc0.merkle.local> <1EFFC0EDF85B044A99A02C925FDA3755200DE139@HQITEXCH07.pclc0.merkle.local> <1EFFC0EDF85B044A99A02C925FDA3755200DECA4@HQITEXCH07.pclc0.merkle.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: MailMate (1.9.4r5226) On 10 Mar 2016, at 18:21, Frank Luo wrote: > Thanks David/Jeff. > > To avoid further confusions, let me make sure I am clear on what I am = > trying to do: I would like to know how many hours in a day my cluster = > is running at its full capacity, and when that happens, how long is my = > waiting queue. I founded similar information on Ambari as below, but = > I=E2=80=99d like to dive deeper, hence asking. > > From what I see, container per job information, especially pending = > containers, is only available from an application=E2=80=99s trackingUrl= , but = > that just applies to M/R jobs. I am not able to get the same = > information from a Tez applications=E2=80=99 trackingUrl (Tez=E2=80=99s= url = > doesn=E2=80=99t do anything for hdp2.2). So how does Ambari find the = > information out? Using the REST API you'd query the resource manager's "apps" method, = then the appmasters through the RM proxy with the "jobs" method = (sequentially, using the app ids found at step 1 in turn). Works for MR, = there used to be an issue with spark jobs, haven't looked at that. This = is only for running jobs; you'd probably want to query the history = server too which may return more complete info with less indirection. = Also, have a look at the "scheduler" method on the RM, which you may = find useful. The docs are here: https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/Resour= ceManagerRest.html https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/NodeMa= nagerRest.html For MR stuff: https://hadoop.apache.org/docs/r2.7.1/hadoop-mapreduce-client/hadoop-mapr= educe-client-core/MapredAppMasterRest.html https://hadoop.apache.org/docs/r2.7.1/hadoop-mapreduce-client/hadoop-mapr= educe-client-hs/HistoryServerRest.html But most useful is probably the timeline server, which I didn't have a = chance to use and possibly provides what you need: https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/Timeli= neServer.html#Timeline_Server_REST_API_v1 All this from memory since I haven't touched a cluster lately, and = hoping it's not completely missing the point ;-) David > > > [cid:image001.png@01D17ABE.06C936C0] > > From: David Morel [mailto:dmorel@amakuru.net] > Sent: Thursday, March 10, 2016 1:03 AM > To: Jeff Zhang > Cc: user@hadoop.apache.org; Frank Luo > Subject: Re: how to use Yarn API to find task/attempt status > > > The REST API should help. A working implementation (in perl, not java, = > sorry) is visible here : http://search.cpan.org/dist/Net-Hadoop-YARN/ > Read the comments, they matter :-) > Le 10 mars 2016 7:28 AM, "Jeff Zhang" = > > a =C3=A9crit : > If it is for M/R, then maybe this is what you want > https://hadoop.apache.org/docs/r2.6.0/api/org/apache/hadoop/mapreduce/J= obStatus.html > > > > On Thu, Mar 10, 2016 at 1:58 PM, Frank Luo = > > wrote: > Let=E2=80=99s say there are 10 standard M/R jobs running. How to find h= ow = > many tasks are done/running/pending? > > From: Jeff Zhang [mailto:zjffdu@gmail.com] > Sent: Wednesday, March 09, 2016 9:33 PM > To: Frank Luo > Cc: user@hadoop.apache.org > Subject: Re: how to use Yarn API to find task/attempt status > > I don't think it is related with yarn. Yarn don't know about task/task = > attempt, it only knows containers. So it should be your application to = > provide such function. > > On Thu, Mar 10, 2016 at 11:29 AM, Frank Luo = > > wrote: > Anyone had a similar issue and knows the answer? > > From: Frank Luo > Sent: Wednesday, March 09, 2016 1:59 PM > To: 'user@hadoop.apache.org' > Subject: how to use Yarn API to find task/attempt status > > I have a need to programmatically find out how many tasks are pending = > in Yarn. Is there a way to do it through a Java API? > > I looked at YarnClient, but not able to find what I need. > > Thx in advance. > > Frank Luo > > This email and any attachments transmitted with it are intended for = > use by the intended recipient(s) only. If you have received this email = > in error, please notify the sender immediately and then delete it. If = > you are not the intended recipient, you must not keep, use, disclose, = > copy or distribute this email without the author=E2=80=99s prior permis= sion. = > We take precautions to minimize the risk of transmitting software = > viruses, but we advise you to perform your own virus checks on any = > attachment to this message. We cannot accept liability for any loss or = > damage caused by software viruses. The information contained in this = > communication may be confidential and may be subject to the = > attorney-client privilege. > > > > -- > Best Regards > > Jeff Zhang > > This email and any attachments transmitted with it are intended for = > use by the intended recipient(s) only. If you have received this email = > in error, please notify the sender immediately and then delete it. If = > you are not the intended recipient, you must not keep, use, disclose, = > copy or distribute this email without the author=E2=80=99s prior permis= sion. = > We take precautions to minimize the risk of transmitting software = > viruses, but we advise you to perform your own virus checks on any = > attachment to this message. We cannot accept liability for any loss or = > damage caused by software viruses. The information contained in this = > communication may be confidential and may be subject to the = > attorney-client privilege. > > > > -- > Best Regards > > Jeff Zhang > > This email and any attachments transmitted with it are intended for = > use by the intended recipient(s) only. If you have received this email = > in error, please notify the sender immediately and then delete it. If = > you are not the intended recipient, you must not keep, use, disclose, = > copy or distribute this email without the author=E2=80=99s prior permis= sion. = > We take precautions to minimize the risk of transmitting software = > viruses, but we advise you to perform your own virus checks on any = > attachment to this message. We cannot accept liability for any loss or = > damage caused by software viruses. The information contained in this = > communication may be confidential and may be subject to the = > attorney-client privilege. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@hadoop.apache.org For additional commands, e-mail: user-help@hadoop.apache.org