在Hadoop 2.7.2集群下执行如下命令:

spark-shell  --master yarn --deploy-mode client

爆出下面的错误:

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

在Yarn WebUI上面查看启动的Cluster状态,log显示为:

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.

这是由于虚拟内存大小超过了设定的数值,可以修改配置,进行规避。

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

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

It can be 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
     <property>
              <name>yarn.nodemanager.vmem-check-enabled</name>
              <value>false</value>
              <description>Whether virtual memory limits will be enforced for containers</description>
    </property>
              <property>
              <name>yarn.nodemanager.vmem-pmem-ratio</name>
              <value>4</value>
              <description>Ratio between virtual memory to physical memory when setting memory limits for containers</description>
    </property>

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

执行”spark-shell –master yarn –deploy-mode client”,虚拟内存大小溢出,报错的更多相关文章

  1. 执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client

    1.执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client,错误如下所示: // :: ERROR SparkContext: Error init ...

  2. 解决: Homestead 环境下, yarn install --no-bin-links, NPM run dev, 命令报错

    执行以下命令: 1 $ rm -rf node_modules 2 $ yarn config set registry http://registry.cnpmjs.org 3 $ yarn ins ...

  3. win10系统在执行“ vagrant box add centos7 vagrant-centos-7.box”添加box时,报错“Vagrant failed to initialize at a very early stage: Failed to locate the powershell executable on the available PATH. ”

    这个意思是:在有效的路径中未能执行PowerShell命令. 请检查PowerShell的安装和有效的路径,然后再尝试重新运行这个命令. 在环境变量path中添加powershell的路径,例如:C: ...

  4. pytest框架执行自动化测试时使用pycharm正常运行,使用cmd或Terminal报错:Hint: make sure your test modules/packages have valid Python names.

    问题描述: 使用pytest框架做接口自动化测试时,在测试用例所在的.py文件下使用pycharm的run功能可以正常跑用例,使用cmd运行窗口或Terminal则报下图中的错误: Hint: mak ...

  5. 大数据技术之_19_Spark学习_01_Spark 基础解析 + Spark 概述 + Spark 集群安装 + 执行 Spark 程序

    第1章 Spark 概述1.1 什么是 Spark1.2 Spark 特点1.3 Spark 的用户和用途第2章 Spark 集群安装2.1 集群角色2.2 机器准备2.3 下载 Spark 安装包2 ...

  6. 【原创 Hadoop&Spark 动手实践 5】Spark 基础入门,集群搭建以及Spark Shell

    Spark 基础入门,集群搭建以及Spark Shell 主要借助Spark基础的PPT,再加上实际的动手操作来加强概念的理解和实践. Spark 安装部署 理论已经了解的差不多了,接下来是实际动手实 ...

  7. spark-shell启动报错:Yarn application has already ended! It might have been killed or unable to launch application master

    spark-shell不支持yarn cluster,以yarn client方式启动 spark-shell --master=yarn --deploy-mode=client 启动日志,错误信息 ...

  8. Salt Master报错:Minion did not return. [No response]

    在salt master端执行salt ‘*’ test.ping时,某一节点出现如下报错:Minion did not return. [No response] 登陆到这一节点查看minion的日 ...

  9. k8s集群node节点一直NotReady, 且node节点(并非master)的kubelet报错:Unable to update cni config: No networks found in /etc/cni/net.d

    若要转载本文,请务必声明出处:https://www.cnblogs.com/zhongyuanzhao000/p/11401031.html 问题: 集群搭建的过程中,master节点初始化成功,但 ...

随机推荐

  1. struts2 action 字段问题

    struts2最多只能解释两级字段,比如user.username,像user.info.age在类中属性类的三段字符不能识别,只能先用user,info 然后在user.setInfo(info);

  2. 在Strust2 使用datatimepicker 标签引发的一系列问题

    问题:出现无法识别的问题 原因:Strust2.1开始,对于ajax类的标签不再使用<%@ taglib prefix="s" uri="/struts-tags& ...

  3. [USACO06DEC] Milk Patterns

    题目描述 Farmer John has noticed that the quality of milk given by his cows varies from day to day. On f ...

  4. [UOJ300]吉夫特

    直接上lucas定理,可以得到$\binom nm=1$等价于$m$是$n$的子集(二进制) 因为数字两两不同,所以设$f_i$表示以$i$开头的满足要求的序列有多少个,转移就是$f_i\gets f ...

  5. 【贪心】bzoj3850 ZCC Loves Codefires

    类似某noip国王游戏. 考虑交换两个题目的顺序,仅会对这两个题目的贡献造成影响. 于是sort,比较时计算两个题目对答案的贡献,较小的放在前面. #include<cstdio> #in ...

  6. @RequestMapping注解的使用,Controller方法返回值

    1,web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version=" ...

  7. iOS开发技巧——Autolayout动画

          使用Autolayout时需要在动画的代码前面后面添加 layoutIfNeeded方法 Animation AutoLayout也可以配合传统的animation方法,整体代码结构如下. ...

  8. 重大新闻:腾讯大杀器来了,QQ浏览器微信版推出

    今日,腾讯在推出windows桌面版的微信后,又发布了一个重量级产品:QQ浏览器微信版 我们在PC端用微信又多了一种方式,而且比windows桌面版本更加友好,更加方便. 我相信:对于我们绝大多数办公 ...

  9. hibernate CascadeType属性

    CascadeType.PERSIST 只有A类新增时,会级联B对象新增.若B对象在数据库存(跟新)在则抛异常(让B变为持久态) : 级联保存,当调用了Persist() 方法,会级联保存相应的数据 ...

  10. Android--使用XMLPull解析xml

    在Android中极力推荐的xmlpull方式解析xml.xmlpull不只能够使用在Android上.相同也适用于javase,但在javase环境下.你须要自己去获取xmlpull所依赖的类库. ...