hadoop任务启动报错整理

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

2022-01-12 16:15:02,559 INFO impl.YarnClientImpl: Submitted application application_1641975214047_0001
2022-01-12 16:15:02,604 INFO mapreduce.Job: The url to track the job: http://node04:8088/proxy/application_1641975214047_0001/
2022-01-12 16:15:02,604 INFO mapreduce.Job: Running job: job_1641975214047_0001
2022-01-12 16:15:05,636 INFO mapreduce.Job: Job job_1641975214047_0001 running in uber mode : false
2022-01-12 16:15:05,637 INFO mapreduce.Job:  map 0% reduce 0%
2022-01-12 16:15:05,651 INFO mapreduce.Job: Job job_1641975214047_0001 failed with state FAILED due to: Application application_1641975214047_0001 failed 2 times due to AM Container for appattempt_1641975214047_0001_000002 exited with  exitCode: 1
Failing this attempt.Diagnostics: [2022-01-12 16:15:05.300]Exception from container-launch.
Container id: container_1641975214047_0001_02_000001
Exit code: 1

[2022-01-12 16:15:05.321]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster


[2022-01-12 16:15:05.322]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster


For more detailed output, check the application tracking page: http://node04:8088/cluster/app/application_1641975214047_0001 Then click on links to logs of each attempt.
. Failing the application.
2022-01-12 16:15:05,664 INFO mapreduce.Job: Counters: 0

解决:

1、首先运行:

hadoop classpath

 2、编辑mapred-site.xml文件(将1中的结果添加)

<property>
    <name>mapreduce.application.classpath</name>
    <value>/opt/module/hadoop-3.1.3/etc/hadoop:/opt/module/hadoop-3.1.3/share/hadoop/common/lib/*:/opt/module/hadoop-3.1.3/share/hadoop/common/*:/opt/module/hadoop-3.1.3/share/hadoop/hdfs:/opt/module/hadoop-3.1.3/share/hadoop/hdfs/lib/*:/opt/module/hadoop-3.1.3/share/hadoop/hdfs/*:/opt/module/hadoop-3.1.3/share/hadoop/mapreduce/lib/*:/opt/module/hadoop-3.1.3/share/hadoop/mapreduce/*:/opt/module/hadoop-3.1.3/share/hadoop/yarn:/opt/module/hadoop-3.1.3/share/hadoop/yarn/lib/*:/opt/module/hadoop-3.1.3/share/hadoop/yarn/*</value>  
</property>

错误二、Failing this attempt.Diagnostics: Exception from container-launch

2022-01-12 16:26:02,600 INFO mapreduce.Job: Job job_1641975890693_0001 running in uber mode : false
2022-01-12 16:26:02,600 INFO mapreduce.Job:  map 0% reduce 0%
2022-01-12 16:26:02,611 INFO mapreduce.Job: Job job_1641975890693_0001 failed with state FAILED due to: Application application_1641975890693_0001 failed 2 times due to AM Container for appattempt_1641975890693_0001_000002 exited with  exitCode: 1
Failing this attempt.Diagnostics: [2022-01-12 16:26:01.902]Exception from container-launch.
Container id: container_1641975890693_0001_02_000001
Exit code: 1

[2022-01-12 16:26:01.922]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
log4j:WARN No appenders could be found for logger (org.apache.hadoop.mapreduce.v2.app.MRAppMaster).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


[2022-01-12 16:26:01.922]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
log4j:WARN No appenders could be found for logger (org.apache.hadoop.mapreduce.v2.app.MRAppMaster).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


For more detailed output, check the application tracking page: http://node03:8088/cluster/app/application_1641975890693_0001 Then click on links to logs of each attempt.
. Failing the application.
2022-01-12 16:26:02,639 INFO mapreduce.Job: Counters: 0

解决:

修改yarn-site.xml

<property>
    <name>yarn.resourcemanager.webapp.address.rm1</name>
    <value>node03:8088</value>
</property>
<property>
    <name>yarn.resourcemanager.webapp.address.rm2</name>
    <value>node04:8088</value>
</property>

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值