Elasticsearch 2.3 vs elasticsearch 1.7 Java堆空间

时间:2016-11-02 10:53:29

标签: elasticsearch heap-memory quadtree

我在我的机器上运行了两个弹性搜索版本,一个是 1.7 ,其他 2.3 我可以在 1.7 版本中对文档编制索引,但同样的索引语句会在 2.3 中抛出u'caused_by': {u'reason': u'Java heap space', u'type': u'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"
    }
}

用于索引的doc结构是( 2.3 1.7 相同)

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

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

1 个答案:

答案 0 :(得分:5)

尝试增加JAVA_HEAP_SPACE。它对我有用

  1. 从" / etc / sysconfig"
  2. 打开Elasticsearch文件

    sudo vi / etc / sysconfig / elasticsearch

    2.您可以在此处更改堆大小

    ES_HEAP_SIZE =2克

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