Diagnostic Messages for this Task:
Container launch failed for container_1603712387555_0006_02_000006 : org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container.
This token is expired. current time is 1603727129103 found 1603726310194
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:62)
? ? ? ? at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
? ? ? ? at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
? ? ? ? at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.instantiateExceptionImpl(SerializedExceptionPBImpl.java:171)
? ? ? ? at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.instantiateException(SerializedExceptionPBImpl.java:182)
? ? ? ? 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:163)
? ? ? ? at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$EventProcessor.run(ContainerLauncherImpl.java:394)
? ? ? ? at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
? ? ? ? at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
? ? ? ? at java.lang.Thread.run(Thread.java:748)
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
錯(cuò)誤原因布蔗,集群時(shí)間不同步;
于是查看挨個(gè)查看 ,果然發(fā)現(xiàn)有一臺(tái)時(shí)間不同步?
所以重新配置一下時(shí)間服務(wù)器 ,然后重啟該節(jié)點(diǎn)
解決了集群時(shí)間同步問題1) 時(shí)間服務(wù)器配置(必須root用戶)
? (1)在所有節(jié)點(diǎn)關(guān)閉ntp服務(wù)和自啟動(dòng)
sudo systemctl stop ntpd
sudo systemctl disable ntpd
? (2)在hadoop102上修改ntp配置文件(hadoop102為時(shí)間服務(wù)器)
sudo vim /etc/ntp.conf
修改內(nèi)容如下
?? ? (a)修改1(授權(quán)192.168.1.0-192.168.1.255網(wǎng)段上的所有機(jī)器可以從這臺(tái)機(jī)器上查詢和同步時(shí)間)
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
改為(去掉注釋#)
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
(b)修改2(集群在局域網(wǎng)中匿级,不使用其他互聯(lián)網(wǎng)上的時(shí)間)
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
改為(全部注釋掉)
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
? ? (c)添加3(當(dāng)該節(jié)點(diǎn)丟失網(wǎng)絡(luò)連接,依然可以采用本地時(shí)間作為時(shí)間服務(wù)器為集群中的其他節(jié)點(diǎn)提供時(shí)間同步)
server 127.127.1.0
fudge 127.127.1.0 stratum 10
?(3)在102上修改/etc/sysconfig/ntpd 文件
vim /etc/sysconfig/ntpd
增加內(nèi)容如下(讓硬件時(shí)間與系統(tǒng)時(shí)間一起同步)
SYNC_HWCLOCK=yes
? Tips:
? 系統(tǒng)時(shí)間: 一般說來就是我們執(zhí)行 date命令看到的時(shí)間染厅,linux系統(tǒng)下所有的時(shí)間調(diào) 用(除了直接訪問硬件時(shí)間的命令)都是使用的這個(gè)時(shí)間痘绎。
? 硬件時(shí)間: 主板上BIOS中的時(shí)間,由主板電池供電來維持運(yùn)行肖粮,系統(tǒng)開機(jī)時(shí)要讀取
? ? ? ? ? ? ? ? 這個(gè)時(shí)間简逮,并根據(jù)它來設(shè)定系統(tǒng)時(shí)間(注意:系統(tǒng)啟動(dòng)時(shí)根據(jù)硬件時(shí)間
? ? 設(shè)定系統(tǒng)時(shí)間的過程可能存在時(shí)區(qū)換算,這要視具體的系統(tǒng)及相關(guān)設(shè)置而
? ? ? ? ? ? ? ? 定)
?(4)在102重新啟動(dòng)ntpd服務(wù)
sudo systemctl start ntpd
?(5)在102設(shè)置ntpd服務(wù)開機(jī)啟動(dòng)
sudo systemctl enable ntpd
2) 其他機(jī)器配置(必須root用戶)
?(1)在其他機(jī)器配置1分鐘與時(shí)間服務(wù)器同步一次
sudo crontab -e
編寫定時(shí)任務(wù)如下:
*/1 * * * * /usr/sbin/ntpdate hadoop102
?(2)修改任意機(jī)器時(shí)間
date -s "2017-9-11 11:11:11"
?(3)一分鐘后查看機(jī)器是否與時(shí)間服務(wù)器同步
date