Tuesday, July 10, 2018

Deployment mode is spark


DEPLOYMENT MODE 
We can specify local/ cluster 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()

Client mode:
  • 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