# CCR# Cross Cluster Replication

**URL:** <https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912>\
**Category:** Elastic Search\
**Created:** [August 14, 2024, 2:06pm UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912 "2024-08-14T14:06:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![seshug](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@seshug](https://discuss.elastic.co/u/seshug)\
**Post date:** [August 14, 2024, 2:06pm UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912/1 "2024-08-14T14:06:12Z")

</div>

Hello,  
Have you ever handled the time series indices on the follower cluster post implementing cross-cluster replication?

We have implemented CCR - able to see the indices created on the follower indices.

The issue is - CCR doesn't delete the old indices even though they are curated on Leader cluster.

to delete old indices we need to a) pause the replication b) unfollow the patterns c) delete the old indices.

I wanted to know if there is any one who achieved this via ILM? If yes how?  
or  
is there a better way to handle this scenario?

Thanks in Advance,  
Seshu

---

<div class="post-metadata">

**Author:** ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)\
**Post date:** [August 14, 2024, 2:24pm UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912/2 "2024-08-14T14:24:46Z")

</div>

Hey Seshu,

It looks like you should create the same ILM policy without rollover part in the follower cluster.

> <https://github.com/elastic/elasticsearch/issues/67668>
>
> When indices in a CCR environment are managed by ILM the follower indices must b…e converted to regular indices. This is taken care of by the \[unfollow action\](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-unfollow.html) and is injected automatically if \`rollover\`, \`shrink\` or the \`searchable\_snapshot\` action are configured.
> However, the leader index must have the \`index.lifecycle.indexing\_complete\` setting configured to \`true\` in order for the \`unfollow\` action to succeed. ILM takes care of managing the \`indexing\_complete\` setting as part of the \`rollover\` action. Namely, after the index is rolled over the setting for the managed index is configured to true (as the next generation index is the write index).
> This subtlety is not explicitly documented and I think we should document it in the ILM docs. Also, the CCR docs should define a full guide on managing indices with ILM.
> \`\`\`\[tasklist\]
> \### Tasks
> \`\`\`

---

<div class="post-metadata">

**Author:** ![seshug](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@seshug](https://discuss.elastic.co/u/seshug)\
**Post date:** [August 14, 2024, 4:35pm UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912/3 "2024-08-14T16:35:20Z")

</div>

This document looks good and is helpful for those who are setting up CCR for time series use cases. Thank you.

I have another scenario where full text search usecase-based indices:

eg indices: **clientid\_indexName\_v2-20240807041326**

These sorts of indices are created daily via the dotnet service when invoked via scheduler jobs.  
Unfortunately,, this scheduled jobs gets killed abruptly if data loads are not finished before business start time, eg; 8AM  
This means we can expect to have multiple indices in the cluster with the above-mentioned index pattern.  
The good thing is that there is always one good index that has full data and aliases pointed to, and all the old indices are deleted post-full data load completion.

**CCR Flow:**  
CCR auto-follow patterns are able to track these indices and replicate them in a follower cluster.  
But old indices are not being cleaned up.

The idea is to set an ILM and clean up indices older than 10 days in the Follower cluster.

The document says it can be done automatically for rollover indices, but unfortunately, our indices are not set for rollover and are created daily.

Can this document be used to set unfollow on the older indices that are older than 10 days and set the delete phase via ILM?

---

<div class="post-metadata">

**Author:** ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)\
**Post date:** [August 15, 2024, 8:05am UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912/4 "2024-08-15T08:05:02Z")

</div>

Happy to hear the document is useful. From the article, `index.lifecycle.indexing_complete` and `indexing_complete` must be true on the leader index to succeed the `unfollow`.

> Can this document be used to set unfollow on the older indices that are older than 10 days and set the delete phase via ILM?

As far as I know, there is no way to set `unfollow` in the ILM.

**Can you check what are these values in leader index settings?**

- If the values are `false` you should find a way to make them `true` with a code or with ILM.

---

<div class="post-metadata">

**Author:** ![seshug](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@seshug](https://discuss.elastic.co/u/seshug)\
**Post date:** [August 26, 2024, 2:49pm UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912/5 "2024-08-26T14:49:41Z")

</div>

sorry for getting back to you late.  
Indices are set with the following value "indexing\_complete": "false".

As you suggested, we will have to see how to update these parameters

---

<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:** [September 23, 2024, 2:50pm UTC](https://discuss.elastic.co/t/ccr-cross-cluster-replication/364912/6 "2024-09-23T14:50:01Z")

</div>

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