在一个测试环境下使用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查找,先找到亚洲