How do I change the spark.ui.port?

让人想犯罪 __ 提交于 2019-12-09 06:49:34

问题


I am using spark-submit and tried to do this in the jar file with .setExecutorEnv("spark.ui.port", "4050") on the spark context, but it still tried to hit 4040. I then tried to put a --conf spark.ui.port=4050 after spark-submit and before --class CLASSNAME, but that didn't work either, this time saying "Error: Unrecognized option '--conf'". How do I get around this? The actual error I'm running into is that there is an active spark server that others are using that is preventing this spark-submit from starting the jetty server. It's then not hitting up other ports, so I'm trying to force it to do that.


回答1:


--conf spark.ui.port=4050 is a Spark 1.1 feature. You can set it in your codes, such as:

val conf = new SparkConf().setAppName(s"SimpleApp").set("spark.ui.port", "4050")
val sc = new SparkContext(conf)


来源:https://stackoverflow.com/questions/27388332/how-do-i-change-the-spark-ui-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!