Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3D3B10F6A for ; Mon, 19 Aug 2013 08:46:08 +0000 (UTC) Received: (qmail 85478 invoked by uid 500); 19 Aug 2013 08:46:00 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 85295 invoked by uid 500); 19 Aug 2013 08:46:00 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 84864 invoked by uid 99); 19 Aug 2013 08:45:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2013 08:45:58 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erlv5241@gmail.com designates 209.85.219.49 as permitted sender) Received: from [209.85.219.49] (HELO mail-oa0-f49.google.com) (209.85.219.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2013 08:45:18 +0000 Received: by mail-oa0-f49.google.com with SMTP id n10so2421284oag.22 for ; Mon, 19 Aug 2013 01:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Bsa1LvwkI2hmOoCrRYvtKs3vC2SAs5FTV4x+HIC18FE=; b=v5YjXCgKU/I45JU3lSfEDwZoTkKrviZ7e/jh10R/qJ0jIXSXk3LzVfT9gXfgttnp9+ ci0xK8BXmglyBzrPLy83D9W0axX33q9ep5rSxCTsepCmPJZ+t/mbfJ1t9s2uAoiZnw9M D5G7rnTRuVtvod5p5xWEt3CLPixeIFk5jk+50Cg9CZUsMshgd91mxJTJ/Si56kDZUuWF 5+/+1zMMccjMBWd82ZWUJlUPgol2aNF+Wpbz/9/onkmob+Ks19t6nIVjRyJRWsnhEE89 N8zLL0KhBMchKj3hO+gdX3hI28rWENLprKIz9UAC5YugLuawsUg+FMYwqfgSTF1dLeWC RImg== X-Received: by 10.60.15.106 with SMTP id w10mr168144oec.82.1376901897950; Mon, 19 Aug 2013 01:44:57 -0700 (PDT) MIME-Version: 1.0 Sender: erlv5241@gmail.com Received: by 10.76.76.2 with HTTP; Mon, 19 Aug 2013 01:44:37 -0700 (PDT) In-Reply-To: References: From: Kun Ling Date: Mon, 19 Aug 2013 16:44:37 +0800 X-Google-Sender-Auth: HPzel_QgrJUZAZ1tmzLHE8saPbM Message-ID: Subject: Re: Is there any possible way to use hostname variable in mapred-site.xml file To: user Content-Type: multipart/alternative; boundary=089e01228384849fa804e448f4e0 X-Virus-Checked: Checked by ClamAV on apache.org --089e01228384849fa804e448f4e0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Binglin, Thanks for your kindly help. And your advice works well for me. yours, Kun Ling On Thu, Aug 15, 2013 at 5:51 PM, Binglin Chang wrote: > How about add -Dhost.name=3D`hostname` in HADOOP_OPTS > and get this variable in config file ${host.name} ? > I have not tried this, you can try this. > > > On Thu, Aug 15, 2013 at 5:26 PM, Kun Ling wrote: > >> Hi all, >> I have a Hadoop MapReduce Cluster. In which I want to adjust the >> mapred.local.dir, so that each TaskTracker can write to a mapred.local.d= ir >> with different name. And also make the conf file looks the same to make >> deployment easier. >> >> Currently, my plan is that each TaskTracker have hostname in its >> mapred.local.dir configuration. So the configuration in mapred-site.xml = is >> just like this: >> >> >> mapred.local.dir >> /var/mapred_local/*HOSTNAME*/ >> >> >> The problem is how to make TaskTracker automatically get the HOSTNAME= =EF=BC=9F >> I have look through all the .xml files in conf/ and jar files, but only >> get an variable ${user.name} which could be used to indicate the current >> hadoop username. >> >> >> Thanks very much . >> >> >> yours, >> Kun Ling >> >> >> -- >> http://www.lingcc.com >> > > --=20 http://www.lingcc.com --089e01228384849fa804e448f4e0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Binglin,
=C2=A0=C2=A0 Thanks fo= r your kindly help.
=C2=A0
=C2=A0=C2=A0 And your advice works = well for me.


yours,
Kun Ling


On Thu, Aug 15, 2013 at 5:51 PM, Binglin Chang <decstery@gmail.com>= ; wrote:
How about add -Dhost.name=3D`hostname` in=C2=A0HADOOP_OPTS=
and get this variable in config file ${host.name} ?
I have not tried this, you can t= ry this.


On Thu, Aug 15, 2013 at 5:26 PM, Kun Lin= g <lkun.erlv@gmail.com> wrote:
Hi all,
=C2=A0=C2=A0 I h= ave a Hadoop MapReduce Cluster. In which I want to adjust the mapred.local.= dir, so that each TaskTracker can write to a mapred.local.dir with differen= t name. And also make the conf file looks the same to make deployment easie= r.

=C2=A0=C2=A0=C2=A0 Currently, my plan is that each TaskTracker ha= ve hostname in its mapred.local.dir configuration. So the configuration in = mapred-site.xml is just like this:

=C2=A0 <property>
=C2=A0= =C2=A0=C2=A0 <name>mapred.local.dir</name>
=C2=A0=C2=A0=C2=A0 <value>/var/mapred_local/HOSTNAME/</valu= e>
=C2=A0 </property>

=C2=A0The problem is how to = make TaskTracker automatically get the HOSTNAME=EF=BC=9F I=C2=A0 have look = through all the .xml files in conf/ and jar files, but only get an variable= ${user.name} which coul= d be used to indicate the current hadoop username.


Thanks very much .


yours,
Kun Ling<= font color=3D"#888888">




--
http://www.lingcc.com
--089e01228384849fa804e448f4e0--