# Primaries shards not evenly balanced accross the nodes - Is it normal behavior?

**URL:** https://discuss.elastic.co/t/primaries-shards-not-evenly-balanced-accross-the-nodes-is-it-normal-behavior/276739
**Category:** Elasticsearch
**Created:** [June 23, 2021, 7:49am UTC](https://discuss.elastic.co/t/primaries-shards-not-evenly-balanced-accross-the-nodes-is-it-normal-behavior/276739 "2021-06-23T07:49:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Travis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/travis/32/54079_2.png) [@Travis](https://discuss.elastic.co/u/Travis)
#### Post date: [June 23, 2021, 7:49am UTC](https://discuss.elastic.co/t/primaries-shards-not-evenly-balanced-accross-the-nodes-is-it-normal-behavior/276739/1 "2021-06-23T07:49:56Z")

</div>

Hello,

While doing some tests, I noticed that after creating an index (with no data) in a five (data) nodes cluster, primaries shards are not evenly balanced :

```auto
GET _cat/nodes

192.168.2.158 67 96 94 2.47 1.56 0.77 dlmrt - elastic2
192.168.2.107 23 94 1 0.15 0.25 0.26 ilr - logstash1
192.168.2.106 29 89 96 2.08 1.60 0.81 dlmrt * elastic1
192.168.2.143 64 95 1 0.26 0.22 0.14 dlrt - elastic5
192.168.2.114 57 94 35 1.56 0.79 0.37 dlmrt - elastic3
192.168.2.252 59 67 31 1.82 0.86 0.38 dlrt - elastic4
192.168.2.42 23 94 0 0.14 0.20 0.18 ilr - logstash2

```

```auto
PUT temp3
{
  "settings": {
    "index": {
      "number_of_shards": 3,  
      "number_of_replicas": 0,
      "refresh_interval": "-1" 
    }
  }
}

```

```auto
GET _cat/shards/temp3

temp3 1 p STARTED 333048 173.2mb 192.168.2.158 elastic2
temp3 2 p STARTED 462817 191.2mb 192.168.2.106 elastic1
temp3 0 p STARTED 432296 186.7mb 192.168.2.158 elastic2

```

Is it normal that I have two primary shards on the same node (elastic2) ?

Thanks for your feedback !

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 23, 2021, 8:39am UTC](https://discuss.elastic.co/t/primaries-shards-not-evenly-balanced-accross-the-nodes-is-it-normal-behavior/276739/2 "2021-06-23T08:39:05Z")

</div>

That's correct. Elasticsearch tries to balance the total number of shards. The decision is not made per index.

---

<div class="post-metadata">

### Author: ![Travis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/travis/32/54079_2.png) [@Travis](https://discuss.elastic.co/u/Travis)
#### Post date: [June 23, 2021, 8:45am UTC](https://discuss.elastic.co/t/primaries-shards-not-evenly-balanced-accross-the-nodes-is-it-normal-behavior/276739/3 "2021-06-23T08:45:47Z")

</div>

Very clear. Thank you David !

---

<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: [July 21, 2021, 8:45am UTC](https://discuss.elastic.co/t/primaries-shards-not-evenly-balanced-accross-the-nodes-is-it-normal-behavior/276739/4 "2021-07-21T08:45:55Z")

</div>

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