# Scaling down ElasticSearch: what happens with closed indices?

**URL:** <https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [January 26, 2021, 5:39pm UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264 "2021-01-26T17:39:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![caarlos0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caarlos0/32/77210_2.png) [@caarlos0](https://discuss.elastic.co/u/caarlos0)\
**Post date:** [January 26, 2021, 5:39pm UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/1 "2021-01-26T17:39:02Z")

</div>

To scale down ElasticSearch, I usually disable allocation on a node, wait for shards to relocate, and then remove the node, e.g.:

```auto
curl -X PUT "localhost:9200/_cluster/settings" -d'{
  "transient" : {
    "cluster.routing.allocation.exclude._name" : "node-4"
  }
}'

```

As I understand, open indices' shards will be relocated to other nodes... but what happens to closed indices?

A closed index is, per my understanding, ignored on snapshots... so it makes me think if it will be ignored when setting an allocation exclusion as well.

After excluding allocation to a node, I went to check its disk usage... and it seems like it still has a lot of things there:

```auto
$ du -hs /usr/share/elasticsearch/nodes/0/
131G	/usr/share/elasticsearch/nodes/0/

```

So, my questions are:

- What happens to closed indices when I exclude a node from allocation?
- How safe it is to do this if I don't want to loose those closed indices (for whatever reason)?
- Is there a way to tell ES to also rebalance closed indices in case it doesn't already do it?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 26, 2021, 9:28pm UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/2 "2021-01-26T21:28:24Z")

</div>

It depends on what version you are on. More recent versions have replicas for closed indices, but I am not 100% sure when that landed.

I am not sure how allocation works for them though sorry.

---

<div class="post-metadata">

**Author:** ![caarlos0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caarlos0/32/77210_2.png) [@caarlos0](https://discuss.elastic.co/u/caarlos0)\
**Post date:** [January 26, 2021, 9:39pm UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/3 "2021-01-26T21:39:50Z")

</div>

Thanks, I'm on 5.6.16... didn't find anything on the docs ☹

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 26, 2021, 9:41pm UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/4 "2021-01-26T21:41:04Z")

</div>

Ahh ok, yeah that's not going to apply then sorry, that's definitely a later 7.X feature.

I will highlight that 5.X reached [EOL](https://www.elastic.co/support/eol) some time ago, and you should look at upgrading as a matter of urgency 🙂

---

<div class="post-metadata">

**Author:** ![caarlos0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caarlos0/32/77210_2.png) [@caarlos0](https://discuss.elastic.co/u/caarlos0)\
**Post date:** [January 27, 2021, 2:10am UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/5 "2021-01-27T02:10:35Z")

</div>

Yes, need to upgrade ASAP, unfortunately also need to redesign a lot of things to do it 🤔 hehe

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 27, 2021, 7:56am UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/6 "2021-01-27T07:56:46Z")

</div>

If you are on Elasticsearch 5.x you will need to open them in order to relocate the shards.

---

<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 24, 2021, 7:56am UTC](https://discuss.elastic.co/t/scaling-down-elasticsearch-what-happens-with-closed-indices/262264/7 "2021-02-24T07:56:51Z")

</div>

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