今天重新搭建了一个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. Java应用中使用ShutdownHook友好地清理现场、退出JVM的2种方法

    Runtime.getRuntime().addShutdownHook(shutdownHook);    这个方法的含义说明:        这个方法的意思就是在jvm中增加一个关闭的钩子,当jv ...

  2. java 设置Cookie值

    原文地址:http://blog.csdn.net/lansetiankong12/article/details/52622654 /** * 读取所有cookie * 注意二.从客户端读取Cook ...

  3. CentOS7下yum方式安装mysql5.6

    在Centos7中用MariaDB代替了mysql数据库.所以在新安装MySQL前必须做好对系统的清理工作. 一.清理CentOS7下的MariaDB. [root@localhost ~]#rpm ...

  4. C# 开发网页的打印版

    在项目中,有一个需求时是需要打印产品页面.但是打印出来的版本和网页上的版本不太一致,有些图片不需要,网页上以tab选项卡显示的内容,都需要在打印页面中看到..等等 CSS针对这种需求,引入了一个@me ...

  5. 微信小程序自学第五课:条件渲染、列表渲染

    一.条件渲染 1. wx:if 在框架中,我们用 wx:if="{{condition}}" 来判断是否需要渲染该代码块: <view wx:if="{{condi ...

  6. Sharepoint2013商务智能学习笔记之部署AdventureWorksDW2012数据库(三)

    AdventureWorksDW2012是sql server2012的样本数据库,后面做商务智能Demo会用到,所以需要下载并安装到sql server2012上,下载地址 第一步,下载数据库 第二 ...

  7. jq中打开新页面 并获取携带值

    打开新页面:window.location.href = "./index.html?id=1"获取携带值: function GetRequest() { var url = l ...

  8. PAT 1043【BST与二叉树】

    考察: 1.二叉树的建树 2.前序遍历,后序遍历 3.BST的特性 这题的思路: 告诉你数组是先序遍历的,so 根已经知道了(数组首位元素),那么按照BST,建一下树(要两次,另外一次是镜像的): 跑 ...

  9. 基于Canvas 实现图片转点阵图

    要实现什么 同事想做一张世界地图的背景图,但是网上找的图片都太low了.他想用那种密集的点阵组成的世界地图.作为程序员,想法当然是通过图片处理,识别像素点,然后生成新的图片. 目标是这样的: 实现思路 ...

  10. 【转载】Hyperledger学习小结

    Hyperledger学习小结 自学Hyperledger Composer也有段时间了,是时候对所学的知识总结一下了.因为没有实际项目参与的话,差不多也就到此为止了.后续可能会去了解一下以太坊的技术 ...