Hadoop Common
  1. Hadoop Common
  2. HADOOP-7894

bin and sbin commands don't use JAVA_HOME when run from the tarball

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 0.23.0
    • Fix Version/s: None
    • Component/s: build
    • Labels:
      None

      Description

      When running eg ./sbin/start-dfs.sh from a tarball the scripts complain JAVA_HOME is not set and could not be found even if the env var is set.

      hadoop-0.24.0-SNAPSHOT $ echo $JAVA_HOME
      /home/eli/toolchain/jdk1.6.0_24-x64
      hadoop-0.24.0-SNAPSHOT $ ./sbin/start-dfs.sh 
      log4j:ERROR Could not find value for key log4j.appender.NullAppender
      log4j:ERROR Could not instantiate appender named "NullAppender".
      Starting namenodes on [localhost]
      localhost: Error: JAVA_HOME is not set and could not be found.
      

      I have to explicitly set this via hadoop-env.

        Issue Links

          Activity

          Eli Collins created issue -
          Hide
          Steve Loughran added a comment -

          seen this in MAPREDUCE-3432 too; I will link that as cause-by this issue

          Show
          Steve Loughran added a comment - seen this in MAPREDUCE-3432 too; I will link that as cause-by this issue
          Steve Loughran made changes -
          Field Original Value New Value
          Link This issue relates to MAPREDUCE-3432 [ MAPREDUCE-3432 ]
          Arun C Murthy made changes -
          Target Version/s 0.23.1 [ 12318884 ] 0.23.2 [ 12319855 ]
          Robert Joseph Evans made changes -
          Target Version/s 0.23.2 [ 12319855 ] 2.0.0, 3.0.0 [ 12320352, 12320357 ]
          Hide
          Eli Reisman added a comment -

          Hey, did anyone ever come up with a one-size-fits-all solution to this? I am trying to configure 2.0.2-alpha and can't get JAVA_HOME to show up. I'm running on Ubuntu, and have gotten numerous non-YARN hadoop versions to run fine on this machine. Even when I hardcode my JAVA_HOME into

          {start,stop}-dfs.sh and {start,stop}

          -yarn.sh, add then to my bash profiles, source various config scripts, etc. nothing seems to work. Will report back when something works, but if anyone knows a quick workaround for linux right now that would be fantastic.

          Show
          Eli Reisman added a comment - Hey, did anyone ever come up with a one-size-fits-all solution to this? I am trying to configure 2.0.2-alpha and can't get JAVA_HOME to show up. I'm running on Ubuntu, and have gotten numerous non-YARN hadoop versions to run fine on this machine. Even when I hardcode my JAVA_HOME into {start,stop}-dfs.sh and {start,stop} -yarn.sh, add then to my bash profiles, source various config scripts, etc. nothing seems to work. Will report back when something works, but if anyone knows a quick workaround for linux right now that would be fantastic.
          Hide
          Eli Collins added a comment -

          Have you tried setting JAVA_HOME in just hadoop-env.sh? That's always worked for me.

          Show
          Eli Collins added a comment - Have you tried setting JAVA_HOME in just hadoop-env.sh? That's always worked for me.
          Hide
          Eli Reisman added a comment -

          You know, I did, and it didn't pick up. I also tried the env_keep sudoers fix mentioned in another thread, etc. and no dice. In the end (running ubuntu) I had to hardcode the JAVA_HOME and a few other env vars into the env scripts in the run scripts in order to get my 2.0.2-alpha YARN, HDFS, and MR all running successfully. I'm on the wrong machine but if you're curious let me know and I can post a more detailed idea of what ended up working, if it helps diagnose the problem. Its certainly not ideal, but it is getting me by for now. Thanks for the advice!

          Show
          Eli Reisman added a comment - You know, I did, and it didn't pick up. I also tried the env_keep sudoers fix mentioned in another thread, etc. and no dice. In the end (running ubuntu) I had to hardcode the JAVA_HOME and a few other env vars into the env scripts in the run scripts in order to get my 2.0.2-alpha YARN, HDFS, and MR all running successfully. I'm on the wrong machine but if you're curious let me know and I can post a more detailed idea of what ended up working, if it helps diagnose the problem. Its certainly not ideal, but it is getting me by for now. Thanks for the advice!
          Hide
          Allen Wittenauer added a comment -

          Fixed in trunk.

          Show
          Allen Wittenauer added a comment - Fixed in trunk.
          Allen Wittenauer made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Not a Problem [ 8 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Eli Collins
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development