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

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

What is the problem you are trying to solve here?

I need to disable that daily maintenance task ( MlDailyMaintenanceService)

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 ?

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?

No, nothing mentioned there

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

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.

1 Like

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