Spark master node addrees with port


I wanted to connect to spark2 for spark streaming purpose from my java code.

This code I’m using when I’m running spark on my local machine.
SparkConf configuration = newSparkConf().setAppName(“kafka-consumer”).setMaster(“local[*]”);
JavaSparkContext sparkContext = new JavaSparkContext(configuration);

But my question is that when I want to connect to remote spark that is available in cloudxlab, then what addrees, port or connection string I need to use inside the setMaster.

Please let me know ASAP.




You may not be able to connect to YARN or spark from remote.

Instead, use: .setMaster(“yarn”)

Afterwards, upload your code to cloudxlab home and compile it there using sbt. Once done, you can run using spark-submit.

Please see here: