30

在我的测试 ELK 集群上,我在尝试查看上周的数据时遇到了以下错误。

Data too large, data for [@timestamp] would be larger than limit

关于分片失败的警告似乎具有误导性,因为 elasticsearch 监控工具kopf显示head所有分片都正常工作,并且弹性集群是绿色的。

在此处输入图像描述

谷歌弹性搜索组中的一位用户建议增加内存。我已将 3 个节点增加到 8GB,每个节点有 4.7GB 堆,但问题仍然存在。我每天生成大约 5GB 到 25GB 的数据,保留 30 天。

4

4 回答 4

55

清除缓存暂时可以缓解症状。

http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html

清除单个索引

curl -XPOST 'http://localhost:9200/twitter/_cache/clear'

清除多个指标

curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_cache/clear'

curl -XPOST 'http://localhost:9200/_cache/clear'

或者按照 IRC 用户的建议。这个似乎效果最好。

curl -XPOST 'http://localhost:9200/_cache/clear' -d '{ "fielddata": "true" }'

更新:一旦集群移动到更快的管理程序,这些错误就消失了

于 2015-04-22T23:05:27.997 回答
9

问题是 ES_JAVA_OPTS 给 Elasticsearch 的内存。

尝试使用以下命令提供更多内存:ES_JAVA_OPTS="-Xmx2g -Xms2g"。

于 2019-09-06T13:28:20.123 回答
3

_cacheAPI 还支持仅通过普通的 URI 查询参数对线程池的字段数据、请求等进行有针对性的清除。

原型,见占位符<cache type>

$ curl -XPOST \
    -H "Content-Type: application/json" \
    'http://localhost:9200/_cache/clear?<cache type>=true'

例子

$ curl -XPOST \
    -H "Content-Type: application/json" \
    'http://localhost:9200/_cache/clear?fielddata=true'
$ curl -XPOST \
    -H "Content-Type: application/json" \
    'http://localhost:9200/_cache/clear?request=true'

注意:您还可以针对特定索引,在下面替换 where <index>

$ curl -XPOST \
    -H "Content-Type: application/json" \
    'http://localhost:9200/<index>/_cache/clear?request=true'

参考

于 2020-06-27T01:21:54.810 回答
1

清除缓存对我们的集群不起作用。当使用http://xxxx:9200/_cat/indices?v&s=index:desc检查各个节点时,一个给出了上述错误,而其他的则出现了无效指针错误。我在给出速率限制/数据太大错误的那个上重新启动了弹性服务。当它重新上线时,有一些未分配的分片,我通过将复制计数降低到较低的数字来修复它(只需要在其中一个节点上执行此操作以更改集群的索引设置):

IFS=$'\n'
for line in $(curl -s 'elastic-search.example.com:9200/_cat/shards' | fgrep UNASSIGNED); do
  INDEX=$(echo $line | (awk '{print $1}'))
  echo start $INDEX
  curl -XPUT "elastic-search.example.com:9200/$INDEX/_settings" -d '{
      "index" : {
        "number_of_replicas" : 1
      }
    }
    '
done

# Check shard/cluster status (may take some time to rebalance):
# http://elastic-search.example.com:9200/_cat/shards?v&s=index:desc
# http://elastic-search.example.com:9200/_cluster/health?pretty

此外https://discuss.elastic.co/t/data-too-large/32141似乎提到它可能是 JVM 堆大小的问题。

于 2018-09-05T20:06:53.273 回答