ResourceManager进行主备切换后,任务中断后运行时间过长
问题
在MapReduce任务运行过程中,ResourceManager发生主备切换,切换完成后,MapReduce任务继续执行,此时任务的运行时间过长。
回答
因为ResourceManager HA已启用,但是Work-preserving RM restart功能未启用。
如果Work-preserving RM restart功能未启用,ResourceManager切换时container会被kill,然后导致Application Master超时。Work-preserving RM restart功能介绍请参见:
http://hadoop.apache.org/docs/r3.1.1/hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html
可以通过如下方式解决此问题:
设置如下参数启用Work-preserving RM restart功能。
“yarn.resourcemanager.work-preserving-recovery.enabled”=“true”