Restore an index on single node only

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

Thanks.

  1. cluster level shard allocate:cluster-level shard allocation filter
    such as:
PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._ip" : "10.0.0.1"
  }
}
  1. index level shard allocate:index-level allocation filter
    such as:
PUT test/_settings
{
  "index.routing.allocation.include._ip": "192.168.2.*"
}
1 Like

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.

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

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 .

For data streams, this option only applies to restored backing indices. New backing indices are configured using the data stream’s matching index template.

1 Like

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 )

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