安好资讯

当前位置:主页 >> 资讯 >> 今日的新闻

datamax维修Elasticsear

发布时间:2024年05月11日    点击:[12]人次

技术介绍 Elasticsearch在线上服务,百亿级别规模下,取到了较好的性能。近期开始出现检索过程中group或者aggs失败的情形,重启一段时间后问题重现,需要彻底解决。对比与之前稳定版本的改动,仅在mapping文件中,将string类型,统一修改程了lowercase自定义类型,其它无修改,应该不是问题的起因。

在es-sql中的错误提示为:

[fielddata] Data too large, data for [contrib_inst_bigdata] would be larger than limit of [16237422182/15.1gb]"type":"circuit_breaking_exception"

再尝试其他查询,返回也是如此,说明与具体的查询已经没有直接关系,而是ES集群出现了问题。

系统环境操作系统:CentOS 6.8

SSH工具:XShell

Java:1.7

Elasticsearch:2.3.4

线上实操经排查,原来是ES默认的缓存设置让缓存区只进不出引起。indices.fielddata.cache.size 配置fieldData的Cache大小,可以配百分比也可以配一个准确的数值。cache到达约定的内存大小时会自动清理,驱逐一部分FieldData数据以便容纳新数据,默认值为unbounded无限。

直接上解决问题的方法:

vim elasticsearch.yml

增加配置信息:

indices.fielddata.cache.size: 60%

重启Elasticsearch集群即可。

原因分析

关于FieldData的配置在elasticsearch.yml中,也可以通过调用setting接口来修改。API文档里的介绍如下:

indices.fielddata.cache.size The max size of the field data cache, eg 30% of node heap space, or an absolute value, eg 12GB. Defaults to unbounded.

indices.fielddata.cache.expire [experimental] This functionality is experimental and may be changed or removed completely in a future release. A time based setting that expires field data after a certain time of inactivity. Defaults to -1. For example, can be set to 5m for a 5 minute expiry.

也就是说,indices.fielddata.cache.size 配置fieldData的Cache大小,可以配百分比也可以配一个准确的数值。cache到达约定的内存大小时会自动清理,驱逐一部分FieldData数据以便容纳新数据。默认值为unbounded无限。

indices.fielddata.cache.expire用于约定多久没有访问到的数据会被驱逐,默认值为-1,即无限。expire配置不推荐使用,按时间驱逐数据会大量消耗性能。而且这个设置在不久之后的版本中将会废弃。

也就是说有两种方式:通过内存使用阈值进行内存清理;通过内存数据未被使用时间进行内存清理。都可以使用。

转载声明转载本文需注明来源。

美国会诊

去美国看病的中介排名

美国安德森看病咨询怎么样