Elasticsearch 2.3 vs elasticsearch 1.7 Java堆空间

Anu*_*ola 1 heap-memory quadtree elasticsearch

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

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"
    }
}
Run Code Online (Sandbox Code Playgroud)

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"
    }
}
Run Code Online (Sandbox Code Playgroud)

用于索引的doc结构是(2.31.7都相同)

      {
        "field4":
            {"type": "envelope", "coordinates":
                data},
        "id": id,
        "field1": val1,
        "field2": val2,
        "field3": val3
    }
Run Code Online (Sandbox Code Playgroud)

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

Jee*_*a N 5

尝试增加JAVA_HEAP_SPACE.它对我有用

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

sudo vi/etc/sysconfig/elasticsearch

你可以在这里改变堆大小

ES_HEAP_SIZE =2克

(默认大小为2GB.您可以将其增加到可用内存的50%)