Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 379EA188AA for ; Thu, 28 May 2015 17:14:57 +0000 (UTC) Received: (qmail 58284 invoked by uid 500); 28 May 2015 17:14:55 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 58216 invoked by uid 500); 28 May 2015 17:14:55 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 58197 invoked by uid 99); 28 May 2015 17:14:55 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 17:14:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D483D1A3687 for ; Thu, 28 May 2015 17:14:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.099 X-Spam-Level: X-Spam-Status: No, score=-0.099 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=altiscale.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id vthw-gApd2WQ for ; Thu, 28 May 2015 17:14:42 +0000 (UTC) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id D891D20696 for ; Thu, 28 May 2015 17:14:41 +0000 (UTC) Received: by pdfh10 with SMTP id h10so46073778pdf.3 for ; Thu, 28 May 2015 10:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=altiscale.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=gj929oWXAKDMe0w8G5RZQ3vSjrR1nEbZda+R2wWVdy4=; b=q2xQl3qZYK3686tqg9BOhiUqTzv4/rp6NwvpyGR0eQVDOZMtnysfHgQXskB+NI3pW5 fhJ9ADwZ3qrZeLXkwugBEZG85Bur+KhfA+etIgQIzI2qMS4x+ET/5NZI33sxY7xLh9QM jJmtybehFPAERbeJM8OxpkTIZKJJXmrHlYVXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=gj929oWXAKDMe0w8G5RZQ3vSjrR1nEbZda+R2wWVdy4=; b=B+gFhrv7fkrUhqpy8t4rcmodw4Zj47g+r5P5ByKKOF1IkF0ecAbRRkZH1cahh8p+1a dLL45tGXL5mWCEJ4z/peyJCRB9TbV58Md1zqwsKCoGpyOF5BA+LHBw4XWSA+kbD4imjD b7b2O+K5QPSSHdD0f47ZqaL4L8d6aVkW5zVk+IBdtVn1IHWPbhjUHJ6I0ewHKes72Zd0 HwaLSn/rKxVjnUjusZEnXo8IYuTuF7wRPJqSFtBVluykYWExnAewuV3JnYz1aHOQ3YbB dOQVP8CXg5O/o5NPK/uRw44sesk2PZcXykd9mdI+QOlktz3eblqJc3rNtgI6oDPzi1en d7uA== X-Gm-Message-State: ALoCoQk7dbTSxVJ1xk7nJ6sjtPmDoCu5MZj+EDCa7gK+2EyE7+RC/HW/tmgcpnEIagPLFvlvBOCA X-Received: by 10.70.25.37 with SMTP id z5mr7524002pdf.36.1432833236447; Thu, 28 May 2015 10:13:56 -0700 (PDT) Received: from [10.248.3.70] (75-149-34-225-SFBA.hfc.comcastbusiness.net. [75.149.34.225]) by mx.google.com with ESMTPSA id cu8sm2985745pad.1.2015.05.28.10.13.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 May 2015 10:13:55 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: use of HADOOP_HOME From: Allen Wittenauer In-Reply-To: Date: Thu, 28 May 2015 10:13:49 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <39AA035D-F917-435A-AD0A-AAA4CAE8519F@altiscale.com> References: To: common-dev@hadoop.apache.org X-Mailer: Apple Mail (2.1878.6) On May 28, 2015, at 9:36 AM, Sangjin Lee wrote: > Hi folks, >=20 > I noticed this while setting up a cluster based on the current trunk. = It > appears that setting HADOOP_HOME is now done much later (in > hadoop_finalize) than branch-2. Importantly this is set *after* > hadoop-env.sh (or yarn-env.sh) is invoked. >=20 > In our version of hadoop-env.sh, we have used $HADOOP_HOME to define = some > more variables, but it appears that we can no longer rely on the > HADOOP_HOME value in our *-env.sh customization. Is this an intended = change > in the recent shell script refactoring? What is the right thing to use = in > hadoop-env.sh for the location of hadoop? a) HADOOP_HOME was deprecated on Unix systems as part of (IIRC) = 0.21. HADOOP_PREFIX was its replacement. (No, I never understood the = reasoning for this either.) Past 0.21, it was never safe to rely upon = HADOOP_HOME in *-env.sh files unless it is set prior to running the = shell commands. b) That said, functionality-wise, HADOP_HOME is being set in = pretty much the same place in the code flow. *-env.sh has already been = processed in both branch-2 and trunk by the time HADOOP_HOME is = configured. trunk only configures HADOOP_HOME for backward = compatibility. The rest of the code uses HADOOP_PREFIX as expected and = very very early on the lifecycle. =20 What you are likely seeing is the result of a bug fix: trunk = doesn=92t reprocess *-env.sh files when using the shin commands whereas = branch-2 does it several times over. (This is also one of the reasons = why Java command line options are duplicated too.) So it likely worked = for you because of this broken behavior. In my mind, it is a better practice to configure = HADOOP_HOME/HADOOP_PREFIX outside of the *-env.sh files (e.g., = /etc/profile.d on Linux) so that one can use them for PATH, etc. That = should guarantee expected behavior.