# Cluster shards disbalance

**URL:** <https://discuss.elastic.co/t/cluster-shards-disbalance/350714>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [January 10, 2024, 9:07am UTC](https://discuss.elastic.co/t/cluster-shards-disbalance/350714 "2024-01-10T09:07:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladislav](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vladislav](https://discuss.elastic.co/u/vladislav)\
**Post date:** [January 10, 2024, 9:07am UTC](https://discuss.elastic.co/t/cluster-shards-disbalance/350714/1 "2024-01-10T09:07:05Z")

</div>

Hello. Thanks in advance for any help  
I have a 3-nodes cluster containing different amount of shards on each node. Earlier it runs elasticsearch 8.4.3 and all was nearly-fine, but after upgrading to 8.11.1 things seems badlier.

Now, entering ` _cat/allocation?v` here is what I see:

```auto
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
   591 19tb 20tb 4.1tb 24.2tb 82 10.6.43.21 10.6.43.21 es1
   652 20.9tb 21.9tb 2.2tb 24.2tb 90 10.6.43.22 10.6.43.22 es2
   601 19.4tb 20.4tb 3.7tb 24.2tb 84 10.6.43.23 10.6.43.23 es3

```

es2 has significantly more shards than es1 and es3 and less available disk space.

Health status of cluster is green.

Here's my allocation settings:

```auto
{
  "persistent": {
    "cluster": {
      "routing": {
        "allocation": {
          "allow_rebalance": "indices_all_active",
          "cluster_concurrent_rebalance": "5",
          "node_concurrent_recoveries": "5"
        }
      }
    },
    "indices": {
      "recovery": {
        "max_bytes_per_sec": "200mb"
      }
 }

```

I see no issues when reading logs on es2 or any other health issues except low available disk space on es2. Any ideas how to balance overall shard count on my nodes?

---

<div class="post-metadata">

**Author:** ![yago82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yago82/32/97755_2.png) [@yago82](https://discuss.elastic.co/u/yago82)\
**Post date:** [January 10, 2024, 9:19am UTC](https://discuss.elastic.co/t/cluster-shards-disbalance/350714/2 "2024-01-10T09:19:23Z")

</div>

> [@vladislav](#):
>
> Hello. Thanks in advance for any help  
> I have a 3-nodes cluster containing different amount of shards on each node. Earlier it runs elasticsearch 8.4.3 and all was nearly-fine, but after upgrading to 8.11.1 things seems badlier.
> 
> Now, entering ` _cat/allocation?v` here is what I see:
> 
> ```auto
> shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
> 591 19tb 20tb 4.1tb 24.2tb 82 10.6.43.21 10.6.43.21 es1
> 652 20.9tb 21.9tb 2.2tb 24.2tb 90 10.6.43.22 10.6.43.22 es2
> 601 19.4tb 20.4tb 3.7tb 24.2tb 84 10.6.43.23 10.6.43.23 es3
> 
> ```
> 
> es2 has significantly more shards than es1 and es3 and less available disk space.
> 
> Health status of cluster is green.
> 
> Here's my allocation settings:
> 
> ```auto
> {
> "persistent": {
> "cluster": {
> "routing": {
> "allocation": {
> "allow_rebalance": "indices_all_active",
> "cluster_concurrent_rebalance": "5",
> "node_concurrent_recoveries": "5"
> }
> }
> },
> "indices": {
> "recovery": {
> "max_bytes_per_sec": "200mb"
> }
> }
> 
> ```
> 
> I see no issues when reading logs on es2 or any other health issues except low available disk space on es2. Any ideas how to balance overall shard count on my nodes?

Hi,

In version 8.11, the balancing of shards has slightly changed. You can find references to this in the following documentation:

> **[Cluster-level shard allocation and routing settings | Elasticsearch Guide...](https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-cluster.html#shards-rebalancing-heuristics)**

---

<div class="post-metadata">

**Author:** ![vladislav](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vladislav](https://discuss.elastic.co/u/vladislav)\
**Post date:** [January 10, 2024, 9:29am UTC](https://discuss.elastic.co/t/cluster-shards-disbalance/350714/3 "2024-01-10T09:29:20Z")

</div>

In your link I can see only new settings avalaible in "Shard balancing heuristics settings" such as `cluster.routing.allocation.balance.disk_usage` and `cluster.routing.allocation.balance.write_load` but other parameters have same default values on 8.4.3  
If I want shard overall count on each node stay close, how can I manipulate those settings?

---

<div class="post-metadata">

**Author:** ![yago82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yago82/32/97755_2.png) [@yago82](https://discuss.elastic.co/u/yago82)\
**Post date:** [January 10, 2024, 9:41am UTC](https://discuss.elastic.co/t/cluster-shards-disbalance/350714/4 "2024-01-10T09:41:19Z")

</div>

> [@vladislav](#):
>
> In your link I can see only new settings avalaible in "Shard balancing heuristics settings" such as `cluster.routing.allocation.balance.disk_usage` and `cluster.routing.allocation.balance.write_load` but other parameters have same default values on 8.4.3  
> If I want shard overall count on each node stay close, how can I manipulate those settings?

Hi,

The `cluster.routing.allocation.balance.shard` setting defines the weight factor for the total number of shards allocated to each node. By increasing this value, Elasticsearch will try to equalize the total number of shards across all nodes.

However, please note that adjusting these settings should be done with caution. The default values are generally good for most use cases, and changing them might improve the current balance but could potentially cause problems in the future if the cluster or workload changes.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 7, 2024, 9:41am UTC](https://discuss.elastic.co/t/cluster-shards-disbalance/350714/5 "2024-02-07T09:41:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
