If you use intrinsic safety, then
val conf = new SparkConf().setMaster("spark://master")
and you can pass the parameter while sending the job
spark-submit --master spark:
If you use a local spark, then
val conf = new SparkConf().setMaster("local[2]")
you can pass the parameter while sending the job
spark-submit --master local
if you use a spark on yarn then
spark-submit
source share