Elasticsearch Enable Shard Rebalancing and Allocation in OpenSearch

By Opster Team

Updated: Apr 9, 2023

| 1 min read

In addition to reading this guide, we recommend you run the Elasticsearch Health Check-Up. It will detect issues and improve your Elasticsearch performance by analyzing your shard sizes, threadpools, memory, snapshots, disk watermarks and more.

The Elasticsearch Check-Up is free and requires no installation.

Before you begin reading this guide, we recommend you try running the OpenSearch Error Check-Up which analyzes 2 JSON files to detect many configuration errors.

To easily resolve issues in your deployment, including those related to shards, and locate their root cause, try AutoOps for OpenSearch. It diagnoses problems by analyzing hundreds of metrics collected by a lightweight agent and offers guidance for resolving them.


Cluster shard rebalancing and allocation are often confused with each other.

OpenSearch cluster shard allocation

This refers to the process by which any shard including new, recovered or rebalanced shards are allocated to OpenSearch nodes. Cluster shard allocation may be temporarily disabled during maintenance in order to avoid shards from being relocated to nodes that are being restarted and may temporarily leave the cluster.

If cluster shard allocation is NOT enabled, then OpenSearch will not be able to create new indices, recover corrupted indices or rebalance. This situation is very likely to cause data loss if not corrected quickly.

OpenSearch cluster shard rebalancing

This refers to the process by which an OpenSearch cluster may rebalance shards from nodes with high disk utilization (above the value of cluster.routing.allocation.disk.watermark.high) to nodes with lower disk utilisation, or redistribute shards from pre-existing nodes to a new node which has just been added to the cluster.  

If cluster shard rebalancing is not enabled, then OpenSearch will not be able to optimize disk and cpu utilization across the cluster by rebalancing shards from heavily used nodes to underused nodes. 

How to resolve it

The default values are the recommended ones for both of these settings. To restore the default value run the following command:

PUT _cluster/settings
  "transient": {
     "cluster.routing.allocation.enable": "all",

     "cluster.routing.rebalance.enable": "all"

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Analyze your cluster & get personalized recommendations

Skip to content