部署步骤一致,每次错误不一样;
错误1:
INFO org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncher: Error launching appattempt_1541382172965_0001_000001. Got exception: java.net.UnknownHostException: Invalid host name: local host is: (unknown); destination host is: "node03":50682; java.net.UnknownHostException; For more details see: http://wiki.apache.org/hadoop/UnknownHost
修改/etc/hosts。/etc/sysconfig/network中主机名
错误2:
18/11/06 09:04:30 INFO mapreduce.Job: Task Id : attempt_1541465096076_0006_m_000000_1000, Status : FAILED
Container launch failed for container_1541465096076_0006_02_000002 : org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container.
This token is expired. current time is 1541476768229 found 1541466870379
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)
集群系统时间不一致造成的。分别在集群每台机器上执行:
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# ntpdate s2c.time.edu.cn
再利用date查看时间是否成功。
注:执行 ntpdate s2c.time.edu.cn时可能会报错,错误为:
6 Nov 12:21:24 ntpdate[6941]: the NTP socket is in use, exiting
关闭ntpd服务即可,命令为:service ntpd stop或/bin/systemctl status ntpd.service