# Rollover and Consolidation of Shards

**URL:** <https://discuss.elastic.co/t/rollover-and-consolidation-of-shards/307158>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [June 14, 2022, 12:58pm UTC](https://discuss.elastic.co/t/rollover-and-consolidation-of-shards/307158 "2022-06-14T12:58:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![parthmaniar](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@parthmaniar](https://discuss.elastic.co/u/parthmaniar)\
**Post date:** [June 14, 2022, 12:58pm UTC](https://discuss.elastic.co/t/rollover-and-consolidation-of-shards/307158/1 "2022-06-14T12:58:35Z")

</div>

Hello, my cluster has 1150 primary shards with 2300 total shards. I wanted to:

1. consolidate them into recommended size of 50 GB each (100 with replica). I have attempted to this via Kibana GUI (using force merge) but it doesn't work. There is no error and I do get a "successfully merged" feedback. However, I can the individual shards.
2. I also want to ILM policy for them to only rollover once they reach 50 GB. I've tried to set this manually but it keeps failing. Could someone please assist?

I have two data nodes and one voting only node.

```auto
{
    "cluster_name": "data_analytics_1",
    "status": "green",
    "timed_out": false,
    "number_of_nodes": 3,
    "number_of_data_nodes": 2,
    "active_primary_shards": 1150,
    "active_shards": 2300,
    "relocating_shards": 0,
    "initializing_shards": 0,
    "unassigned_shards": 0,
    "delayed_unassigned_shards": 0,
    "number_of_pending_tasks": 0,
    "number_of_in_flight_fetch": 0,
    "task_max_waiting_in_queue_millis": 0,
    "active_shards_percent_as_number": 100.0
}

```

---

<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:** [June 21, 2022, 5:51am UTC](https://discuss.elastic.co/t/rollover-and-consolidation-of-shards/307158/2 "2022-06-21T05:51:17Z")

</div>

> [@parthmaniar](#):
>
> consolidate them into recommended size of 50 GB each (100 with replica). I have attempted to this via Kibana GUI (using force merge) but it doesn't work. There is no error and I do get a "successfully merged" feedback. However, I can the individual shards.

Forcemerge does only merge segments within a shard and does not reduce shard count. If you have indices with more than 1 primary shard you can look at the [shrink index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.2/indices-shrink-index.html).

If your indices have a single primary shard you will need to reindex your data into new indices in order to combine indices/shards.

> [@parthmaniar](#):
>
> I also want to ILM policy for them to only rollover once they reach 50 GB. I've tried to set this manually but it keeps failing. Could someone please assist?

Please show what you have tried and elaborate on what did not work.

---

<div class="post-metadata">

**Author:** ![parthmaniar](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@parthmaniar](https://discuss.elastic.co/u/parthmaniar)\
**Post date:** [June 29, 2022, 9:28am UTC](https://discuss.elastic.co/t/rollover-and-consolidation-of-shards/307158/3 "2022-06-29T09:28:31Z")

</div>

Thanks a lot @Christian_Dahlqvist , let me try the first two options and revert.

---

<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:** [July 27, 2022, 9:28am UTC](https://discuss.elastic.co/t/rollover-and-consolidation-of-shards/307158/4 "2022-07-27T09:28:33Z")

</div>

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