I have set a shard allocation filter like:
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.exclude._name" : "node-1"
}
}
How can I remove or disable such a setting? I tried with include, but then I have both filter setted - include and exclude. I can set something like "cluster.routing.allocation.exclude._name" : ""
.
But is it also possible to set something like: include all
nodes?
Shard allocation, which is an algorithm by which Elasticsearch decides which unallocated shards should go on which nodes, Shard rebalancing, which is the process of moving a shard from one node to another.
If you're using time-based index names, for example daily indices for logging, and you don't have enough data, a good way to reduce the number of shards would be to switch to a weekly or a monthly pattern. You can also group old read-only indices., by month, quarter or year.
When we create index, or have one of our nodes crashed, shards may go into unassigned state. Meaning, data is there but it is not assigned/replicated to a node to enable processing that shard.
Have you tried
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.exclude._name" : null
}
}
Sounds dumb, but I think that's how you unset things in elasticsearch...
For the clusters running on Elasticsearch 5.x, you can pass null
values to reset a setting. As said in this issue, this is documented for cluster level settings but not for the index level settings.
So you can do:
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.exclude._name" : null
}
}
And also:
PUT test-index/_settings
{
"index": {
"routing": {
"allocation": {
"include": {
"box_type": null
},
"exclude": {
"box_type": null
},
"require": {
"box_type": null
},
"total_shards_per_node": "2"
}
}
}
}
To reset the include filter and include all nodes, you have to use both settings:
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.include._name" : ""
}
}
and
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.exclude._name" : ""
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With