Hadoop运行MR出现此问题:Unauthorized request to start container

14 篇文章 0 订阅
1 篇文章 0 订阅

问题

执行wordcount例子程序,出现以下错误:

18/08/18 22:40:43 INFO client.RMProxy: Connecting to ResourceManager at admin1/192.168.1.21:8032
18/08/18 22:40:44 WARN mapreduce.JobResourceUploader: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
18/08/18 22:40:44 INFO input.FileInputFormat: Total input paths to process : 1
18/08/18 22:40:44 INFO mapreduce.JobSubmitter: number of splits:1
18/08/18 22:40:44 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1534515316138_0003
18/08/18 22:40:45 INFO impl.YarnClientImpl: Submitted application application_1534515316138_0003
18/08/18 22:40:45 INFO mapreduce.Job: The url to track the job: http://admin1:8088/proxy/application_1534515316138_0003/
18/08/18 22:40:45 INFO mapreduce.Job: Running job: job_1534515316138_0003
18/08/18 22:40:53 INFO mapreduce.Job: Job job_1534515316138_0003 running in uber mode : false
18/08/18 22:40:53 INFO mapreduce.Job:  map 0% reduce 0%
18/08/18 22:40:55 INFO mapreduce.Job: Task Id : attempt_1534515316138_0003_m_000000_0, Status : FAILED
Container launch failed for container_1534515316138_0003_01_000002 : org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container. 
This token is expired. current time is 1534603254297 found 1534517454172
Note: System times on machines may be out of sync. Check system time and time zones.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.instantiateException(SerializedExceptionPBImpl.java:168)
    at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.deSerialize(SerializedExceptionPBImpl.java:106)
    at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$Container.launch(ContainerLauncherImpl.java:155)
    at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$EventProcessor.run(ContainerLauncherImpl.java:369)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

分析原因

这是因为datanode与namenode之间未设置时间同步,所以才会引起该异常。

解决方法

将多个datanode与namenode之间进行时间同步。

使用date命令:

date :查看当前时间,结果如下:
2018年 08月 18日 星期六 22:36:09 CST

通过使用命令date -s 22:40:00 来设置当前时间,结果如下:

2018年 08月 18日 星期六 22:40:00 CST

ntpdate命令:ntpdate -u 210.72.145.44 :网络时间同步命令

还有一种情况就是如果之前设置了同步时间,同步时间的服务也是正常运行,但是还是出现上述的这种情况只能重启下同步时间的服务,问题搞定!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值