I have an ElasticSearch cluster with several indices on 2 data nodes (es-data-0 & es-data-1) and want to move all shards off of node es-data-1 before decommissioning it.
Moving shards 1 at a time works well. The following command takes several seconds to move the shard.
POST /_cluster/reroute
{
"commands": [
{
"move": {
"index" : "index_operations_log",
"shard" : 0,
"from_node" : "es-data-1",
"to_node" : "es-data-0"
}
}
]
}
But if I try to do cluster-level shard allocation filtering, it does not affect. For example, the following has no apparent effect on shard status:
PUT /_cluster/settings
{
"transient" : {
"cluster.routing.rebalance.enable": "none"
}
}
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.exclude._name": "es-data-1"
}
}
even though it returns
{
"acknowledged": true,
"persistent": {},
"transient": {
"cluster": {
"routing": {
"allocation": {
"exclude": {
"_name": "es-data-1"
}
}
}
}
}
}
What am I missing?