stopping-ml.asciidoc 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. [role="xpack"]
  2. [[stopping-ml]]
  3. == Stopping {ml} {anomaly-detect}
  4. An orderly shutdown ensures that:
  5. * {dfeeds-cap} are stopped
  6. * Buffers are flushed
  7. * Model history is pruned
  8. * Final results are calculated
  9. * Model snapshots are saved
  10. * {anomaly-jobs-cap} are closed
  11. This process ensures that jobs are in a consistent state in case you want to
  12. subsequently re-open them.
  13. [float]
  14. [[stopping-ml-datafeeds]]
  15. === Stopping {dfeeds}
  16. When you stop a {dfeed}, it ceases to retrieve data from {es}. You can stop a
  17. {dfeed} by using {kib} or the
  18. {ref}/ml-stop-datafeed.html[stop {dfeeds} API]. For example, the following
  19. request stops the `feed1` {dfeed}:
  20. [source,js]
  21. --------------------------------------------------
  22. POST _ml/datafeeds/feed1/_stop
  23. --------------------------------------------------
  24. // CONSOLE
  25. // TEST[skip:setup:server_metrics_startdf]
  26. NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
  27. For more information, see <<security-privileges>>.
  28. A {dfeed} can be started and stopped multiple times throughout its lifecycle.
  29. //For examples of stopping {dfeeds} in {kib}, see <<ml-gs-job1-manage>>.
  30. [float]
  31. [[stopping-all-ml-datafeeds]]
  32. ==== Stopping all {dfeeds}
  33. If you are upgrading your cluster, you can use the following request to stop all
  34. {dfeeds}:
  35. [source,js]
  36. ----------------------------------
  37. POST _ml/datafeeds/_all/_stop
  38. ----------------------------------
  39. // CONSOLE
  40. // TEST[skip:needs-licence]
  41. [float]
  42. [[closing-ml-jobs]]
  43. === Closing {anomaly-jobs}
  44. When you close an {anomaly-job}, it cannot receive data or perform analysis
  45. operations. If a job is associated with a {dfeed}, you must stop the {dfeed}
  46. before you can close the job. If the {dfeed} has an end date, the job closes
  47. automatically on that end date.
  48. You can close a job by using the
  49. {ref}/ml-close-job.html[close {anomaly-job} API]. For
  50. example, the following request closes the `job1` job:
  51. [source,js]
  52. --------------------------------------------------
  53. POST _ml/anomaly_detectors/job1/_close
  54. --------------------------------------------------
  55. // CONSOLE
  56. // TEST[skip:setup:server_metrics_openjob]
  57. NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
  58. For more information, see <<security-privileges>>.
  59. {anomaly-jobs-cap} can be opened and closed multiple times throughout their
  60. lifecycle.
  61. [float]
  62. [[closing-all-ml-datafeeds]]
  63. ==== Closing all {anomaly-jobs}
  64. If you are upgrading your cluster, you can use the following request to close
  65. all open {anomaly-jobs} on the cluster:
  66. [source,js]
  67. ----------------------------------
  68. POST _ml/anomaly_detectors/_all/_close
  69. ----------------------------------
  70. // CONSOLE
  71. // TEST[skip:needs-licence]