简体   繁体   English

Hadoop安装问题Ubuntu 10.10

[英]Hadoop installation issue Ubuntu 10.10

I have a Hadoop installation issue on Ubuntu 10.10. 我在Ubuntu 10.10上存在Hadoop安装问题。 I successfully installed hadoop. 我成功安装了hadoop。 I did "hadoop version" and it showed me version and other info. 我做了“ hadoop版本”,它向我显示了版本和其他信息。 as it should have. 它应该有的。

The issue happens when I open a new terminal window or I logout and re-login. 当我打开新的终端窗口或注销并重新登录时,会发生此问题。 I do "hadoop version" it says hadoop is not installed. 我做“ hadoop版本”,它说没有安装hadoop。 Looks like I am missing something in settings. 看起来我在设置中缺少某些内容。

I am using Ubuntu 10.10. 我正在使用Ubuntu 10.10。

Any help is appreciated. 任何帮助表示赞赏。 Rajesh 拉杰什

Set HADOOP_HOME in the ~/.bashrc file instead of doing it through the terminal. 在〜/ .bashrc文件中设置HADOOP_HOME,而不要通过终端进行设置。 When you set an environment variable through the shell it remains alive only till the time you are on the very same shell. 当您通过外壳设置环境变量时,它仅在您位于同一外壳上之前一直有效。 And, once you are done with the setting (in the bashrc file) do not forget to source it. 而且,一旦完成设置(在bashrc文件中),就不要忘记提供它。 Alternatively you could logout and login again. 或者,您可以注销并再次登录。

HTH 高温超导

To access hadoop command outside HADOOP_HOME directory, you will have to add the path of hadoop binaries in system's PATH env variable. 要访问HADOOP_HOME目录之外的hadoop命令,必须在系统的PATH env变量中添加hadoop二进制文件的PATH
You can do something like this (change the path as per your system) in your ~/.bashrc : 您可以在~/.bashrc执行以下操作(根据系统更改路径):

export JAVA_HOME=/usr/lib/jvm/java-7-oracle/
export HADOOP_HOME=/home/rootcss/ecosystem/hadoop
export PATH=$PATH:$HADOOP_HOME/bin

For details and explanation, you can check this . 有关详细信息和说明,您可以检查 Please note that, it is for old version of hadoop. 请注意,它适用于旧版本的hadoop。

For this You should set HADOOP_HOME in the ~/.bashrc file $nano ~/.bashrc 为此,您应该在〜/ .bashrc文件$ nano〜/ .bashrc中设置HADOOP_HOME。

Add these lines at the end of the file replace hadoop path with your path. 在文件末尾添加这些行,用您的路径替换hadoop路径。

export HADOOP_PREFIX="/home/username/hadoop-2.6.0-cdh5.5.1"
export PATH=$PATH:$HADOOP_PREFIX/bin
export PATH=$PATH:$HADOOP_PREFIX/sbin
export HADOOP_MAPRED_HOME=${HADOOP_PREFIX}
export HADOOP_COMMON_HOME=${HADOOP_PREFIX}
export HADOOP_HDFS_HOME=${HADOOP_PREFIX}
export YARN_HOME=${HADOOP_PREFIX}

I not sure which version of Hadoop you installed. 我不确定您安装了哪个版本的Hadoop。

Open .bashrc file located in the /home/ <user_name> /.bashrc and enter the following lines at the end of the file as per your Hadoop version: 打开/ home / <user_name> /.bashrc中的.bashrc文件,并根据您的Hadoop版本在文件末尾输入以下行:

Hadoop-1.xx Hadoop-1.xx

export HADOOP_HOME=/usr/local/hadoop-1.2.1  //Enter path of Hadoop Folder
export PATH=$PATH:$HADOOP_HOME/bin

Hadoop-2.xx Hadoop-2.xx

export HADOOP_PREFIX="/usr/local/hadoop-2.6.0" //Enter path of Hadoop Folder
export PATH=$PATH:$HADOOP_PREFIX/bin
export PATH=$PATH:$HADOOP_PREFIX/sbin
export HADOOP_MAPRED_HOME=${HADOOP_PREFIX}
export HADOOP_COMMON_HOME=${HADOOP_PREFIX}

Execute .bashrc to update the system for the changes(necessary): 执行.bashrc以更新系统以进行更改(必要):

exec bash

Try the hadoop version command 尝试hadoop版本命令

hadoop version

If you need complete installation codes and steps, you can refer this page: 如果需要完整的安装代码和步骤,可以参考以下页面:

https://www.dezyre.com/hadoop-tutorial/big-data-hadoop-tutorial https://www.dezyre.com/hadoop-tutorial/big-data-hadoop-tutorial

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM