Spark-submit master url and SparkSession master url in the main class, what is difference? -


when submitting job spark-submit set master url , give him main class, ex:

spark-submit --class wordcount --master spark://spark:7077 my.jar

but inside main class spark context define master url :

sparksession.builder().appname("word2vec").master("local"). 

this me confused, happens if send job spark-submit master of standalone cluster (spark://spark:7077) start sparksession local master ?

should sparksession master url same spark-submit url when executed on cluster ?

there no difference between these properties. if set both, properties set directly in application take precedence. quote documentation:

any values specified flags or in properties file passed on application , merged specified through sparkconf. properties set directly on sparkconf take highest precedence, flags passed spark-submit or spark-shell, options in spark-defaults.conf file. few configuration keys have been renamed since earlier versions of spark; in such cases, older key names still accepted, take lower precedence instance of newer key.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -