我已經安裝了hadoop,我已經設置了JAVA_HOME,但仍然出現這個錯誤,爲什麼?Hadoop:安裝問題
/opt/hadoop/2.5.1/sbin: $JAVA_HOME
-bash: /opt/java/6.0: Is a directory
/opt/hadoop/2.5.1/sbin: ./start-dfs.sh
Starting namenodes on [localhost]
localhost: Error: JAVA_HOME is not set and could not be found.
localhost: Error: JAVA_HOME is not set and could not be found.
Starting secondary namenodes [0.0.0.0]
0.0.0.0: Error: JAVA_HOME is not set and could not be found.
/opt/hadoop/2.5.1/sbin:
如果我嘗試:
sh start-dfs.sh
start-dfs.sh: 82: /opt/hadoop/2.5.1/sbin/../libexec/hadoop-config.sh: Syntax error: word unexpected (expecting ")")
你在'$ HADOOP_HOME/conf目錄/ Hadoop的設置JAVA_HOME -env.sh'呢? – vefthym 2014-09-23 13:08:56
將導出$ JAVA_HOME添加到.profile或.bash_profile的末尾,使用源.bash_profile執行它,然後啓動hadoop – Satya 2014-09-23 13:12:03
您需要在「yarn-env.sh」中爲hadoop 2.x設置JAVA_HOME。可以找到此文件在可以在/ etc/hadoop下看到hadoop-env.sh的相同路徑上 – user3484461 2014-09-23 13:58:03