1from pyspark.conf import SparkConf
2from pyspark.sql import SparkSession, Catalog
3
4spark_conf = SparkConf()
5spark_conf.setAll([
6 ('spark.master', 'spark://<master-ip>:7077'),
7 ('spark.app.name', 'myApp'),
8 ('spark.submit.deployMode', 'client'),
9 ('spark.ui.showConsoleProgress', 'true'),
10 ('spark.eventLog.enabled', 'false'),
11 ('spark.logConf', 'false'),
12 ('spark.driver.bindAddress', '0.0.0.0'),
13 ('spark.driver.host', '<master-ip>')
14])
15
16spark = SparkSession.builder.config(conf=spark_conf).getOrCreate()