自己搭建了一套伪分布的大数据环境,运行Hadoop包中自带的示例时,出现如下错误:

错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster

原因:

hadoop集群上运行build动作时提示以上错误,原因是yarn-site.xml和mapred-site.xml中的yarn.application.classpath没有进行配置。

解决方法:

找到yarn-site.xml和mapred-site.xml,并在configuration标签中,添加如下代码:

 <property>
<name>yarn.application.classpath</name>
<value>
  /bigdata/hadoop-3.0.3/etc/hadoop:/bigdata/hadoop-3.0.3/share/hadoop/common/lib/*:/bigdata/hadoop-3.0.3/share/hadoop/common/*:/bigdata/hadoop-3.0.3/share/hadoop/hdfs:/bigdata/hadoop-3.0.3/share/hadoop/hdfs/lib/*:/bigdata/hadoop-3.0.3/share/hadoop/hdfs/*:/bigdata/hadoop-3.0.3/share/hadoop/yarn/lib/*:/bigdata/hadoop-3.0.3/share/hadoop/yarn/*:/bigdata/hadoop-3.0.3/share/hadoop/mapreduce/lib/*:/bigdata/hadoop-3.0.3/share/hadoop/mapreduce/*:/bigdata/hadoop-3.0.3/contrib/capacity-scheduler/*.jar
</value>
</property>

注:我的$HADOOP_HOME=bigdata/hadoop-3.0.3

修改完了,记得format一下。

Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster的更多相关文章

  1. Yarn 踩坑 : Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

    原因:yarn-site.xml 中,yarn.application.classpath 未配置 解决:其中 hadoop 版本对应更改 <property> <name>y ...

  2. hadoop 3.x Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

    启动hdfs后执行share目录中自带的mapreduce程序时报如下错误 找到$HADOOP_HOME/etc/mapred-site.xml,增加以下配置 <property> < ...

  3. Hive进行数据统计时报错:org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Error starting MRAppMaster

    报错详情: 2020-04-09 22:56:58,827 ERROR [Listener at 0.0.0.0/45871] org.apache.hadoop.mapreduce.v2.app.M ...

  4. Sqoop找不到主类 Error: Could not find or load main class org.apache.sqoop.Sqoop

    最近由于要使用Sqoop来到出数据到hdfs,可是发现Sqoop1.4.5跟hadoop2.X不兼容,需要对Sqoop1.4.5进行编译,编译的具体方法见:http://my.codeweblog.c ...

  5. Error: Could not find or load main class org.apache.flume.tools.GetJavaProperty

    问题: [root@master conf]# flume-ng version Error: Could not find or load main class org.apache.flume.t ...

  6. flume-ng version出现错误Error: Could not find or load main class org.apache.flume.tools.GetJavaPrope的解决办法

    错误: 找不到或无法加载主类 org.apache.flume.tools.GetJavaProperty或者Error: Could not find or load main class org. ...

  7. Could not find or load main class org.apache.spark.deploy.yarn.ApplicationMaster

    Spark YARN Cluster mode get this error "Could not find or load main class org.apache.spark.depl ...

  8. Error: Could not find or load main class test.EditFile

    今天写了一个简单的小程序,运行之后发现Error: Could not find or load main class test.EditFile,项目无法启动.删除main中的所有内容之后依旧提示该 ...

  9. Linux 下 Error: Could not find or load main class Hello

    在linux下写了一个很easy的Hello world程序,编译执行居然报错:Error: Could not find or load main class Hello 最后发现是CLASSPAT ...

随机推荐

  1. git 码云 使用记录

    使用了码云的私有仓库. 一.首先下载安装git 安装完成后,在开始菜单里找到“Git”->“Git Bash”,蹦出一个类似命令行窗口的东西,就说明Git安装成功! 二.创建版本库 什么是版本库 ...

  2. C# 对象的深复制和浅复制

    2019年第一篇博客,好吧,又大了一岁了,继续加油吧. 正文: C# 中的对象,众所周知是引用类型,那么如何复制对象Object呢,我们来看看下面这段代码: public class User { p ...

  3. [MYSQL][2]索引

    创建表时创建索引: 在已经存在的表上创建索引: 方法一 方法二 删除索引:

  4. CYQ MAction,子表 新增,删除,修改 集合

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  5. 小工具:生成半透明背景色的 CSS 代码,不影响子元素透明度

    工具:http://leegorous.net/tools/bg-alpha.html 工具介绍:http://leegorous.net/blog/2010/07/29/generate-css-c ...

  6. CentOS7 LNMP+phpmyadmin环境搭建(二、LNMP环境搭建)

    上一篇博客我们在虚拟机上安装了centos7,接下来,就开始安装lnmp环境吧. 还是跟之前一样,进入命令行后,先使用su命令切换到root权限. 首先配置防火墙  CentOS 7.0默认使用的是f ...

  7. Hadoop 动态扩容 增加节点

    基础准备 在基础准备部分,主要是设置hadoop运行的系统环境 修改系统hostname(通过hostname和/etc/sysconfig/network进行修改) 修改hosts文件,将集群所有节 ...

  8. python中for......else......的使用

    for x in range(5): if x == 2: print(x) # break else: print("执行else....") 上述代码:当缺少break关键字时 ...

  9. mysql的数据类型与表约束

    数据类型 (详细数据类型请参考:http://www.runoob.com/mysql/mysql-data-types.html) 数字 整型  tinyint int bigint 小数: flo ...

  10. ACM1004:Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...