I developed a search plugin for elasticsearch, but when upgrading this plugin, i need to shutdown the nodes one by one, and each time i have to wait for the reallocation process a long time. In the document, it said the reallocation process can be stopped by:
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}'
When I run this command, i got following error:
ElasticsearchIllegalArgumentException[Can't update non dynamic settings[[index.transient.cluster.routing.allocation.enable]] for open indices[..]
What can i do?
btw: sorry for my poor english...
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.
primary vs replica shards – elasticsearch will create, by default, 5 primary shards and one replica for each index. That means that each elasticsearch index will be split into 5 chunks and each chunk will have one copy, for high availability.
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.
So close!
Try:
curl -XPUT 'http://localhost:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.disable_allocation": "true"
}}'
OP might use an older Elasticsearch version that doesn't support updating "cluster.routing.allocation.enable" and/or "cluster.routing.rebalance.enable" dynamically.
However, on more recent Elasticsearch versions, those 2 settings should
be dynamic
or transient
, not static
or persistent
any more.
Here are more details about shards-allocation settings from Elasticsearch current doc.
https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html
And user can apply/revoke these settings in Kibana Dev Tool Console, like these
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.enable": "none",
"cluster.routing.rebalance.enable" : "none"
}
}
# After bouncing ES cluster
PUT _cluster/settings
{
"transient" : {
"cluster.routing.allocation.enable": "all",
"cluster.routing.rebalance.enable" : "all"
}
}
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