当前位置:   article > 正文

hadoop start-dfs.sh Error: JAVA_HOME is not set and could not be found

hadoop start-dfs.sh Error: JAVA_HOME is not set and could not be found

# sbin/start-dfs.sh 报错如下


[hadoop@vm7 hadoop-2.7.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.

解决:

# vim  /home/hadoop/.bashrc 添加如下内容

export JAVA_HOME=/usr/local/jdk1.7.0_65
export PATH=$PATH:$JAVA_HOME/bin
export HADOOP_PREFIX=/home/hadoop/hadoop-2.7.1


再次启动

# sbin/start-dfs.sh

[hadoop@vm7 hadoop-2.7.1]$ sbin/start-dfs.sh 
Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/hadoop/hadoop-2.7.1/logs/hadoop-hadoop-namenode-vm7.0.out
localhost: starting datanode, logging to /home/hadoop/hadoop-2.7.1/logs/hadoop-hadoop-datanode-vm7.0.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/hadoop/hadoop-2.7.1/logs/hadoop-hadoop-secondarynamenode-vm7.0.out

ok!


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/574544
推荐阅读
相关标签
  

闽ICP备14008679号