今天在5.2版本的集群测试rollover功能,索引template:
创建索引,写入三个文档,然后执行rollover:
可是我明明只写入了三个文档,rollover的max_docs阈值是6就成功了,这个max_docs指的是主分片加副本的数量吗
{
"order": 0,
"template": "access-logs-*",
"settings": {
"index": {
"number_of_shards": "2",
"number_of_replicas": "1",
"routing": {
"allocation": {
"include": {
"_ip": "x.x.x.x,x.x.x.x"
},
"total_shards_per_node": "2"
}
}
}
},
"mappings": {},
"aliases": {
"access-logs": {},
"search-logs": {}
}
}
创建索引,写入三个文档,然后执行rollover:
POST access-logs/_rollover
{
"conditions": {
"max_age": "7d",
"max_docs": 6
}
}
然后成功了?返回结果如下:{
"old_index": "access-logs-000001",
"new_index": "access-logs-000002",
"rolled_over": true,
"dry_run": false,
"acknowledged": true,
"shards_acknowledged": true,
"conditions": {
"[max_docs: 6]": true,
"[max_age: 7d]": false
}
}
可是我明明只写入了三个文档,rollover的max_docs阈值是6就成功了,这个max_docs指的是主分片加副本的数量吗
1 个回复
rochy - rochy_he
赞同来自:
ES6.X 特别声明了 max_docs 不计算副本的数量