Sau*_*eet 3 indexing elasticsearch logstash
我想配置我的elasticsearch 0.19.11每60秒删除一次索引.我的elasticsearch配置有以下3行:
node.name: "Saurajeet"
index.ttl.disable_purge: false
index.ttl.interval: 60s
indices.ttl.interval: 60s
Run Code Online (Sandbox Code Playgroud)
它不起作用我有2个索引的默认文档.并期望它能追溯到60年代
$ curl -XGET http://localhost:9200/twitter/_settings?pretty=true
{
"twitter" : {
"settings" : {
"index.version.created" : "191199",
"index.number_of_replicas" : "1",
"index.number_of_shards" : "5"
}
}
Run Code Online (Sandbox Code Playgroud)
此外,如果我试图做以下它没有任何影响
$ curl -XPUT http://localhost:9200/twitter/_settings -d '
> { "twitter": {
> "settings" : {
> "index.ttl.interval": "60s"
> }
> }
> }
> '
{"ok":true}~/bin/elasticsearc
$ curl -XGET http://localhost:9200/twitter/_settings?pretty=true
{
"twitter" : {
"settings" : {
"index.version.created" : "191199",
"index.number_of_replicas" : "1",
"index.number_of_shards" : "5"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我有索引2个文件,它仍然在1小时后出现
$ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '
{
"user": "kimchy",
"postDate": "2009-11-15T13:12:00",
"message": "Trying out Elastic Search, so far so good?"
}'
$ curl -XPUT 'http://localhost:9200/twitter/tweet/2' -d '
{
"user": "kimchy",
"postDate": "2009-11-15T13:12:00",
"message": "Trying out Elastic Search, so far so good?"
}'
Run Code Online (Sandbox Code Playgroud)
我做错了什么
PS我想用logstash部署这个配置.因此可以建议任何其他替代方案.出于缩放的原因,我不希望这个autopurge成为一个脚本.
我相信indices.ttl.interval设置只是为了调整清理过程的时间.
您需要为索引/类型设置_ttl字段才能使其过期.它看起来像这样:
{
"tweet" : {
"_ttl" : { "enabled" : true, "default" : "60s" }
}
}
Run Code Online (Sandbox Code Playgroud)
http://www.elasticsearch.org/guide/reference/mapping/ttl-field/
| 归档时间: |
|
| 查看次数: |
9490 次 |
| 最近记录: |