【问题标题】:How to increase AM container size in spark-submit command? ERROR: container is running beyond physical memory limits如何在 spark-submit 命令中增加 AM 容器大小?错误:容器运行超出物理内存限制
【发布时间】:2020-02-03 13:15:31
【问题描述】:

我正在尝试对 AWS 上的一些数据执行 spark 应用程序。我能够在 AWS 上使用 20 台 m4.large 机器处理整个数据。现在,我用 c4.8xlarge 机器尝试了同样的方法,但得到了以下错误:

    AM Container for appattempt_1570270970620_0001_000001 exited with exitCode: -104
    Failing this attempt.Diagnostics: Container [pid=12140,containerID=container_1570270970620_0001_01_000001] is running beyond physical memory limits. Current usage: 1.4 GB of 1.4 GB physical memory used; 3.5 GB of 6.9 GB virtual memory used. Killing container.
    {...}
    Container killed on request. Exit code is 143
    Container exited with a non-zero exit code 143

我用来运行集群的命令是:

    spark-submit --deploy-mode cluster --class xyzpackage.xyzclass --master yarn --jar s3://path/xyz_2.11-1.0.jar --arg s3://path_to_files/xy.csv --arg s3://output_path/newfile

当应用程序启动时,我会看到以下信息:

    19/10/05 10:42:04 INFO RMProxy: Connecting to ResourceManager at ip-172-31-30-66.us-east-2.compute.internal/172.31.30.66:8032
19/10/05 10:42:04 INFO Client: Requesting a new application from cluster with 20 NodeManagers
19/10/05 10:42:04 INFO Client: Verifying our application has not requested more than the maximum memory capability of the cluster (53248 MB per container)
19/10/05 10:42:04 **INFO Client: Will allocate AM container, with 1408 MB memory including 384 MB overhead**
19/10/05 10:42:04 INFO Client: Setting up container launch context for our AM
19/10/05 10:42:04 INFO Client: Setting up the launch environment for our AM container
19/10/05 10:42:04 INFO Client: Preparing resources for our AM container

AM 容器分配了 1408MB~1.4GB 内存,因此我收到了错误消息。如何增加 AM 容器内存?我试过了,但没有运气:

spark-submit --deploy-mode cluster --class xyzpackage.xyzclass --master yarn  --conf spark.yarn.executor.memoryOverhead=8000 --driver-memory=91G --jar s3://path/xyz_2.11-1.0.jar --arg s3://path_to_files/* --arg s3://output_path/newfile

如何编辑此命令以增加 AM 容器大小?

【问题讨论】:

  • 如果将yarn.nodemanager.vmem-check-enabledyarn.nodemanager.pmem-check-enabled 设置为false 会怎样?

标签: amazon-web-services apache-spark amazon-ec2 hadoop-yarn spark-submit


【解决方案1】:

我发现了我的命令中的错误。更改执行器内存和开销内存的配置命令是:

spark-submit --deploy-mode cluster --class xyzpackage.xyzclass --master yarn  --conf spark.driver.memoryOverhead=2048 --conf spark.executor.memoryOverhead=2048--jar s3://path/xyz_2.11-1.0.jar --arg s3://path_to_files/* --arg s3://output_path/newfile

但我想直接使用 spark.executor/driver.memory 更改执行程序内存是更好的选择,并且让 memoryOverhead 成为执行程序/驱动程序内存的 10%。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-01
    • 2018-03-30
    • 1970-01-01
    • 2022-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多