2018-06-19 16:57:10 -04:00
|
|
|
[role="xpack"]
|
2017-11-14 21:04:21 -05:00
|
|
|
[[stopping-ml]]
|
2019-07-26 14:07:01 -04:00
|
|
|
== Stopping {ml} {anomaly-detect}
|
2017-11-14 21:04:21 -05:00
|
|
|
|
2019-07-26 14:07:01 -04:00
|
|
|
An orderly shutdown ensures that:
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
* {dfeeds-cap} are stopped
|
|
|
|
* Buffers are flushed
|
|
|
|
* Model history is pruned
|
|
|
|
* Final results are calculated
|
|
|
|
* Model snapshots are saved
|
2019-07-26 14:07:01 -04:00
|
|
|
* {anomaly-jobs-cap} are closed
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
This process ensures that jobs are in a consistent state in case you want to
|
|
|
|
subsequently re-open them.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
[[stopping-ml-datafeeds]]
|
2019-07-26 14:07:01 -04:00
|
|
|
=== Stopping {dfeeds}
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
When you stop a {dfeed}, it ceases to retrieve data from {es}. You can stop a
|
|
|
|
{dfeed} by using {kib} or the
|
|
|
|
{ref}/ml-stop-datafeed.html[stop {dfeeds} API]. For example, the following
|
|
|
|
request stops the `feed1` {dfeed}:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2019-07-26 14:07:01 -04:00
|
|
|
POST _ml/datafeeds/feed1/_stop
|
2017-11-14 21:04:21 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
2018-08-31 14:56:26 -04:00
|
|
|
// TEST[skip:setup:server_metrics_startdf]
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
|
|
|
|
For more information, see <<security-privileges>>.
|
|
|
|
|
|
|
|
A {dfeed} can be started and stopped multiple times throughout its lifecycle.
|
|
|
|
|
2019-07-12 11:25:23 -04:00
|
|
|
//For examples of stopping {dfeeds} in {kib}, see <<ml-gs-job1-manage>>.
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
[float]
|
|
|
|
[[stopping-all-ml-datafeeds]]
|
2019-07-26 14:07:01 -04:00
|
|
|
==== Stopping all {dfeeds}
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
If you are upgrading your cluster, you can use the following request to stop all
|
|
|
|
{dfeeds}:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
----------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
POST _ml/datafeeds/_all/_stop
|
2017-11-14 21:04:21 -05:00
|
|
|
----------------------------------
|
|
|
|
// CONSOLE
|
2018-08-31 14:56:26 -04:00
|
|
|
// TEST[skip:needs-licence]
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
[float]
|
|
|
|
[[closing-ml-jobs]]
|
2019-07-26 14:07:01 -04:00
|
|
|
=== Closing {anomaly-jobs}
|
2017-11-14 21:04:21 -05:00
|
|
|
|
2019-07-26 14:07:01 -04:00
|
|
|
When you close an {anomaly-job}, it cannot receive data or perform analysis
|
|
|
|
operations. If a job is associated with a {dfeed}, you must stop the {dfeed}
|
|
|
|
before you can close the job. If the {dfeed} has an end date, the job closes
|
|
|
|
automatically on that end date.
|
2017-11-14 21:04:21 -05:00
|
|
|
|
2019-07-26 14:07:01 -04:00
|
|
|
You can close a job by using the
|
|
|
|
{ref}/ml-close-job.html[close {anomaly-job} API]. For
|
2017-11-14 21:04:21 -05:00
|
|
|
example, the following request closes the `job1` job:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2019-07-26 14:07:01 -04:00
|
|
|
POST _ml/anomaly_detectors/job1/_close
|
2017-11-14 21:04:21 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
2018-08-31 14:56:26 -04:00
|
|
|
// TEST[skip:setup:server_metrics_openjob]
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
|
|
|
|
For more information, see <<security-privileges>>.
|
|
|
|
|
2019-07-26 14:07:01 -04:00
|
|
|
{anomaly-jobs-cap} can be opened and closed multiple times throughout their
|
|
|
|
lifecycle.
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
[float]
|
|
|
|
[[closing-all-ml-datafeeds]]
|
2019-07-26 14:07:01 -04:00
|
|
|
==== Closing all {anomaly-jobs}
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
If you are upgrading your cluster, you can use the following request to close
|
2019-07-26 14:07:01 -04:00
|
|
|
all open {anomaly-jobs} on the cluster:
|
2017-11-14 21:04:21 -05:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
----------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
POST _ml/anomaly_detectors/_all/_close
|
2017-11-14 21:04:21 -05:00
|
|
|
----------------------------------
|
|
|
|
// CONSOLE
|
2018-08-31 14:56:26 -04:00
|
|
|
// TEST[skip:needs-licence]
|