bash: hadoop: command not found

weixin_33766168發表於2016-02-24

輸入[root@localhost bin]# hadoop fs -ls  / 報bash: hadoop: command not found 這個錯誤

需要將hadoop/bin路徑加入PATH,配置環境變數

[root@localhost bin]# vi ~/.bash_profile 開啟檔案,新增hadoop的bin路徑到path中

PATH=$PATH:$HOME/bin:/usr/local/hadoop-1.1.2/bin

儲存重啟啟動hadoop  

或者[root@localhost bin]# source ~/.bash_profile ,使bash_profiel檔案生效

export JAVA_HOME=/usr/local/java/jdk1.8.0_05

export JRE_HOME=$JAVA_HOME/jre

export CLASSPATH=./:$JAVA_HOME/lib:$JRE_HOME/lib:$JRE_HOME/lib/tools.jar

export HADOOP_HOME=/opt/hadoop

export HIVE_HOME=/opt/hive

export HBASE_HOME=/opt/hbase

export HADOOP_MAPRED_HOME=${HADOOP_HOME}

export HADOOP_COMMON_HOME=${HADOOP_HOME}

export HADOOP_HDFS_HOME=${HADOOP_HOME}

export YARN_HOME=${HADOOP_HOME}

export HADOOP_YARN_HOME=${HADOOP_HOME}

export HADOOP_CONF_DIR=${HADOOP_HOME}/etc/hadoop

export HDFS_CONF_DIR=${HADOOP_HOME}/etc/hadoop

export YARN_CONF_DIR=${HADOOP_HOME}/etc/hadoop

export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HBASE_HOME/bin:$HIVE_HOME/bin


相關文章