启动start-all.sh时出现如下错误:
- root@ubuntu:/home/chenwq/hadoop/hadoop-0.21.0/bin# start-all.sh
- This script is Deprecated. Instead use start-dfs.sh and start-mapred.sh
- starting namenode, logging to /home/chenwq/hadoop/hadoop-0.21.0/bin/../logs/hadoop-root-namenode-ubuntu.out
- localhost: Error: JAVA_HOME is not set.
- localhost: Error: JAVA_HOME is not set.
- starting jobtracker, logging to /home/chenwq/hadoop/hadoop-0.21.0/bin/../logs/hadoop-root-jobtracker-ubuntu.out
- localhost: Error: JAVA_HOME is not set.
解决办法:
在hadoop-0.21.0/conf/文件夹里有个hadoop-env.sh的文件,它的作用是配置与hadoop运行环境相关的变量,
- export JAVA_HOME=/usr/lib/jvm/java-6-sun