2015-07-15 12:05:42 -04:00
|
|
|
[[recovery-prioritization]]
|
|
|
|
=== Index recovery prioritization
|
|
|
|
|
|
|
|
Unallocated shards are recovered in order of priority, whenever possible.
|
|
|
|
Indices are sorted into priority order as follows:
|
|
|
|
|
|
|
|
* the optional `index.priority` setting (higher before lower)
|
|
|
|
* the index creation date (higher before lower)
|
|
|
|
* the index name (higher before lower)
|
|
|
|
|
|
|
|
This means that, by default, newer indices will be recovered before older indices.
|
|
|
|
|
2019-01-07 08:44:12 -05:00
|
|
|
Use the per-index dynamically updatable `index.priority` setting to customise
|
2015-07-15 12:05:42 -04:00
|
|
|
the index prioritization order. For instance:
|
|
|
|
|
2016-05-12 12:43:01 -04:00
|
|
|
[source,js]
|
2015-07-15 12:05:42 -04:00
|
|
|
------------------------------
|
|
|
|
PUT index_1
|
|
|
|
|
|
|
|
PUT index_2
|
|
|
|
|
2019-01-14 16:08:01 -05:00
|
|
|
PUT index_3?include_type_name=true
|
2015-07-15 12:05:42 -04:00
|
|
|
{
|
|
|
|
"settings": {
|
|
|
|
"index.priority": 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-14 16:08:01 -05:00
|
|
|
PUT index_4?include_type_name=true
|
2015-07-15 12:05:42 -04:00
|
|
|
{
|
|
|
|
"settings": {
|
|
|
|
"index.priority": 5
|
|
|
|
}
|
|
|
|
}
|
|
|
|
------------------------------
|
2016-05-09 09:42:23 -04:00
|
|
|
// CONSOLE
|
2015-07-15 12:05:42 -04:00
|
|
|
|
|
|
|
In the above example:
|
|
|
|
|
|
|
|
* `index_3` will be recovered first because it has the highest `index.priority`.
|
|
|
|
* `index_4` will be recovered next because it has the next highest priority.
|
|
|
|
* `index_2` will be recovered next because it was created more recently.
|
|
|
|
* `index_1` will be recovered last.
|
|
|
|
|
|
|
|
This setting accepts an integer, and can be updated on a live index with the
|
|
|
|
<<indices-update-settings,update index settings API>>:
|
|
|
|
|
2016-05-12 12:43:01 -04:00
|
|
|
[source,js]
|
2015-07-15 12:05:42 -04:00
|
|
|
------------------------------
|
|
|
|
PUT index_4/_settings
|
|
|
|
{
|
|
|
|
"index.priority": 1
|
|
|
|
}
|
|
|
|
------------------------------
|
2016-05-09 09:42:23 -04:00
|
|
|
// CONSOLE
|
2016-04-29 10:42:03 -04:00
|
|
|
// TEST[continued]
|