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 9275390F8 for ; Tue, 11 Oct 2011 12:27:36 +0000 (UTC) Received: (qmail 70775 invoked by uid 500); 11 Oct 2011 12:27:33 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 70729 invoked by uid 500); 11 Oct 2011 12:27:33 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 70721 invoked by uid 99); 11 Oct 2011 12:27:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 12:27:33 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of maheswara@huawei.com designates 206.16.17.211 as permitted sender) Received: from [206.16.17.211] (HELO usaga01-in.huawei.com) (206.16.17.211) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 12:27:27 +0000 Received: from huawei.com (usaml01-in [172.18.4.6]) by usaga01-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0LSW008TOIL6GA@usaga01-in.huawei.com> for common-user@hadoop.apache.org; Tue, 11 Oct 2011 07:27:06 -0500 (CDT) Received: from huawei.com ([172.17.1.90]) by usaga01-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0LSW0099UIL4IS@usaga01-in.huawei.com> for common-user@hadoop.apache.org; Tue, 11 Oct 2011 07:27:05 -0500 (CDT) Received: from [172.24.1.33] (Forwarded-For: [10.18.1.36]) by szxmc01-in.huawei.com (mshttpd); Tue, 11 Oct 2011 17:27:04 +0500 Date: Tue, 11 Oct 2011 17:27:04 +0500 From: Uma Maheswara Rao G 72686 Subject: Re: How to get number of live nodes in hadoop In-reply-to: To: common-user@hadoop.apache.org Message-id: MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 2.14 (built Aug 8 2006) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal References: Hello Raimon, In DFS to know the DN status you can use getDataNodeStats API from Distributed fileSystem. In MR, to know the number of active trackers, you can use getClusterStatus from jobclient. It will give other stats as well. Hope this will help. Regards, Uma ----- Original Message ----- From: Raimon Bosch Date: Tuesday, October 11, 2011 5:48 pm Subject: How to get number of live nodes in hadoop To: common-user@hadoop.apache.org > Hi, > > Following this instructions at > http://wiki.apache.org/hadoop/HowManyMapsAndReduces I've read that > the best > amount of reducers for one process is 0.95 or 1.75 * (nodes * > mapred.tasktracker.tasks.maximum) so I would like to call > to conf.setNumReduceTasks(int num) according to how many nodes I have > working. > > So how can I get the number of live nodes from my hadoop code? > > Thanks in advance, > Raimon Bosch. >