输入[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