繁体   English   中英

Spark提交在纱线集群模式下截断参数

[英]Spark submit truncates arguments in yarn cluster mode

我使用以下命令在集群部署模式下在纱线集群上运行火花应用程序

spark-submit --conf spark.executor.memory=24g --conf spark.master=yarn --conf spark.submit.deployMode=cluster --conf spark.executor.extraJavaOptions=-Dfile.encoding=UTF-8 --conf spark.files=file:///opt/configurations/app.conf --class com.example.HelloWorld --queue sample_q file:///opt/jars/example.jar '{"sample":{}}'

此命令未将整个参数传递给 HelloWorld 类。 传递的主要方法参数: {"sample":{预期的主要方法参数: {"sample":{}}

相同的命令在客户端部署模式下正常运行

spark-submit --conf spark.executor.memory=24g --conf spark.master=yarn --conf spark.submit.deployMode=client --conf spark.executor.extraJavaOptions=-Dfile.encoding=UTF-8 --conf spark.files=file:///opt/configurations/app.conf --class com.example.HelloWorld --queue sample_q file:///opt/jars/example.jar '{"sample":{}}'

在检查 yarn 工作节点中的launch_container.sh脚本后,发现该命令中还包含截断的字符串( --arg '{\\"sample\\":{'

火花版本:2.3

Hadoop 版本:2.7.3

Yarn 将{{}}视为参数扩展字符,因此任何出现都被视为环境变量并替换为相应的值。 因为没有环境变量。

这会导致集群部署模式出现问题,因为驱动程序在纱线集群中运行。

参考: YarnApplicationConstants

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM