简体   繁体   English

在Spark Submit中访问Spark集群模式

[英]Accessing spark cluster mode in spark submit

I am trying to run my spark scala code using spark submit. 我正在尝试使用spark提交运行我的spark scala代码。 I want to access the spark cluster for this purpose. 为此,我想访问Spark集群。 So, what should I use for the master in the Spark Context? 那么,我应该在Spark上下文中对主服务器使用什么? I have used like this 我已经习惯了

val spark = SparkSession.builder()
      .master("spark://prod5:7077")
      .appName("MyApp")
      .getOrCreate;

But it doesn't seem to work. 但这似乎不起作用。 What should I use as the master for using spark cluster? 我应该使用什么作为使用Spark Cluster的主机?

如果要在IDE中提交作业,只需确保“ prod5”是主服务器,然后尝试将端口默认更改为6066。

从官方文档-

spark-submit --class <main-class>  --master <master-url> --deploy-mode <deploy-mode>  --conf <key>=<value> ... # other options <application-jar>  [application-arguments]

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

相关问题 Spark提交在纱线集群模式下截断参数 - Spark submit truncates arguments in yarn cluster mode Spark-Submit 集群模式下读取application.conf - Spark-Submit read application.conf in cluster mode 在集群模式下(Scala / java)出现带有Mahout错误的spark-submit - spark-submit with Mahout error on cluster mode (Scala/java) Unable to submit a spark job on spark cluster on docker - Unable to submit a spark job on spark cluster on docker 为什么使用主纱线和部署模式群集的`spark.yarn.stagingDir`导致火花提交失败 - Why spark-submit fails with `spark.yarn.stagingDir` with master yarn and deploy-mode cluster 在Yarn集群上提交Spark作业 - Submit Spark job on Yarn cluster 在部署模式=集群下提交火花应用程序时如何读取边缘节点上存在的文件 - how to read a file present on the edge node when submit spark application in deploy mode = cluster 使用java.io.File.mkdirs()将File写入目录,然后访问它在Spark Cluster模式下不起作用 - Writing File to a directory using java.io.File.mkdirs() and then accessing it not working in spark cluster mode 无法连接到 intellij 上的 spark 集群,但 spark-submit 可以 - Cannot connect to spark cluster on intellij but spark-submit can 无法使用代码将应用程序提交给Spark-Cluster - Can not submit application to spark-cluster in code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM