因服务器时间不一致导致的MapRecude 任务运行失败

在Hadoop HA集群测试环境中,由于各节点时间不一致,MapReduce任务运行出现错误。通过查找并同步国家授时中心的IP,使用ntpdate进行时间同步,并调整Linux系统时区,确保所有节点时间一致,从而成功解决任务运行问题。需要注意,ntpdate命令可能需要先安装,并且要获取最新的授时中心IP以防止同步失败。
摘要由CSDN通过智能技术生成

在一个测试环境下使用3个节点部署完成了Hadoop HA集群,集群启动都OK,但是当写了一个wordCounta测试打包后在集群上开始运行时,报了一个错误:

[root@node2 hadoop_jar]# /opt/package/hadoop-2.7.2/bin/hadoop jar wordcount.jar   /hello.txt   /output1
Container launch failed for container_1502174444721_0002_01_000002 : org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container. 
This token is expired. current time is 1502197729279 found 1502175793372
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:375)
	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)

里面有一个很明显的提示:

Note: System times on machines may be out of sync. Check system time and time zones.

提示服务器系统时间不同步,立即查看集群里各个节点的时间,果然发现各个节点的时间都不一致,甚至分钟数都不同,太严重了,要立即同步时间!!!

其实可以使用utpdate做时间同步,在国内的话,当然要找国家的授时中心了,所以先要找到授时中心的IP

根据http://www.pool.ntp.org查找,先找到亚洲

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值