-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Data Management/ILM+SLMIndex and Snapshot lifecycle managementIndex and Snapshot lifecycle management>bugTeam:Data ManagementMeta label for data/management teamMeta label for data/management team
Description
Consider the following (simplified) use case, you want to retain indices for a
period of time, and during that time, you take periodic snapshots of the
indices:
(30 seconds is a stand in for a longer time, to make this more easily
reproducible, pretend it is 90d or something for a production use case)
PUT _ilm/policy/delete-old
{
"policy": {
"phases": {
"delete": {
"min_age": "30s",
"actions": {
"delete": {}
}
}
}
}
}And create an index using that policy
PUT /foo
{
"settings": {
"index.number_of_shards": 2,
"index.lifecycle.name": "delete-old"
}
}After the index is created, during the periodic snapshotting, a snapshot is
taken:
PUT /_snapshot/backup
{
"type": "fs",
"settings": {
"location": "/tmp/foo"
}
}
PUT /_snapshot/backup/snap1?wait_for_completion=trueNext, after 30 seconds has elapsed, the index foo is deleted.
Later, a user decides they need the data on the "foo" index and thus need to
restore the index:
POST /_snapshot/backup/snap1/_restoreThe index is restored... and then immediately deleted because it is older than
30 seconds.
Metadata
Metadata
Assignees
Labels
:Data Management/ILM+SLMIndex and Snapshot lifecycle managementIndex and Snapshot lifecycle management>bugTeam:Data ManagementMeta label for data/management teamMeta label for data/management team