Search code examples
elasticsearch

How to avoid rebalance during ES cluster starts up


I am using ES 7.10.1. My cluster has 20 nodes.

I would start these 20 nodes one by one (the cluster already has data). During the startup, would rebalance happen because some have started up while some haven't?

I would if rebalance may happen, how could I avoid this? Thanks.


Solution

  • In order to prevent rebalancing, you may run the following command, which is typically what is run before doing a rolling upgrade in order to prevent shards from being rebalanced to other nodes.

    PUT _cluster/settings
    {
      "persistent": {
        "cluster.routing.allocation.enable": "none"
      }
    }