Stopping machine learning
editStopping machine learning
editAn orderly shutdown of machine learning ensures that:
- Datafeeds are stopped
- Buffers are flushed
- Model history is pruned
- Final results are calculated
- Model snapshots are saved
- Jobs are closed
This process ensures that jobs are in a consistent state in case you want to subsequently re-open them.
Stopping Datafeeds
editWhen you stop a datafeed, it ceases to retrieve data from Elasticsearch. You can stop a
datafeed by using Kibana or the
stop datafeeds API. For example, the following
request stops the feed1
datafeed:
POST _ml/datafeeds/datafeed-total-requests/_stop
You must have manage_ml
, or manage
cluster privileges to stop datafeeds.
For more information, see Security privileges.
A datafeed can be started and stopped multiple times throughout its lifecycle.
For examples of stopping datafeeds in Kibana, see Managing jobs.
Stopping All Datafeeds
editIf you are upgrading your cluster, you can use the following request to stop all datafeeds:
POST _ml/datafeeds/_all/_stop
Closing Jobs
editWhen you close a job, it cannot receive data or perform analysis operations. If a job is associated with a datafeed, you must stop the datafeed before you can close the jobs. If the datafeed has an end date, the job closes automatically on that end date.
You can close a job by using the close job API. For
example, the following request closes the job1
job:
POST _ml/anomaly_detectors/total-requests/_close
You must have manage_ml
, or manage
cluster privileges to stop datafeeds.
For more information, see Security privileges.
A job can be opened and closed multiple times throughout its lifecycle.
Closing All Jobs
editIf you are upgrading your cluster, you can use the following request to close all open jobs on the cluster:
POST _ml/anomaly_detectors/_all/_close