DEPLOYMENT MODE
We can specify local/ cluster mode
Cluster mode :
Client mode:
Cluster mode :
- Driver runs on the cluster even if launched from outside.
- Process not killed if the computer submitted is not killed
import findspark findspark.init() # Using spark session object spark_local = SparkSession \ .builder \ .appName("local") \ .config('spark.submit.deployMode', 'cluster') \ .getOrCreate()
- Driver runs where the spark application was launched (local machine)
- Process killed if driver is disconnected
import findspark findspark.init() # Using spark session object spark_local = SparkSession \ .builder \ .appName("local") \ .config('spark.submit.deployMode', 'client') \ .getOrCreate()
No comments:
Post a Comment