select count(*) from ……
语句时,任务长时间不运行查看Yarn UI界面的日志,有以下提示:bash
Diagnostics:Application is added to the scheduler and is not yet activated.
Queue's AM resource limit exceeded. Details : AM Partition = <DEFAULT_PARTITION>; AM Resource Request = <memory:9216MB(9G), vCores:1>; Queue Resource Limit for AM = <memory:454656MB(444G), vCores:1>; User AM Resource Limit of the queue = <memory:229376MB(224G), vCores:1>; Queue AM Resource Usage = <memory:221184MB(216G), vCores:24>; 复制代码
说明任务被提交到调度器,但ApplicationMaster申请的资源超过了上限,剩余可用资源不足以启动AM,所以程序处于挂起状态,不能运行。spa
maximum-am-resource-percent:集群中用于运行应用程序ApplicationMaster的资源比例上限,该参数一般用于限制处于活动状态的应用程序数目。该参数类型为浮点型,我这默认是20%。全部队列的ApplicationMaster资源比例上限可经过参数yarn.scheduler.capacity. maximum-am-resource-percent设置,而单个队列可经过参数yarn.scheduler.capacity.. maximum-am-resource-percent设置适合本身的值。通常不要超过50%。日志
若是是HDP用户code
这个问题不常遇到,通常只有在Yarn正在运行不少任务时出现,记录在此。但致使Yarn任务挂起,一直Accepted状态的缘由不必定是这个。cdn
为使本问题容更容易被搜索到,以上内容涉及:blog
Application Master申请不到资源队列
提交了Yarn任务以后没有分配资源内存
Queue AM Resource Usage,Queue's AM resource limit exceeded.ci
修改集群用于运行应用程序ApplicationMaster的资源比例上限资源
yarn.scheduler.capacity.maximum-am-resource-percent调整
任务处于 Accepted 状态,但集群还有可用资源
周末愉快~
复制代码