Add the ability to set attributes on path.data entries #33734
Labels
:Distributed/Allocation
All issues relating to the decision making around placing a shard (both master logic & on the nodes)
>feature
team-discuss
Elasticsearch currently supports adding attributes to nodes. You can start a node with:
./bin/elasticsearch -Enode.attr.storage_type=ssd
and another with:
./bin/elasticsearch -Enode.attr.storage_type=hdd
and you can place indices to a hdd or ssd node:
The problem with this you can only place attributes onto nodes, but a(n elasticsearch) node can have multiple data paths and you can't use this feature to decide what index goes to what path.
So I propose a new feature, which makes it possible to add attributes to path.data entries.
Setting this could work like this:
path.data: /hdd/0;path.attr.storage_type=hdd, /hdd/1;path.attr.storage_type=hdd, /hdd/2;path.attr.storage_type=hdd, /hdd/3, /ssd/0;path.attr.storage_type=ssd, /ssd/1;path.attr.storage_type=ssd
path.attr could take precedence over node.attr, meaning if you've started the above node with:
./bin/elasticsearch -Enode.attr.storage_type=hdd
and set the routing.allocation for the logs_2016-12-26 to hdd, then it could be placed to any of the /hdd data paths (even onto /hdd/3, which doesn't have a path.attr set, because node.attr takes place there), but not to the ssd ones.
And if you have indices with routing.allocation requiring a storage_type of ssd, they could be placed onto this node (even if it had node.attr.storage_type=hdd), but only to /ssd/* paths, because those paths are marked as storage_type=ssd.
I think this is easy to do and offers much more flexibility than elasticsearch offers today.
The text was updated successfully, but these errors were encountered: