简体   繁体   English

如何在YARN集群中的特定节点上启动Spark的ApplicationMaster?

[英]How to launch Spark's ApplicationMaster on a particular node in YARN cluster?

I have a YARN cluster with a master node running resource manager and 2 other nodes. 我有一个YARN集群,其中一个主节点运行资源管理器和另外两个节点。 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? 有没有办法可以配置集群中的哪个节点启动Spark应用程序主服务器?

I ask this because if application master launches in master node it works fine but if it starts in other nodes I get this: 我问这个是因为如果应用程序主服务器在主节点中启动它工作正常,但如果它在其他节点启动我得到这个:

Retrying connect to server: 0.0.0.0/0.0.0.0:8030 . 重试连接到服务器:0.0.0.0/0.0.0.0:8030

and the job is simply accepted and never runs 而这项工作只是被接受而且从不运行

If you're using a new enough version of YARN (2.6 or newer, according to Spark docs ), you can use node labels in YARN . 如果您使用的是足够新版本的YARN(2.6或更新版本,根据Spark文档 ),您可以在YARN中使用节点标签

This Hortonworks guide walks through applying node labels to your YARN NodeManagers . 本Hortonworks指南介绍了如何将节点标签应用于YARN NodeManagers

If you use Spark 1.6 or newer, then this JIRA added support for using the YARN node labels in Spark; 如果您使用Spark 1.6或更高版本,则此JIRA添加了对在Spark中使用YARN节点标签的支持; 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. 然后,您只需传递spark.yarn.am.nodeLabelExpression以限制AppMaster节点放置,如果需要,可以使用spark.yarn.executor.nodeLabelExpression进行执行程序放置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM