【问题标题】:spark.executor.extraJavaOptions ignored in spark-submitspark.executor.extraJavaOptions 在 spark-submit 中被忽略
【发布时间】:2018-10-04 17:39:06
【问题描述】:

我是一名新手,正在尝试介绍本地 spark 工作。 这是我尝试执行的命令,但我收到一条警告,指出我的执行程序选项被忽略,因为它们是非 Spark 配置属性。

错误:

警告:忽略非火花配置属性:“spark.executor.extraJavaOptions=javaagent:statsd-jvm-profiler-2.1.0-jar-with-dependencies.jar=server=localhost,port=8086,reporter=InfluxDBReporter ,database=profiler,username=profiler,password=profiler,prefix=MyNamespace.MySparkApplication,tagMapping=namespace.application”

命令:

./bin/spark-submit --master local[2] --class org.apache.spark.examples.GroupByTest --conf “spark.executor.extraJavaOptions=-javaagent:statsd-jvm-profiler-2.1. 0-jar-with-dependencies.jar=server=localhost,port=8086,reporter=InfluxDBReporter,database=profiler,username=profiler,password=profiler,prefix=MyNamespace.MySparkApplication,tagMapping=namespace.application” --name HdfsWordCount --jars /Users/shprin/statD/statsd-jvm-profiler-2.1.0-jar-with-dependencies.jar libexec/examples/jars/spark-examples_2.11-2.3.0.jar

Spark 版本:2.0.3

请告诉我,如何解决这个问题。

提前致谢。

【问题讨论】:

  • 能否请您删除 spark.executor.extraJavaOptions=... 周围的引号并重新开始?我宁愿使用--conf spark.executor.extraJavaOptions="-javaagent:statsd-jvm-profiler-2.1.0-jar-with-dependencies.jar=server=localhost,port=8086,reporter=InfluxDBReporter,database=profiler,username=profiler,password=profiler,prefix=MyNamespace.MySparkApplication,tagMapping=namespace.application",甚至不使用引号。
  • 试过没用1
  • 错误是什么?

标签: apache-spark hadoop


【解决方案1】:

除了上面的答案,如果您的参数同时包含空格和单引号(例如查询参数),您应该用转义双引号将其括起来 \"

例子:

spark-submit --master yarn --deploy-mode cluster --conf "spark.driver.extraJavaOptions=-DfileFormat=PARQUET -Dquery=\"select * from bucket where code in ('A')\" -Dchunk=yes" spark-app.jar

【讨论】:

  • 我必须提供黑白两个选项,如本答案中所述。逗号不起作用。
【解决方案2】:

我认为问题在于您用于指定 spark.executor.extraJavaOptions 的双引号。它应该是一个单引号。

./bin/spark-submit --master local[2] --conf 'spark.executor.extraJavaOptions=-javaagent:statsd-jvm-profiler-2.1.0-jar-with-dependencies.jar=server= localhost,port=8086,reporter=InfluxDBReporter,database=profiler,username=profiler,password=profiler,prefix=MyNamespace.MySparkApplication,tagMapping=namespace.application' --class org.apache.spark.examples.GroupByTest --name HdfsWordCount --jars /Users/shprin/statD/statsd-jvm-profiler-2.1.0-jar-with-dependencies.jar libexec/examples/jars/spark-examples_2.11-2.3.0.jar

【讨论】:

  • spark.executor.extraJavaOptions 周围不需要单/双引号。单/双引号应该围绕选项。
猜你喜欢
  • 2013-01-19
  • 1970-01-01
  • 2016-04-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多