# Restore an index on single node only

**URL:** <https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250>\
**Category:** Elasticsearch\
**Created:** [February 25, 2022, 8:27am UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250 "2022-02-25T08:27:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rihad](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rihad](https://discuss.elastic.co/u/rihad)\
**Post date:** [February 25, 2022, 8:27am UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250/1 "2022-02-25T08:27:05Z")

</div>

Hi, we have a 3-node ES cluster. Each node provides both master-eligible & data role. Is it possible to restore an index there temporarily without spreading its contents across all nodes? Just the current node or the current master node will do.

Are these settings of any help here? [Index modules | Elasticsearch Guide [8.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/index-modules.html#index-modules-settings)

Thanks.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [February 25, 2022, 8:46am UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250/2 "2022-02-25T08:46:13Z")

</div>

1. cluster level shard allocate:[cluster-level shard allocation filter](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-cluster.html#cluster-shard-allocation-filtering)  
such as：

```auto
PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._ip" : "10.0.0.1"
  }
}

```

1. index level shard allocate:[index-level allocation filter](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/shard-allocation-filtering.html#index-allocation-settings)  
such as:

```auto
PUT test/_settings
{
  "index.routing.allocation.include._ip": "192.168.2.*"
}

```

---

<div class="post-metadata">

**Author:** ![rihad](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rihad](https://discuss.elastic.co/u/rihad)\
**Post date:** [February 25, 2022, 7:20pm UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250/3 "2022-02-25T19:20:48Z")

</div>

Thanks! Can these settings be set per-index as part of restoring the index? It's a chicken and egg problem otherwise: the index doesn't exist yet and its settings can't be changed.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 25, 2022, 7:36pm UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250/4 "2022-02-25T19:36:50Z")

</div>

If you are using snapshot and restore API you should be able to override / add index settings

> **[Restore snapshot API | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/restore-snapshot-api.html)**

> `index_settings`
> 
> (Optional, object) Index settings to add or change in restored indices, including backing indices. You can’t use this option to change [`index.number_of_shards`](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-number-of-shards).
> 
> For data streams, this option only applies to restored backing indices. New backing indices are configured using the data stream’s matching index template.

---

<div class="post-metadata">

**Author:** ![rihad](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rihad](https://discuss.elastic.co/u/rihad)\
**Post date:** [February 26, 2022, 6:04am UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250/5 "2022-02-26T06:04:20Z")

</div>

Thanks! As part of snapshot restoration this did the trick:

`"index_settings": { "index.routing.allocation.require._name": "foo.example.com" }`

The index status remains yellow, but that's ok, it's only needed to delete old data from it (via \_delete\_by\_query API), snapshot it back and remove the temp index.

Too bad ES doesn't provide filtering & deletion right when taking the snapshot )

---

<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 26, 2022, 6:05am UTC](https://discuss.elastic.co/t/restore-an-index-on-single-node-only/298250/6 "2022-03-26T06:05:04Z")

</div>

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