2015-04-04 60 views
29

當我嘗試過啓動我的Ubuntu的elasticsearch啓動腳本給我下面的錯誤:Elasticsearch內存問題

Java HotSpot(TM) Client VM warning: INFO: os::commit_memory(0x74800000, 201326592, 0) failed; error='Cannot allocate memory' (errno=12) 
# 
# There is insufficient memory for the Java Runtime Environment to continue. 
# Native memory allocation (malloc) failed to allocate 201326592 bytes for committing reserved memory. 

我已經嘗試通過這個搜索,我無法找到解決方案這個。如果我重新啓動機器,一切運行良好一天,然後彈性搜索出現並出現此錯誤。

我已經設置該屬性bootstrap.mlockall:真正在elasticsearch.yml的文件,並在默認elasticsearch文件的屬性:

ES_HEAP_SIZE=512 (I have 1GB of RAM) 
MAX_LOCKED_MEMORY=unlimited 

有人知道我需要做什麼?

感謝

+0

感覺像你操作系統有serieus內存問題,你可以檢查os日誌?也許更多的信息是基於其他過程發生的。另外檢查與mlockall相關的選項:http://www.elastic.co/guide/en/elasticsearch/reference/1.4/setup-configuration.html。你確定你只在服務器上運行一個elasticsearch節點嗎?沒有其他東西在同一個盒子上運行? – 2015-04-05 15:52:28

回答

39

你已經配置的虛擬機與1 GB的RAM,但彈性正在試圖啓動與2 GB的RAM(默認爲Elasticsearch 5.x版)

無論你的虛擬機給更多的內存,或更改Elasticsearch JVM settings/etc/elasticsearch/jvm.options並降低以下參數的值:-Xms512m -Xmx512m

+0

It's working .. thanksss – Vicky 2017-09-21 07:18:48

+0

這裏有一個有用的線程,以防其他任何人在docker中運行它https://github.com/elastic/elasticsearch-docker/issues/43 – timlyo 2017-11-23 09:25:56

1

您需要通過下面的參數來啓動elasticsearch: ./bin/elasticsearch -Xmx512m -Xms512

但是似乎你的內存(1G)過低運行elasticsearch。

26

對於當前版本的彈性(5.X)可以在jvm.options文件通常目錄下/etc/elasticsearch/jvm.options位於配置jvm startup options

-Xms1g -Xmx1g 

希望它能幫助。