今天重新搭建了一个3节点的Hadoop集群,想着在上面测试一个MapReduce实例,然后就出现了以下错误:

  [hadoop@master hadoop-2.6.]$ hadoop
  -bash: hadoop: command not found

  出现这个错误的原因是没有配置环境变量,操作过程如下。

  vi /etc/profile //权限不够时再前面加上sudo

  进入配置文件后,按照以下配置进行对比,没有的请写进去。

  #hadoop
  export HADOOP_HOME=/opt/modules/hadoop-2.6.   #java
  export JAVA_HOME=/opt/modules/jdk
  export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
  export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin

  配置完成后执行下列命令更新配置

  source /etc/profile

  然后运行hadoop命令查看配置是否生效,内容如下。

  [hadoop@master hadoop-2.6.]$ hadoop
Usage: hadoop [--config confdir] COMMAND
where COMMAND is one of:
fs run a generic filesystem user client
version print the version
jar <jar> run a jar file
checknative [-a|-h] check native hadoop and compression libraries availability
distcp <srcurl> <desturl> copy file or directories recursively
archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive
classpath prints the class path needed to get the
credential interact with credential providers
Hadoop jar and the required libraries
daemonlog get/set the log level for each daemon
trace view and modify Hadoop tracing settings
or
CLASSNAME run the class named CLASSNAME Most commands print help when invoked w/o parameters.

以上就是博主为大家介绍的这一板块的主要内容,这都是博主自己的学习过程,希望能给大家带来一定的指导作用,有用的还望大家点个支持,如果对你没用也望包涵,有错误烦请指出。如有期待可关注博主以第一时间获取更新哦,谢谢!

  

版权声明:本文为博主原创文章,未经博主允许不得转载。

bash:haoop:command not found的更多相关文章

  1. scp报错 -bash: scp: command not found

    环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...

  2. source /etc/profile报错-bash: id:command is not found

    由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...

  3. -bash: .bash_profile: command not found

    今天有一同事安装了ORACLE后,在切换账号时遇到错误提示"-bash: .bash_profile: command not found".如下所示 [root@GLETestL ...

  4. Linux下提示 bash: xxx command not found

    今天在虚拟机上安装了CentOS5.5,发现运行一些很正常的诸如:init,shutdown,fdisk 等命令时,悍然提示: bash: xxx command not found. 那么,首先就要 ...

  5. [原创]-bash: iostat: command not found解决办法

    [root@testhost ~]# iostat-bash: iostat: command not found IOSTAT 命令不可用,首先确认sysstat包是否安装,sysstat包中包括i ...

  6. # mysql -u root -p -bash: mysql: command not found

    [root@jboss ~]# mysql -u root -p-bash: mysql: command not found 需要安装mysql # yum install mysql之后就行 了

  7. bash:fdisk:command not found

    bash:fdisk:command not found [lansir@Red-Hat ~]$ fdisk -l-bash: fdisk: command not found 原因是fdisk不在P ...

  8. Centos提示-bash: make: command not found的解决办法

    一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make.vim等常用命令,直接yum安装下即可: yum - ...

  9. bash: ifconfig: command not found解决方法

    1.问题: #ifconfig bash: ifconfig: command not found 2.原因:非root用户的path中没有/sbin/ifconfig ,其它的命令也可以出现这种情况 ...

随机推荐

  1. JavaScript-Tool:jquery.cxselect.js

    ylbtech-JavaScript-Tool:jquery.cxselect.js 1.返回顶部 1.jquery.cxselect.js /*! * jQuery cxSelect * @name ...

  2. UE3代码阅读需知

    转自:http://www.cnblogs.com/hmxp8/archive/2012/02/21/2361211.html 掌握一款庞大的引擎,要一下子掌握真的很难,慢慢地从Editor,Scri ...

  3. kvm基础 虚拟机内存、CPU调整

    转自http://blog.csdn.net/hnhuangyiyang/article/details/50902223 一.调小虚拟机内存 调小虚拟机内存可以动态实现,不用关机1.查看当前内存大小 ...

  4. 【255】◀▶IEW-Unit20

    Unit 20 Environment: Tourism I.定语从句及分词在雅思写作中的运用 定语从句: 1. 先行词 2. 关系词:关系代词.关系副词 3. 非限制性定语从句 4. 分词和定语从句 ...

  5. Spring 3.x 企业引用开发实战(陈雄华/林开雄)

    目录 ... 第一章:Spring概述 IoC:BeanFactory.Context.El(SpringEL表达式) AOP:允许JVM虚拟机启动时使用代理类在运行时期修改指定类的字节码,改变一个类 ...

  6. MySQL的变量--系统变量、状态变量

    MySQL的变量分为以下两种:1)系统变量:配置MySQL服务器的运行环境,可以用show variables查看2)状态变量:监控MySQL服务器的运行状态,可以用show status查看 一.系 ...

  7. 初始String

    --------------siwuxie095                             使用频繁操作繁琐的数据有哪些?                 对于基本数据类型:int.ch ...

  8. 12、多空格&多制表符文本之cut域分割终极方案

    解决方法分为如下三步: (1)        使用“tr”命令将制表符转换为空格: (2)        使用“tr”命令将多个重复空格删除,保留一个空格: (3)        使用“cut”命令进 ...

  9. 8、linux-数字计算

    bash内置了对整数四则运算的支持,但是并不支持浮点运算 bc命令是一种支持任意精度的交互执行的计算器语言,而bc命令可以很方便的进行浮点运算,当然整数运算也不再话下 在bc工作环境下,可以使用以下计 ...

  10. Entity Framework Code-First(9.1):DataAnnotations - Key Attribute

    DataAnnotations - Key Attribute: Key attribute can be applied to properties of a class. Default Code ...