如何在YARN群集中的特定节点上启动Spark的ApplicationMaster? [英] How to launch Spark's ApplicationMaster on a particular node in YARN cluster?
问题描述
我有一个YARN群集,其中的一个主节点运行资源管理器,另外两个节点.我可以在纱线群集"模式下从客户端计算机提交spark应用程序.有什么方法可以配置集群中的哪个节点启动Spark应用程序主服务器?
I have a YARN cluster with a master node running resource manager and 2 other nodes. I am able to submit a spark application from a client machine in "yarn-cluster" mode. Is there a way I can configure which node in the cluster launches the Spark application master?
我之所以这样问,是因为如果应用程序主控器在主控节点中启动,则可以正常工作,但如果它在其他节点中启动,则可以得到此信息:
I ask this because if application master launches in master node it works fine but if it starts in other nodes I get this:
正在重试连接到服务器:0.0.0.0/0.0.0.0:8030 .
工作被简单接受并且永远不会运行
and the job is simply accepted and never runs
推荐答案
根据纱网中的节点标签.
此Hortonworks指南逐步介绍了应用节点标签到您的YARN NodeManagers .
This Hortonworks guide walks through applying node labels to your YARN NodeManagers.
如果您使用Spark 1.6或更高版本,则此JIRA 添加了对在Spark中使用YARN节点标签;然后,您只需传递 spark.yarn.am.nodeLabelExpression
来限制AppMaster节点的放置,如果需要,可以通过 spark.yarn.executor.nodeLabelExpression
来确定执行者的位置.
If you use Spark 1.6 or newer, then this JIRA added support for using the YARN node labels in Spark; you then simply pass spark.yarn.am.nodeLabelExpression
to restrict AppMaster node placement, and if you ever need it, spark.yarn.executor.nodeLabelExpression
for executor placement.
这篇关于如何在YARN群集中的特定节点上启动Spark的ApplicationMaster?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!