本文主要是介绍执行hadoop-3.3.0 wc 报错Container exited with a non-zero exit code 1. Error file: prelaunch.err.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错
Application application_1611732673035_0001 failed 2 times due to AM Container for appattempt_1611732673035_0001_000002 exited with exitCode: 1
Failing this attempt.Diagnostics: [2021-01-27 02:32:14.002]Exception from container-launch.
Container id: container_1611732673035_0001_02_000001
Exit code: 1
[2021-01-27 02:32:14.061]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.
[2021-01-27 02:32:14.062]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://node23:8088/cluster/app/application_1611732673035_0001 Then click on links to logs of each attempt.
进入应用目录,查看应用日志:
# 进入应用容器目录
cd /opt/bigdata/hadoop-3.3.0/logs/userlogs/application_1611732673035_0001/container_1611732673035_0001_02_000001
# 目录日志如下:
[root@node24 container_1611732673035_0001_02_000001]# ls
directory.info launch_container.sh prelaunch.err prelaunch.out stderr stdout syslog
#查看syslog日志
tail -fn 1000 syslog
syslog报错内容如下:
021-01-27 02:32:11,924 INFO [IPC Server listener on 0] org.apache.hadoop.ipc.Server: IPC Server listener on 0: starting
2021-01-27 02:32:11,925 INFO [Listener at 0.0.0.0/33844] org.apache.hadoop.mapreduce.v2.app.client.MRClientService: Instantiated MRClientService at node24/192.168.206.24:33844
2021-01-27 02:32:11,985 INFO [Listener at 0.0.0.0/33844] org.eclipse.jetty.util.log: Logging initialized @4493ms to org.eclipse.jetty.util.log.Slf4jLog
2021-01-27 02:32:12,213 INFO [Listener at 0.0.0.0/33844] org.apache.hadoop.security.authentication.server.AuthenticationFilter: Unable to initialize FileSignerSecretProvider, falling back to use random secrets.
2021-01-27 02:32:12,221 INFO [Listener at 0.0.0.0/33844] org.apache.hadoop.http.HttpRequestLog: Http request log for http.requests.mapreduce is not defined
2021-01-27 02:32:12,224 INFO [Listener at 0.0.0.0/33844] org.apache.hadoop.http.HttpServer2: Added global filter 'safety' (class=org.apache.hadoop.http.HttpServer2$QuotingInputFilter)
2021-01-27 02:32:12,300 ERROR [Listener at 0.0.0.0/33844] org.apache.hadoop.mapreduce.v2.app.client.MRClientService: Webapps failed to start. Ignoring for now:
java.lang.NullPointerExceptionat org.apache.hadoop.util.StringUtils.join(StringUtils.java:967)at org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer.initFilter(AmFilterInitializer.java:74)at org.apache.hadoop.http.HttpServer2.initializeWebServer(HttpServer2.java:679)at org.apache.hadoop.http.HttpServer2.<init>(HttpServer2.java:635)at org.apache.hadoop.http.HttpServer2.<init>(HttpServer2.java:123)at org.apache.hadoop.http.HttpServer2$Builder.build(HttpServer2.java:459)at org.apache.hadoop.yarn.webapp.WebApps$Builder.build(WebApps.java:372)at org.apache.hadoop.yarn.webapp.WebApps$Builder.start(WebApps.java:465)at org.apache.hadoop.yarn.webapp.WebApps$Builder.start(WebApps.java:461)at org.apache.hadoop.mapreduce.v2.app.client.MRClientService.serviceStart(MRClientService.java:152)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1290)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1845)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
2021-01-27 02:32:12,316 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.speculate.DefaultSpeculator: JOB_CREATE job_1611732673035_0001
2021-01-27 02:32:12,321 INFO [Listener at 0.0.0.0/33844] org.apache.hadoop.ipc.CallQueueManager: Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 3000, scheduler: class org.apache.hadoop.ipc.DefaultRpcScheduler, ipcBackoff: false.
2021-01-27 02:32:12,325 INFO [Socket Reader #1 for port 0] org.apache.hadoop.ipc.Server: Starting Socket Reader #1 for port 0
2021-01-27 02:32:12,338 INFO [IPC Server Responder] org.apache.hadoop.ipc.Server: IPC Server Responder: starting
2021-01-27 02:32:12,339 INFO [IPC Server listener on 0] org.apache.hadoop.ipc.Server: IPC Server listener on 0: starting
2021-01-27 02:32:12,394 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: nodeBlacklistingEnabled:true
2021-01-27 02:32:12,394 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: maxTaskFailuresPerNode is 3
2021-01-27 02:32:12,394 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: blacklistDisablePercent is 33
2021-01-27 02:32:12,396 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: 0% of the mappers will be scheduled using OPPORTUNISTIC containers
2021-01-27 02:32:12,461 ERROR [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator: Exception while registering
java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:182)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:159)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.serviceStart(RMCommunicator.java:122)at org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.serviceStart(RMContainerAllocator.java:280)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter.serviceStart(MRAppMaster.java:979)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:122)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1293)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1845)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
2021-01-27 02:32:12,461 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.service.AbstractService: Service RMCommunicator failed in state STARTED
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:178)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.serviceStart(RMCommunicator.java:122)at org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.serviceStart(RMContainerAllocator.java:280)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter.serviceStart(MRAppMaster.java:979)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:122)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1293)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1845)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
Caused by: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:182)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:159)... 14 more
2021-01-27 02:32:12,462 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Final Stats: PendingReds:0 ScheduledMaps:0 ScheduledReds:0 AssignedMaps:0 AssignedReds:0 CompletedMaps:0 CompletedReds:0 ContAlloc:0 ContRel:0 HostLocal:0 RackLocal:0
2021-01-27 02:32:12,462 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.service.AbstractService: Service org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter failed in state STARTED
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:178)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.serviceStart(RMCommunicator.java:122)at org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.serviceStart(RMContainerAllocator.java:280)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter.serviceStart(MRAppMaster.java:979)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:122)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1293)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1845)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
Caused by: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:182)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:159)... 14 more
2021-01-27 02:32:12,462 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.service.AbstractService: Service org.apache.hadoop.mapreduce.v2.app.MRAppMaster failed in state STARTED
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:178)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.serviceStart(RMCommunicator.java:122)at org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.serviceStart(RMContainerAllocator.java:280)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter.serviceStart(MRAppMaster.java:979)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:122)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1293)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1845)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
Caused by: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:182)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:159)... 14 more
2021-01-27 02:32:12,462 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler: Stopping JobHistoryEventHandler. Size of the outstanding queue size is 3
2021-01-27 02:32:12,462 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler: In stop, writing event AM_STARTED
2021-01-27 02:32:12,629 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler: Event Writer setup for JobId: job_1611732673035_0001, File: hdfs://mycluster:8020/tmp/hadoop-yarn/staging/root/.staging/job_1611732673035_0001/job_1611732673035_0001_2.jhist
2021-01-27 02:32:13,467 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler: In stop, writing event AM_STARTED
2021-01-27 02:32:13,469 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler: In stop, writing event JOB_SUBMITTED
2021-01-27 02:32:13,595 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler: Stopped JobHistoryEventHandler. super.stop()
2021-01-27 02:32:13,595 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Skipping cleaning up the staging dir. assuming AM will be retried.
2021-01-27 02:32:13,595 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.ipc.Server: Stopping server on 39632
2021-01-27 02:32:13,602 INFO [TaskHeartbeatHandler PingChecker] org.apache.hadoop.mapreduce.v2.app.TaskHeartbeatHandler: TaskHeartbeatHandler thread interrupted
2021-01-27 02:32:13,602 INFO [Ping Checker for TaskAttemptFinishingMonitor] org.apache.hadoop.yarn.util.AbstractLivelinessMonitor: TaskAttemptFinishingMonitor thread interrupted
2021-01-27 02:32:13,602 INFO [IPC Server listener on 0] org.apache.hadoop.ipc.Server: Stopping IPC Server listener on 0
2021-01-27 02:32:13,603 INFO [IPC Server Responder] org.apache.hadoop.ipc.Server: Stopping IPC Server Responder
2021-01-27 02:32:13,604 ERROR [Listener at 0.0.0.0/39632] org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Error starting MRAppMaster
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:178)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.serviceStart(RMCommunicator.java:122)at org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.serviceStart(RMContainerAllocator.java:280)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter.serviceStart(MRAppMaster.java:979)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:122)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1293)at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1845)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
Caused by: java.lang.NullPointerExceptionat org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:182)at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:159)... 14 more
2021-01-27 02:32:13,606 INFO [Listener at 0.0.0.0/39632] org.apache.hadoop.util.ExitUtil: Exiting with status 1: org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.NullPointerException
原因
日志中报的空指针是开启MRAppMaster的过程中,注册地址时报的错,怀疑是RM的访问地址未指定导致。
解决
在yarn-site.xml中指定rm的访问地址:在添加时请把${yarn.resourcemanager.hostname}设置为对应的rm1和rm2的hostname或者ip,保持节点之间网络通畅。
<property><!-- RM HTTP访问地址 默认:${yarn.resourcemanager.hostname}:8088--><name>yarn.resourcemanager.webapp.address.rm1</name><value>${yarn.resourcemanager.hostname}:8088</value>
</property>
<property><!-- RM HTTP访问地址 默认:${yarn.resourcemanager.hostname}:8088--><name>yarn.resourcemanager.webapp.address.rm2</name><value>${yarn.resourcemanager.hostname}:8088</value>
</property>
由于这两个属性的默认地址为启动的hostname,如果hostname设置错误可能会导致地址暴露问题。
结果
加上这两个设置以后顺利执行。
这篇关于执行hadoop-3.3.0 wc 报错Container exited with a non-zero exit code 1. Error file: prelaunch.err.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!