在往hbase表裏經過bulkload導數據時,某個mapreduce跑了一個多小時還沒跑,看yarn界面,發現map還有一小部分沒跑完,沒跑完的map全在pending,running中沒有,同時reduce在copy階段把資源全用光,致使map沒資源去跑,進而致使reduce一直在copyspa
狀態等待。也就是說map須要資源去跑,reduce須要等map所有跑完才能進行下一個階段,這樣就致使相互等待,相似死鎖。大約在一個半小時左右,有130多個reduce被AppMaster kill,被kill的reduce出現日誌:Reducer preempted to make room for pending 日誌
map attempts Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143。這就是說當資源不夠是,AppMaster會kill掉reduce釋放資源給map。
code