Elasticsearch 2.3 与 elasticsearch 1.7 Java 堆空间

标签 elasticsearch heap-memory quadtree

我的机器上运行了两个 elasticsearch 版本,一个是 1.7 另一个是 2.3 我能够在 1.7 版本中索引文档,但相同的索引语句抛出 u'caused_by': {u'reason': u'Java heap space', u'type': u 2.3 中的“out_of_memory_error”

Elasticsearch 2.3 的映射

   {
    "id": {
        "type": "integer",
        "store": "yes",
        "index": "analyzed"
    },
    "field1": {
        "type": "integer",
        "store": "yes",
        "index": "no"
    },
    "field2": {
        "type": "integer",
        "store": "yes",
        "index": "no"
    },
    "field3": {
        "type": "string",
        "store": "yes",
        "index": "no"
    },
    "field4": {
        "type": "geo_shape",
        "tree": "legacyquadtree",
        "precision": "1mm"
    }
}

Elasticsearch 1.7 的映射

  {
    "id": {
        "type": "integer",
        "store": "yes",
        "index": "analyzed"
    },
    "field1": {
        "type": "integer",
        "store": "yes",
        "index": "no"
    },
    "field2": {
        "type": "integer",
        "store": "yes",
        "index": "no"
    },
    "field3": {
        "type": "string",
        "store": "yes",
        "index": "no"
    },
    "field4": {
        "type": "geo_shape",
        "tree": "quadtree",
        "precision": "1mm"
    }
}

用于索引的文档结构是(2.31.7 相同)

      {
        "field4":
            {"type": "envelope", "coordinates":
                data},
        "id": id,
        "field1": val1,
        "field2": val2,
        "field3": val3
    }

指定的 JAVA_HEAP_SIZE 是两个版本的默认值。

最佳答案

尝试增加 JAVA_HEAP_SPACE。它对我有用

  1. 从“/etc/sysconfig”打开 Elasticsearch 文件

sudo vi/etc/sysconfig/elasticsearch

2.你可以在这里改变堆大小

ES_HEAP_SIZE=2g

(默认大小为 2gb。您可以将其增加到可用 ram 的 50%)

关于Elasticsearch 2.3 与 elasticsearch 1.7 Java 堆空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40378155/

相关文章:

elasticsearch - Grafana 条形图 : visualize sum of entries per product type for each month

java - 无法在 PySpark 本地模式下加载 25GB 数据集,可用 56GB RAM

c++ - 如何使这个递归函数更快? (四叉树)

elasticsearch - 每个 Elasticsearch 节点建议的最大 RAM 和磁盘大小是多少?

java - ElasticSearch Java API 异步编写

java - 高 XMX:java.lang.outofmemory native 内存分配 (malloc) 无法为 ChunkPool::allocate 分配 32756 字节

c++ - 将对象指针的数据成员数组初始化为正确的大小和 null

java - 使用四叉树获取边界圆内的所有点

algorithm - 位置点: distance to a specified route

elasticsearch - Elasticsearch 2.1.0