'$ HADOOP_HOME / bin / hadoop version'工作正常,但'hadoop版'不起作用

时间:2018-05-15 15:16:54

标签: java

我已经安装了hadoop 3.1.0版本并设置了env变量。当我运行$ HADOOP_HOME / bin / hadoop版本时,显示我安装但运行hadoop版本无法找到hadoop命令(在hadoop用户内) 我的环境变量如下所示:

#HADOOP VARIABLES START
export HADOOP_HOME=$HOME/usr/local/hadoop
export HADOOP_CONF_DIR=$HOME/usr/local/hadoop/etc/hadoop
export HADOOP_INSTALL=$HOME/usr/local/hadoop
export PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:$HOME/usr/local/hadoop
#HADOOP VARIABLES END

echo $HADOOP_HOME
/usr/local/hadoop

echo $HOME 
/home/hduser



echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games


$HADOOP_HOME/bin/hadoop version

Hadoop 3.1.0
Source code repository https://github.com/apache/hadoop -r 16b70619a24cdcf5d3b0fcf4b58ca77238ccbe6d
Compiled by centos on 2018-03-30T00:00Z
Compiled with protoc 2.5.0
From source with checksum 14182d20c972b3e2105580a1ad6990
This command was run using /usr/local/hadoop/share/hadoop/common/hadoop-common-3.1.0.jar

似乎我的全局路径无法正常工作。我可能会错过一些东西,我试图弄清楚几个小时,但没有任何作用。非常感谢

1 个答案:

答案 0 :(得分:0)

从您的echo $PATH结果中,看似hadoop路径未添加到您的PATH

你在哪里写出口报表?尝试将它们添加到~/.bashrc并开始新的终端。