簡體   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