Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EMR conf spark-default settings

I am using configuration file according to guides Configure Spark to setup EMR configuration on AWS, for example, changing the spark.executor.extraClassPath is via the following settings:

{
     "Classification": "spark-defaults",
     "Properties": {
         "spark.executor.extraClassPath": "/home/hadoop/mongo-hadoop-spark.jar",
     }
}

It works prefect and do change spark.executor.extraClassPath on emr spark conf, but emr has some preset default paths in spark.executor.extraClassPath, so instead of overwriting the spark.executor.extraClassPath.I would like to know if there is a way to append the path and keep the default paths such as

{
     "Classification": "spark-defaults",
     "Properties": {
         "spark.executor.extraClassPath": "{$extraClassPath}:/home/hadoop/mongo-hadoop-spark.jar",
     }
}
like image 934
ZhouQuan Avatar asked Feb 11 '19 16:02

ZhouQuan


People also ask

Where is Spark defaults Conf located EMR?

Normally, there is a spark-defaults. conf file located in /etc/spark/conf after I create a spark cluster on EMR. Following the instructions from http://docs.aws.amazon.com//ElasticMapReduce/latest/ReleaseGuide/emr-configure-apps.html , i'm trying to add a jar to the driver and executor extraClassPath properties.

Where is Spark config setting?

Note: In client mode, this config must not be set through the SparkConf directly in your application, because the driver JVM has already started at that point. Instead, please set this through the --driver-java-options command line option or in your default properties file. spark.


1 Answers

You can specify it in your emr template as follows

Classification: spark-defaults
          ConfigurationProperties:
            spark.jars: Your jar location
like image 175
Emerson Avatar answered Oct 15 '22 23:10

Emerson