Starting SparkR session using external config file
Asked Answered
S

1

0

I have an RStudio driver instance which is connected to a Spark Cluster. I wanted to know if there is any way to actually connect to Spark cluster from RStudio using an external configuration file which can specify the number of executors, memory and other spark parameters. I know we can do it using the below command

sparkR.session(sparkConfig = list(spark.cores.max='2',spark.executor.memory = '8g'))

I am specifically looking for a method which takes spark parameters from an external file to start the sparkR session.

Simonsen answered 12/4, 2018 at 20:14 Comment(0)
M
2

Spark uses standardized configuration layout with spark-defaults.conf used for specifying configuration option. This file should be located in one of the following directories:

  • SPARK_HOME/conf
  • SPARK_CONF_DIR

All you have to do is to configure SPARK_HOME or SPARK_CONF_DIR environment variables and put configuration there.

Each Spark installation comes with template files you can use as an inspiration.

Mimosaceous answered 12/4, 2018 at 20:37 Comment(1)
What I actually need is that I should be able to pass an external spark configuration file through RStudio while connecting to spark so that it does not use the default configurations from spark-defaults.conf fileSimonsen

© 2022 - 2024 — McMap. All rights reserved.