【问题标题】:Spark on Yarn: driver memory is checked on the client side?Spark on Yarn:在客户端检查驱动程序内存?
【发布时间】:2014-10-27 14:54:02
【问题描述】:

我以为我很了解纱线架构的火花,但现在我想知道:什么时候发布

spark-submit --master yarn-cluster --class     com.domain.xxx.ddpaction.DdpApp --num-executors 24 --deploy-mode cluster --driver-memory 4g --executor-memory 2g --executor-cores 1 --conf "spark.yarn.jar=/spark/lib/spark-assembly-1.1.0-hadoop2.4.0.jar" ddpaction-3.1.0.jar yarn-cluster config.yml

它失败了一个

# Native memory allocation (malloc) failed to allocate 2863333376 bytes for committing reserved memory

我启动 spark-submit 的服务器的可用内存少于 2GB,这会导致错误,但资源管理器,驱动程序应该执行的位置远远超过设置为的 4GB驱动程序内存参数。 为什么在我的理解中只能在资源管理器中的纱线集群上检查和分配的驱动程序内存值分配在以纱线集群模式启动 spark-submit 的服务器上?

【问题讨论】:

    标签: apache-spark hadoop-yarn


    【解决方案1】:

    这是一个已在 Spark-1.4.0 中修复的错误,请参阅 SPARK-3884

    【讨论】:

    • 是的,我看到了,我是重复问题记者之一 :-)
    【解决方案2】:

    看来 spark-submit 脚本的简化很糟糕:

    elif [ "$1" = "--driver-memory" ]; then
        export SPARK_SUBMIT_DRIVER_MEMORY=$2
    

    所以spark-submit使用驱动内存参数值来设置其分配的内存;这仅在 yarn-client 模式下是正确和需要的,而不是在 yarn-cluster 中。 我通过替换这些行解决了我的问题:

    elif [ "$1" = "--spark-submit-memory" ]; then
        export SPARK_SUBMIT_DRIVER_MEMORY=$2
    

    所以现在我可以(如果需要)将分配给 spark-submit 的内存设置为驱动程序之一的不同值。

    【讨论】:

      猜你喜欢
      • 2019-01-06
      • 2016-07-23
      • 1970-01-01
      • 2017-08-27
      • 2017-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多