我正在运行一个8核,32g RAM弹性搜索节点,包含5个分片,4亿个(小)文档.
一切都运行良好,直到我运行agg搜索,然后分片开始失败:
java.lang.OutOfMemoryError: Java heap space
我用以下内容更改了堆大小 :(
export ES_HEAP_SIZE=16g
也ES_MAX_MEM
和ES_MIN_MEM
相同)
还更改了yml
elasticsearch 的文件:
bootstrap.mlockall: true
甚至(安装文件推荐):
sudo sysctl -w vm.max_map_count=262144
重启服务仍然没有影响 java.lang.OutOfMemoryError: Java heap space
还有其他建议吗?除了不运行agg查询?
查询是:
https://localhost:9200/my_index_name/_search?search_type=count { "aggs": { "distinct_hostname": { "cardinality": { "field": "hostname" } } } }
B.P.. 19
我想我发现了这个错误.我使用'service'来运行elasticsearch,因此我的环境变量被剥离了.我不得不/etc/default/elasticsearch
使用correcct env变量更新文件(特别是ES_HEAP_SIZE=16g
).
到目前为止,它运行良好,应用程序没有错误.
我想我发现了这个错误.我使用'service'来运行elasticsearch,因此我的环境变量被剥离了.我不得不/etc/default/elasticsearch
使用correcct env变量更新文件(特别是ES_HEAP_SIZE=16g
).
到目前为止,它运行良好,应用程序没有错误.
不是EXPORT _JAVA_OPTIONS
,EXPORT ES_HEAP_SIZE
或者不是使用命令行参数来更新Elasticsearch 5的Java堆大小的正确方法。据我所知,所有这些都被Elasticsearch安装目录中的配置文件覆盖config/jvm.options
。要更改这些设置,您需要在该文件中编辑以下行:
# Xms represents the initial size of total heap space # Xmx represents the maximum size of total heap space -Xms2g -Xmx2g