分享

Hadoop2.5.2环境搭建系统为64位,启动hdfs: ./sbin/start-dfs.sh报错

goo 发表于 2014-12-30 13:57:01 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 33819
按照网上教程的操作尝试搭建伪分布式,在启动hadoop时(./sbin/start-dfs.sh)报错如下:
  1. Starting namenodes on [localhost]
  2. localhost: starting namenode, logging to /opt/hadoop-2.5.2/logs/hadoop-root-namenode-xxw-node01.localdomain.out
  3. localhost: /opt/hadoop-2.5.2/bin/hdfs: line 28: which: command not found
  4. localhost: dirname: missing operand
  5. localhost: Try 'dirname --help' for more information.
  6. localhost: /opt/hadoop-2.5.2/bin/hdfs: line 34: /opt/hadoop-2.5.2/../libexec/hdfs-config.sh: No such file or directory
  7. localhost: /opt/hadoop-2.5.2/bin/hdfs: line 262: exec: : not found
  8. localhost: starting datanode, logging to /opt/hadoop-2.5.2/logs/hadoop-root-datanode-xxw-node01.localdomain.out
  9. localhost: /opt/hadoop-2.5.2/bin/hdfs: line 28: which: command not found
  10. localhost: dirname: missing operand
  11. localhost: Try 'dirname --help' for more information.
  12. localhost: /opt/hadoop-2.5.2/bin/hdfs: line 34: /opt/hadoop-2.5.2/../libexec/hdfs-config.sh: No such file or directory
  13. localhost: /opt/hadoop-2.5.2/bin/hdfs: line 262: exec: : not found
  14. Starting secondary namenodes [0.0.0.0]
  15. 0.0.0.0: starting secondarynamenode, logging to /opt/hadoop-2.5.2/logs/hadoop-root-secondarynamenode-xxw-node01.localdomain.out
  16. 0.0.0.0: /opt/hadoop-2.5.2/bin/hdfs: line 28: which: command not found
  17. 0.0.0.0: dirname: missing operand
  18. 0.0.0.0: Try 'dirname --help' for more information.
  19. 0.0.0.0: /opt/hadoop-2.5.2/bin/hdfs: line 34: /opt/hadoop-2.5.2/../libexec/hdfs-config.sh: No such file or directory
  20. 0.0.0.0: /opt/hadoop-2.5.2/bin/hdfs: line 262: exec: : not found
复制代码

希望各位帮忙解决一下,不胜感激!


已有(3)人评论

跳转到指定楼层
langke93 发表于 2014-12-30 19:54:06
本帖最后由 langke93 于 2014-12-30 19:55 编辑
hdfs的环境变量没有配置

增加下面红字部分。

首先vi /etc/profile,

#设置jdk的安装路径
    export JAVA_HOME=/opt/lib64/jdk1.8.0_20
    #指定CLASSPATH和PATH
    export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
    export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
    #设置的hadoop的环境变量
    export HADOOP_HOME=/opt/lib64/hadoop-2.5.1
    export PATH=$HADOOP_HOME/bin:$PATH
   export PATH=$HADOOP_HOME/sbin:$PATH
    export CLASSPATH=$HADOOP_HOME/lib:$CLASSPATH

回复

使用道具 举报

goo 发表于 2014-12-31 08:14:15
langke93 发表于 2014-12-30 19:54
本帖最后由 langke93 于 2014-12-30 19:55 编辑
hdfs的环境变量没有配置

奥,谢谢啦
回复

使用道具 举报

pengsuyun 发表于 2014-12-31 08:53:36

应该是环境变量的问题,我也遇到这个问题了。
还有个办法自己检查,在shell中自己通过echo调试。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条