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.
.setExecutorEnv(\"spark.ui.port\", \"4050\")
--conf spark.ui.port=4050 is a Spark 1.1 feature. You can set it in your codes, such as:
--conf spark.ui.port=4050
val conf = new SparkConf().setAppName(s"SimpleApp").set("spark.ui.port", "4050") val sc = new SparkContext(conf)