hadoop报错:org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container.

本文介绍了在Hadoop 2.6.4上运行MapReduce程序时遇到的“Unauthorized request to start container”错误及其解决方法。该问题是由于DataNode与NameNode时间不同步导致。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

当我在hadoop2.6.4上运行MR程序时,发生了如下错误:

org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container.

内容:

18/07/23 10:49:30 INFO mapreduce.Job: Task Id : attempt_1532301779475_0009_r_000000_1000, Status : FAILED
Container launch failed for container_1532301779475_0009_02_000003 : org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container. 
This token is expired. current time is 1532314168852 found 1532309369785
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的时间不同步导致的

解决办法:

#crontab -e

编辑:

0 1 * * * /usr/sbin/ntpdate cn.pool.ntp.org

wq保存

#/usr/sbin/ntpdate cn.pool.ntp.org

报错:……the NTP socket is in use, exiting

(停止服务)

#  service ntpd stop

(设置开机不启动)

# chkconfig ntpd off

然后执行: 

# /usr/sbin/ntpdate cn.pool.ntp.org

成功:

adjust time server 5.79.108.34 offset -0.001357 sec

即时生效暴力方法:

#  date -s 00:00:00

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值