基於ES 7.7, 官方文檔 https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices.html#indices
傳送門: 上篇: create, delete, get, exists, close, open, 中篇: shrink, split, clone
0x09 Rollover
爲數據流(data stream
)或索引別名創建一個新的索引.
POST /<source_index>/_rollover
POST /<source_index>/_rollover/<target_index>
rollover
使您可以根據索引大小,文檔數或使用期限自動過渡到新索引。 當rollover
觸發後,將創建新索引,寫別名(write alias
)將更新爲指向新索引,所有後續更新都將寫入新索引。
對於基於時間的rollover來說,基於大小,文檔數或使用期限過渡至新索引是比較適合的。 在任意時間rollover通常會導致許多小的索引,這可能會對性能和資源使用產生負面影響。
描述
推薦使用 ILM的rollover去自動完成rollover. 詳見Index lifecycle
未完待續....