本文介绍了找不到hadoop安装:必须设置$ HADOOP_HOME或hadoop必须位于路径中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以有一点背景。我一直试图在CentOS 6机器上设置Hive。我遵循了此Youtube视频的说明:



对于我的情况,我使用的是Hadoop-1.1.2和Hive 0.9.0,本视频中标有mnt的所有目录取而代之的是opt,因为这就是我所有的hadoop和hive包都被打开了。

当我到达视频中我实际应该看到的部分时运行Hive通过./hive
弹出这个错误:

 找不到hadoop安装:$ HADOOP_HOME must被设置或hadoop必须在路径

我猜我的一个问题是,在哪个目录我必须编辑.profile文件?因为我不明白为什么我们不得不到主目录进行这项更改。此外,如果这有帮助,这是我放在我的/ home / hadoop目录中的.profile文件中。

  export HADOOP_HOME = / opt / hadoop / hadoop 
export HIVE_HOME = / opt / hadoop / hive $ b $ export PATH = $ HADOOP_HOME / bin:$ HIVE_HOME / bin

非常感谢!

解决方案

/etc/profile.d目录,并在那里创建一个hadoop.sh文件。

  export HADOOP_HOME = / opt / hadoop / hadoop 
export HIVE_HOME = / opt / hadoop / hive
export PATH = $ PATH:$ HADOOP_HOME / bin:$ HIVE_HOME / bin

保存文件后,请确保

  chmod + x / etc / profile.d / hadoop.sh 
source /etc/profile.d/hadoop.sh

这应该照顾它。


So a little background. I've been trying to setup Hive on a CentOS 6 machine. I followed the instructions of this Youtube video: http://www.youtube.com/watch?v=L2lSrHsRpOI

For my case, I'm using Hadoop-1.1.2 and Hive 0.9.0, all the directories labeled "mnt" in this video I replaced it with "opt" because that's where all of my hadoop and hive packages have been opened up.

As I reached the portion of the video where I was actually supposed to run Hive via "./hive"this error popped up:

"Cannot find hadoop installation: $HADOOP_HOME must be set or hadoop must be in the path"

I guess one of the questions I have is, in which directory did I have to edit the ".profile" file? because I don't understand why we would have to go to the "home" directory for this change. And also if this helps, this is what I had put down in the ".profile" file in my /home/hadoop directory

export HADOOP_HOME=/opt/hadoop/hadoop
export HIVE_HOME=/opt/hadoop/hive
export PATH=$HADOOP_HOME/bin:$HIVE_HOME/bin

Thank you so much!

解决方案

Go to /etc/profile.d directory and create a hadoop.sh file in there with

export HADOOP_HOME=/opt/hadoop/hadoop
export HIVE_HOME=/opt/hadoop/hive
export PATH=$PATH:$HADOOP_HOME/bin:$HIVE_HOME/bin

After you save the file, make sure to

chmod +x /etc/profile.d/hadoop.sh
source /etc/profile.d/hadoop.sh

This should take care of it.

这篇关于找不到hadoop安装:必须设置$ HADOOP_HOME或hadoop必须位于路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 03:51