# How to stop Ml Daily Maintenance Service in elasticsearch (SLM retention snapshot cleanup task)

**URL:** <https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [November 17, 2020, 6:12am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623 "2020-11-17T06:12:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sakthiskv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sakthiskv/32/70155_2.png) [@sakthiskv](https://discuss.elastic.co/u/sakthiskv)\
**Post date:** [November 17, 2020, 6:12am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/1 "2020-11-17T06:12:07Z")

</div>

Hai ,  
How to turn off or disable automatic deletion (ML daily maintenance task) in ES ?. everyday its happening , anyone plz help on this.

[2020-08-19T01:30:00,036][INFO][o.e.x.s.SnapshotRetentionTask] [_**] starting SLM retention snapshot cleanup task  
[2020-08-19T01:30:00,315][INFO][o.e.x.m.a.TransportDeleteExpiredDataAction] [sandbox] Completed deletion of expired ML data  
[2020-08-19T01:30:00,316][INFO][o.e.x.m.MlDailyMaintenanceService] [**_] Successfully completed [ML] maintenance tasks  
[2020-08-19T03:51:19,410][INFO][o.e.n.Node] [_**] stopping ...  
[2020-08-19T03:51:19,699][INFO][o.e.x.w.WatcherService] [**_] stopping watch service, reason [shutdown initiated]  
[2020-08-19T03:51:19,704][INFO][o.e.x.w.WatcherLifeCycleService] [sandbox] watcher has stopped and shutdown  
[2020-08-19T03:51:20,112][INFO][o.e.n.Node] [_**] stopped  
[2020-08-19T03:51:20,113][INFO][o.e.n.Node] [**_] closing ...  
[2020-08-19T03:51:20,311][INFO][o.e.n.Node] [_**] closed  
[2020-08-19T03:51:20,320][INFO][o.e.x.m.p.NativeController] [**_] Native controller process has stopped - no new native processes can be started

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2020, 6:51am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/2 "2020-11-17T06:51:39Z")

</div>

What is the problem you are trying to solve here?

---

<div class="post-metadata">

**Author:** ![sakthiskv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sakthiskv/32/70155_2.png) [@sakthiskv](https://discuss.elastic.co/u/sakthiskv)\
**Post date:** [November 17, 2020, 6:54am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/3 "2020-11-17T06:54:28Z")

</div>

I need to disable that daily maintenance task ( _ **MlDailyMaintenanceService** _)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2020, 6:57am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/4 "2020-11-17T06:57:30Z")

</div>

But what makes you think you need to do that?

---

<div class="post-metadata">

**Author:** ![sakthiskv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sakthiskv/32/70155_2.png) [@sakthiskv](https://discuss.elastic.co/u/sakthiskv)\
**Post date:** [November 17, 2020, 7:07am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/5 "2020-11-17T07:07:58Z")

</div>

> [@warkolm](#):
>
> But what makes you think you need to do that?

recently i installed ES and pushing data from monstache. but ES automatically deleting index for some daily basis. Its seems like daily maintenance task and its triggering automatically. i need to stop this daily maintenance task .

is there any configuration to stop this ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2020, 7:15am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/6 "2020-11-17T07:15:43Z")

</div>

Elasticsearch will only delete (non-system) indices if you specifically set ILM (or another process) up to do this. It won't delete them as part of the `MlDailyMaintenanceService` process you are referring to.

If your indices are being deleted it should be mentioned in the Elasticsearch logs, can you see that?

---

<div class="post-metadata">

**Author:** ![sakthiskv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sakthiskv/32/70155_2.png) [@sakthiskv](https://discuss.elastic.co/u/sakthiskv)\
**Post date:** [November 17, 2020, 7:26am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/7 "2020-11-17T07:26:09Z")

</div>

No, nothing mentioned there

---

<div class="post-metadata">

**Author:** ![sakthiskv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sakthiskv/32/70155_2.png) [@sakthiskv](https://discuss.elastic.co/u/sakthiskv)\
**Post date:** [November 17, 2020, 7:29am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/8 "2020-11-17T07:29:54Z")

</div>

In ES logs i am getting this info

[2020-11-09T01:30:00,002][INFO][o.e.x.s.SnapshotRetentionTask] [node-1] starting SLM retention snapshot cleanup task  
[2020-11-09T02:04:00,000][INFO][o.e.x.m.MlDailyMaintenanceService] [node-1] triggering scheduled [ML] maintenance tasks  
[2020-11-09T02:04:00,001][INFO][o.e.x.m.a.TransportDeleteExpiredDataAction] [node-1] Deleting expired data  
[2020-11-09T02:04:00,045][INFO][o.e.x.m.a.TransportDeleteExpiredDataAction] [node-1] Completed deletion of expired ML data  
[2020-11-09T02:04:00,060][INFO][o.e.x.m.MlDailyMaintenanceService] [node-1] Successfully completed [ML] maintenance tasks

---

<div class="post-metadata">

**Author:** ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)\
**Post date:** [November 17, 2020, 9:47am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/9 "2020-11-17T09:47:26Z")

</div>

The ML daily maintenance task only touches indices named `.ml-anomalies*` and `.ml-state*`. Are you storing your own data in indices with names that match these patterns? If you are then please switch to using other indices, as these patterns are reserved for the Elastic ML plugin.

The ML daily maintenance is running extremely quickly, which makes me wonder if you are not using ML at all. Is that correct? If you are not using ML at all you can disable it by putting `xpack.ml.enabled: false` in your `elasticsearch.yml`. Please be aware that after doing this **none** of the ML APIs will work. Disabling the ML plugin and restarting the cluster will stop the ML daily maintenance task from running. But then, assuming your indices are not named `.ml*`, I think you will find that it wasn't the ML daily maintenance that was deleting your indices after all.

---

<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 15, 2020, 9:47am UTC](https://discuss.elastic.co/t/how-to-stop-ml-daily-maintenance-service-in-elasticsearch-slm-retention-snapshot-cleanup-task/255623/10 "2020-12-15T09:47:46Z")

</div>

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