forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ILM histore store index (elastic#50287)
* Add ILM histore store index This commit adds an ILM history store that tracks the lifecycle execution state as an index progresses through its ILM policy. ILM history documents store output similar to what the ILM explain API returns. An example document with ALL fields (not all documents will have all fields) would look like: ```json { "@timestamp": 1203012389, "policy": "my-ilm-policy", "index": "index-2019.1.1-000023", "index_age":123120, "success": true, "state": { "phase": "warm", "action": "allocate", "step": "ERROR", "failed_step": "update-settings", "is_auto-retryable_error": true, "creation_date": 12389012039, "phase_time": 12908389120, "action_time": 1283901209, "step_time": 123904107140, "phase_definition": "{\"policy\":\"ilm-history-ilm-policy\",\"phase_definition\":{\"min_age\":\"0ms\",\"actions\":{\"rollover\":{\"max_size\":\"50gb\",\"max_age\":\"30d\"}}},\"version\":1,\"modified_date_in_millis\":1576517253463}", "step_info": "{... etc step info here as json ...}" }, "error_details": "java.lang.RuntimeException: etc\n\tcaused by:etc etc etc full stacktrace" } ``` These documents go into the `ilm-history-1-00000N` index to provide an audit trail of the operations ILM has performed. This history storage is enabled by default but can be disabled by setting `index.lifecycle.history_index_enabled` to `false.` Resolves elastic#49180
- Loading branch information
Showing
27 changed files
with
1,419 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,7 +368,7 @@ PUT my_index | |
} | ||
} | ||
GET _search <3> | ||
GET /my_index/_search <3> | ||
{ | ||
"query": { | ||
"match": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
x-pack/plugin/core/src/main/resources/ilm-history-ilm-policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"phases": { | ||
"hot": { | ||
"actions": { | ||
"rollover": { | ||
"max_size": "50GB", | ||
"max_age": "30d" | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"min_age": "90d", | ||
"actions": { | ||
"delete": {} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"index_patterns": [ | ||
"ilm-history-${xpack.ilm_history.template.version}*" | ||
], | ||
"order": 2147483647, | ||
"settings": { | ||
"index.number_of_shards": 1, | ||
"index.number_of_replicas": 0, | ||
"index.auto_expand_replicas": "0-1", | ||
"index.lifecycle.name": "ilm-history-ilm-policy", | ||
"index.lifecycle.rollover_alias": "ilm-history-${xpack.ilm_history.template.version}", | ||
"index.format": 1 | ||
}, | ||
"mappings": { | ||
"_doc": { | ||
"dynamic": false, | ||
"properties": { | ||
"@timestamp": { | ||
"type": "date", | ||
"format": "epoch_millis" | ||
}, | ||
"policy": { | ||
"type": "keyword" | ||
}, | ||
"index": { | ||
"type": "keyword" | ||
}, | ||
"index_age":{ | ||
"type": "long" | ||
}, | ||
"success": { | ||
"type": "boolean" | ||
}, | ||
"state": { | ||
"type": "object", | ||
"dynamic": true, | ||
"properties": { | ||
"phase": { | ||
"type": "keyword" | ||
}, | ||
"action": { | ||
"type": "keyword" | ||
}, | ||
"step": { | ||
"type": "keyword" | ||
}, | ||
"failed_step": { | ||
"type": "keyword" | ||
}, | ||
"is_auto-retryable_error": { | ||
"type": "keyword" | ||
}, | ||
"creation_date": { | ||
"type": "date", | ||
"format": "epoch_millis" | ||
}, | ||
"phase_time": { | ||
"type": "date", | ||
"format": "epoch_millis" | ||
}, | ||
"action_time": { | ||
"type": "date", | ||
"format": "epoch_millis" | ||
}, | ||
"step_time": { | ||
"type": "date", | ||
"format": "epoch_millis" | ||
}, | ||
"phase_definition": { | ||
"type": "text" | ||
}, | ||
"step_info": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"error_details": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.