Execute "spark-shell–master yarn–deploy-mode client", Virtual memory size overflow, error

Source: Internet
Author: User

Execute the following command under Hadoop 2.7.2 cluster:

Spark-shell--master Yarn--deploy-mode Client

The following error has been burst:

Org.apache.spark.SparkException:Yarn application has already ended! It might has been killed or unable to launch application master.

On the Yarn WebUI view the cluster status of the boot, log is displayed as:

Container [pid=28920,containerid=container_1389136889967_0001_01_000121] is running beyond virtual memory limits. Current
usage:1.2 GB of 1 GB physical memory used; 2.2 GB of 2.1 GB virtual memory used. Killing container.

This is because the virtual memory size exceeds the set value, you can modify the configuration, to circumvent.

There is a check placed at Yarn level for vertual and physical memory usage ratio. Issue is not the only that VM doesn ' t has sufficient pysical memory. But it's because Virtual memory usage is more than expected for given physical memory.

Note : This was happening on Centos/rhel 6 due to its aggressive allocation of virtual memory.

It can resolved either by:

    1. Disable Virtual memory usage check by setting yarn.nodemanager.vmem-check-enabled to false;
    2. Increase vm:pm ratio by setting yarn.nodemanager.vmem-pmem-ratio to some higher value (default value is 2.1).

Add following property in Yarn-site.xml
    &NBSP;<PROPERTY>
              <NAME>YARN.NODEMANAGER.VMEM-CHECK-ENABLED</NAME>
              <VALUE>FALSE</VALUE>
          &N Bsp   <description>whether virtual memory limits is enforced for Containers</description>
  & nbsp </property>
              <property>
        &NB Sp     <name>yarn.nodemanager.vmem-pmem-ratio</name>,
            & nbsp <value>4</value>
              <description>ratio between Virtual memory to physical memory when setting memory limits for Containers</description>
    </prop Erty>

3.Then, restart yarn.

Reference:

http://blog.cloudera.com/blog/2014/04/apache-hadoop-yarn-avoiding-6-time-consuming-gotchas/

Http://blog.chinaunix.net/uid-28311809-id-4383551.html

Http://stackoverflow.com/questions/21005643/container-is-running-beyond-memory-limits

Execute "spark-shell–master yarn–deploy-mode client", Virtual memory size overflow, error

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.