There are two parts to authentication support:
- privacy setting on the main and all subordinates
- using the same secret when sending jobs to the cluster
master and slaves
on each server in your cluster add the following configuration to conf/spark-defaults.conf:
spark.authenticate.secret SomeSecretKey
job submission
when you initialize the spark context, you must add the same configuration to it, namely:
val conf = new SparkConf()
.set("spark.authenticate.secret", "SomeSecretKey")
val sc = new SparkContext(conf)
or if you use SparkSession:
val spark = SparkSession.builder()
.conf("spark.authenticate.secret", "SomeSecretKey")
.getOrCreate()
source
share