How to set a custom environment variable in EMR to be available for a spark Application

后端 未结 3 1072
南笙
南笙 2021-01-17 12:21

I need to set a custom environment variable in EMR to be available when running a spark application.

I have tried adding this:

                   .         


        
相关标签:
3条回答
  • 2021-01-17 12:44

    Add the custom configurations like below JSON to a file say, custom_config.json

    [   
      {
       "Classification": "spark-env",
       "Properties": {},
       "Configurations": [
           {
             "Classification": "export",
             "Properties": {
                 "VARIABLE_NAME": VARIABLE_VALUE,
             }
           }
       ]
     }
    ]
    

    And, On creating the emr cluster, pass the file reference to the --configurations option

    aws emr create-cluster --configurations file://custom_config.json --other-options...
    
    0 讨论(0)
  • 2021-01-17 12:49

    Use classification yarn-env to pass environment variables to the worker nodes.

    Use classification spark-env to pass environment variables to the driver, with deploy mode client. When using deploy mode cluster, use yarn-env.

    0 讨论(0)
  • 2021-01-17 13:10

    For me replacing spark-env to yarn-env fixed issue.

    0 讨论(0)
提交回复
热议问题