Spark工作进程在运行一段时间后崩溃

4

我正在运行Spark流处理作业。

我的集群配置如下:

Spark version - 1.6.1
spark node  config
cores - 4
memory - 6.8 G (out of 8G)
number of nodes - 3

我的工作需要每个节点提供6GB的内存和3个核心。

工作运行了一个小时后,我在工作日志中看到以下错误。

    Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f53b496a000, 262144, 0) failed; error='Cannot allocate memory' (errno=12)
    #
    # There is insufficient memory for the Java Runtime Environment to continue.
    # Native memory allocation (mmap) failed to map 262144 bytes for committing reserved memory.
    # An error report file with more information is saved as:
    # /usr/local/spark/sbin/hs_err_pid1622.log

我在工作目录/应用ID/标准错误中没有看到任何错误。

通常建议使用的xm*设置来运行spark worker是什么?

如何进一步调试此问题?

注:我使用默认设置启动了我的worker和master。

更新:

我发现我的执行者经常因为错误"无法分配内存"而被添加和删除。

日志:

  16/06/24 12:53:47 INFO MemoryStore: Block broadcast_53 stored as values in memory (estimated size 14.3 KB, free 440.8 MB)
  16/06/24 12:53:47 INFO BlockManager: Found block rdd_145_1 locally
  16/06/24 12:53:47 INFO BlockManager: Found block rdd_145_0 locally
  Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f3440743000, 12288, 0) failed; error='Cannot allocate memory' (errno=12)

请检查此链接:https://support.datastax.com/hc/en-us/articles/205610783-FAQ-Why-are-there-different-places-to-configure-Spark-Worker-memory- - Ram Ghadiyaram
1个回答

1
我遇到了相同的情况。我在官方文档中找到了原因,它说:
一般来说,Spark 可以在每台机器上运行 8 GB 到数百 GB 的内存。在所有情况下,我们建议为 Spark 分配最多只有 75% 的内存;将其余部分留给操作系统和缓冲高速缓存。
您的计算机内存有 8GB,其中 6GB 是用于工作节点。因此,如果操作系统使用的内存超过 2GB,则不会为工作节点留下足够的内存,工作节点将会丢失。 *只需检查操作系统将使用多少内存,并为工作节点分配其余内存*

我很久以前就使用了官方文档中的解决方案http://spark.apache.org/docs/latest/hardware-provisioning.html。 - Knight71
我猜你已经解决了这个问题。我是新来的,刚开始学习Spark。 - Fang

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接