小智 7
Elasticsearch 5.0.0或更高版本不再支持此功能.最佳做法是定期创建索引(每天最常见),然后在数据足够大时删除索引.
以下是如何删除索引的参考(https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html)
这篇文章(虽然它足以引用_ttl)也提供了一些见解:https://www.elastic.co/blog/using-elasticsearch-and-logstash-to-serve-billions-of-searchable-events-for- 顾客
提醒一下,最好通过代理保护您的Elasticsearch集群免受外部世界的影响,并限制可以发送到您的集群的方法.这样,您可以防止群集被赎回.
是的,您可以对数据设置 TTL。请在此处查看可用的配置选项。
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html
https://www.elastic.co/guide/en/elasticsearch/reference/2.0/mapping-ttl-field.html
注意:从 ES 版本 2.0.0-beta2 开始,这是旧功能并被索引生命周期管理 (ILM) 取代,请参阅https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle -管理.html