[後記:目前 Elastic Stack 5.0 已經 GA , 文章寫於 2016.07.01 Elastic Stack Release – 5.0.0-alpha4 的興奮 ]
Elastic Stack Release – 5.0.0-alpha4 令人振奮的提供了兩個對於 time-based index 更友善的API 。
New Rollover API and Shrink API makes managing indices for time-based event data much easier
Rollover Index | Elasticsearch Reference [master] | Elastic
index naming 的規格就是 使用 – 分隔 ，後面的數字會自行遞增。
Shrink index API
Shrink Index | Elasticsearch Reference [master] | Elastic
另外一個 api 就是 shrink api
The shrink index API allows you to shrink an existing index into a new index with fewer primary shards.
- First, it creates a new target index with the same definition as the source index, but with a smaller number of primary shards.
- Then it hard-links segments from the source index into the target index. (If the file system doesn’t support hard-linking, then all segments are copied into the new index, which is a much more time consuming process.)
- Finally, it recovers the target index as though it were a closed index which had just been re-opened.
這邊有個值得注意的地方就是shrink 過的index 每個shard 不能超過 2,147,483,519 documents 。
- The index must not contain more than
2,147,483,519documents in total across all shards that will be shrunk into a single shard on the target index as this is the maximum number of docs that can fit into a single shard.