# Is there any way to keep indices older than some days in one cluster and other indices in another cluster?

**URL:** <https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551>\
**Category:** Elasticsearch\
**Created:** [November 21, 2017, 11:00am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551 "2017-11-21T11:00:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [November 21, 2017, 11:00am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/1 "2017-11-21T11:00:45Z")

</div>

Hi,

I have an ES architecture like below;

![arch](https://us1.discourse-cdn.com/elastic/original/3X/b/a/bac88c04f4c9a57d84eeb4462b14593eaf288188.PNG)

I have named my indices based on day, like `myindexa-2017-11-08`, `myindexa-2017-11-09`, `myindexb-2017-11-08`, `myindexb-2017-11-09` etc. I would like to keep indices older than 10 days in **C2** and other indices in **C1**. Is there any way or workaround to achieve this?

Thanks.

---

<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:** [November 21, 2017, 11:04am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/2 "2017-11-21T11:04:25Z")

</div>

That would require you to use [snapshot and restore](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) to move indices between clusters. A more common approach is to have data of different ages reside on different set of nodes in the same cluster, which is what we often refer to as a [hot-warm architecture](https://www.elastic.co/blog/hot-warm-architecture-in-elasticsearch-5-x).

---

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [November 21, 2017, 11:24am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/3 "2017-11-21T11:24:49Z")

</div>

Hi @Christian_Dahlqvist , thanks for your reply.

Currently I am using this snapshot - restore technique. I take snapshot of indices of 1 cluster `C1` for a particular day, daily, and zip that folder. Then I copy that folder to `C2`, extract the zip, and restore indices. I am doing this because the space in `C1` is limited.

The issues I faced here was;

1. I need to use 2 Kibana's to access indices in these VMs
2. I need to run some cron jobs to take snapshots, make zip, delete folder, upload to sftp, download from sftp, extract, perform restore, delete folder. I would like to minimize the steps.

These are some reasons why I asked this question. Is there any way to go this "smoothly", like data sync b/w ES nodes?

---

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [November 22, 2017, 6:04am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/4 "2017-11-22T06:04:22Z")

</div>

Can somebody kindly help me on this?

---

<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:** [November 22, 2017, 7:10am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/5 "2017-11-22T07:10:09Z")

</div>

Why are you using 2 clusters instead of one larger one? Are they located far apart? Have you looked into querying both clusters using cross-cluster search?

As far vas I know there is no way to seamlessly move indices between clusters apart from snapshot and restore. This is not instant nor automatic, but you could streamline your process by e.g. using S3 for the snapshots to avoid having to copy data manually.

---

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [November 22, 2017, 7:59am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/6 "2017-11-22T07:59:37Z")

</div>

Thank you @Christian_Dahlqvist , I understand. The clusters are in the same data center, but there are restrictions because of some security parameters. Need to look into cross-cluster search.

---

<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:** [November 22, 2017, 8:00am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/7 "2017-11-22T08:00:43Z")

</div>

Cross-cluster search will help you query the data across both clusters at the same time, but will not help you move indices.

---

<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:** [December 20, 2017, 8:01am UTC](https://discuss.elastic.co/t/is-there-any-way-to-keep-indices-older-than-some-days-in-one-cluster-and-other-indices-in-another-cluster/108551/8 "2017-12-20T08:01:15Z")

</div>

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