2016-11-02 57 views
0

我在我的機器上一個運行兩個elasticsearch版本是1.72.3 我能指數1.7版本的文檔,但相同的索引的語句拋出u'caused_by': {u'reason': u'Java heap space', u'type': u'out_of_memory_error'}2.3Elasticsearch 2.3 VS elasticsearch 1.7 Java堆空間

映射爲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是兩個版本的默認值。

回答

4

嘗試增加JAVA_HEAP_SPACE。它爲我工作

    從 「在/ etc/SYSCONFIG」

sudo的VI的/ etc/SYSCONFIG/elasticsearch

2.You可以更改堆在這裏的大小

  • 打開Elasticsearch文件

    ES_HEAP_SIZE = 2g

    (默認大小是2GB,可以將其增加到可用RAM的50%)