In my hot/warm/cold ES setup (ES 5.6.6, Curator 5.4.1), I've got a curator action file designed to target indexes on the single-disk warm nodes for shrinking. Curator seems to ignore the 'allocated' filtertype, and the first index returned is always one that doesn't match the filtertype, which causes the action to fail.
My ES nodes have the node attributebox_type
set to 'hot', 'warm' or 'cold' as necessary. Normal allocation appears to work just fine; curator correctly moves indices from 'hot' to 'warm' nodes.
In order to move indices from 'hot' to 'cold' nodes, I'd like to reduce the number of shards with a shrink command, so all of the 'warm' nodes have single disks. I have a shrink action that should shrink indices on 'warm' nodes, then change their allocation type to 'cold' afterwards.
Here's my action file.
actions:
1:
action: shrink
description: >-
Shrink selected indices on the node with the most available space.
options:
shrink_node: DETERMINISTIC
number_of_shards: 2
number_of_replicas: 1
shrink_suffix: '-shrink'
continue_if_exception: true
node_filters:
permit_masters: False
post_allocation:
allocation_type: require
key: box_type
value: cold
wait_for_active_shards: 1
wait_for_completion: False
extra_settings:
settings:
index.codec: best_compression
filters:
- filtertype: allocated
key: box_type
value: warm
allocation_type: require
For some reason, this filtertype keeps selecting indices with the box_type
of 'hot'.
2018-02-07 17:54:46,299 INFO Preparing Action ID: 1, "shrink"
2018-02-07 17:54:46,303 INFO Trying Action ID: 1, "shrink": Shrink selected indices on the node with the most available space.
2018-02-07 17:54:48,189 INFO Source index: logs-sentry-nginx-2018.02.06.13 -- Target index: logs-sentry-nginx-2018.02.06.13-shrink
2018-02-07 17:54:48,707 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:49,092 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:49,441 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:49,842 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:50,778 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:51,233 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:53,839 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:54,050 INFO Skipping node "es-cl-master-b": non-data node
2018-02-07 17:54:54,427 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:54,610 INFO Skipping node "es-cl-master-c": non-data node
2018-02-07 17:54:54,958 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:55,321 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:55,680 INFO Node "{0}" has multiple data paths and will not be used for shrink operations.
2018-02-07 17:54:55,921 INFO Skipping node "es-cl-master-a": non-data node
2018-02-07 17:54:55,924 INFO Moving shards to shrink node: "es-cl-data-warm-data-b"
2018-02-07 17:54:57,449 INFO Health Check for all provided keys passed.
2018-02-07 17:54:58,849 ERROR Failed to complete action: shrink. <class 'curator.exceptions.FailedExecution'>: Exception encountered. Rerun with loglevel DEBUG and/or check Elasticsearch logs for more information. Exception: Unable to shrink index "logs-sentry-nginx-2018.02.06.13" as not all shards were found on the designated shrink node (es-cl-data-warm-data-b): []
The settings for that index are:
{
"index": {
"routing": {
"allocation": {
"require": {
"_name": "es-cl-data-warm-data-b",
"box_type": "hot"
}
}
},
"refresh_interval": "30s",
"number_of_shards": "14",
"blocks": {
"write": "false"
},
"provided_name": "logs-sentry-nginx-2018.02.06.13",
"creation_date": "1517960341728",
"number_of_replicas": "1",
"uuid": "Xa5fnhe4TXiXN9S5C1BLng",
"version": {
"created": "5060699"
}
}
}
Why is Curator trying to move an index that's marked 'hot'? Is it accurate to say that filtering on a index attribute doesn't work?
Thanks!