In terms of high data availability, the following mechanisms are used:
Index rollover uses the following Elasticsearch entities:
The first index in the example is created with a numeric suffix. This is to ensure that a new index with a modified suffix is created as a result of rollover.
An alias is assigned to the created index, and this alias is then assigned to the new index at rollover.
An index template contains all the necessary parameters to create a new index as a result of the rollover:
rollover_alias
, that is, the alias that will be moved to the new index.{
"index": {
"lifecycle": {
"name": "audit-trails-ilm",
"rollover_alias": "audit-trails-index"
},
"number_of_replicas": "2"
}
}
The index lifecycle policy tracks the lifecycle of our data. As the data becomes older, you can move it to lower-end servers or disks, and, finally, delete them, after a certain period.
In our example, we configured only the hot phase, with only default metrics for the rollover procedure enabled.
But for production deployment, we recommended to plan for the process of data obsolescence (that is, moving it to "slow" nodes), and deletion.
It is recommended to enable data deletion when you have no other phase but the hot one.
After a certain period, indexes with obsolete data will be deleted. If you have set up data snapshots, you can enable the delete option only if a snapshot is present. In this case, specify the name of the snapshot policy.