# Elasticsearch Constantly Reallocating Shards

**URL:** <https://discuss.elastic.co/t/elasticsearch-constantly-reallocating-shards/118276>\
**Category:** Elasticsearch\
**Created:** [February 2, 2018, 8:01pm UTC](https://discuss.elastic.co/t/elasticsearch-constantly-reallocating-shards/118276 "2018-02-02T20:01:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [February 2, 2018, 8:01pm UTC](https://discuss.elastic.co/t/elasticsearch-constantly-reallocating-shards/118276/1 "2018-02-02T20:01:50Z")

</div>

ES Version 5.6.2

For the past few weeks, every time I check ES Monitoring, twenty shards are being reallocated:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2f11a1a41e577216d39d6b61d23497635c55171.png)

This is defined as the max in my cluster settings. I have it set higher than default as many of the machines I'm running on are random servers and not the most reliable. Hence if a node fails I want the cluster to dynamically reallocate shards. However no nodes have gone down in the past few weeks...

`GET _cluster/settings`

```auto
{
  "persistent": {
    "cluster": {
      "routing": {
        "allocation": {
          "allow_rebalance": "always",
          "cluster_concurrent_rebalance": "20",
          "node_concurrent_recoveries": "20",
          "disk": {
            "watermark": {
              "low": "95%",
              "high": "98%"
            }
          }
        }
      }
    }
  },
  "transient": {}
}

```

When I look for an explanation on why a shard is being moved, I get nothing valuable:

```auto
GET /_cluster/allocation/explain
{
  "index": "nginx-2017.07.15s",
  "shard": 0,
  "primary": true
}

```

```auto
{
  "index": "nginx-2017.07.15s",
  "shard": 0,
  "primary": true,
  "current_state": "relocating",
  "current_node": {
    "id": "cW3TmEVIShSGxkCA8_zRew",
    "name": "mynode11",
    "transport_address": "192.168.100.100:9300",
    "attributes": {
      "ml.max_open_jobs": "10",
      "box_type": "warm",
      "ml.enabled": "true",
      "tag": "warm"
    }
  },
  "explanation": "the shard is in the process of relocating from node [mynode11] to node [mynode10], wait until relocation has completed"
}

```

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [February 3, 2018, 12:20am UTC](https://discuss.elastic.co/t/elasticsearch-constantly-reallocating-shards/118276/2 "2018-02-03T00:20:38Z")

</div>

Just a guess: maybe change `cluster.routing.allocation.allow_rebalance` back to the default `indices_all_active`?

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [February 9, 2018, 6:58pm UTC](https://discuss.elastic.co/t/elasticsearch-constantly-reallocating-shards/118276/3 "2018-02-09T18:58:45Z")

</div>

Thanks for the suggestion. I updated `cluster.routing.allocation.allow_rebalance` to `indices_all_active`. My indices are all active, thus the relocation is still occurring.

---

<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:** [March 9, 2018, 6:58pm UTC](https://discuss.elastic.co/t/elasticsearch-constantly-reallocating-shards/118276/4 "2018-03-09T18:58:54Z")

</div>

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