stopping-ml.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [role="xpack"]
  2. [[stopping-ml]]
  3. == Stopping machine learning
  4. An orderly shutdown of {ml} 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. * Jobs 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-cap}
  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/datafeed-total-requests/_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-cap}
  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 Jobs
  44. When you close a job, it cannot receive data or perform analysis operations.
  45. If a job is associated with a {dfeed}, you must stop the {dfeed} before you can
  46. close the jobs. If the {dfeed} has an end date, the job closes automatically on
  47. that end date.
  48. You can close a job by using the {ref}/ml-close-job.html[close job API]. For
  49. example, the following request closes the `job1` job:
  50. [source,js]
  51. --------------------------------------------------
  52. POST _ml/anomaly_detectors/total-requests/_close
  53. --------------------------------------------------
  54. // CONSOLE
  55. // TEST[skip:setup:server_metrics_openjob]
  56. NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
  57. For more information, see <<security-privileges>>.
  58. A job can be opened and closed multiple times throughout its lifecycle.
  59. [float]
  60. [[closing-all-ml-datafeeds]]
  61. ==== Closing All Jobs
  62. If you are upgrading your cluster, you can use the following request to close
  63. all open jobs on the cluster:
  64. [source,js]
  65. ----------------------------------
  66. POST _ml/anomaly_detectors/_all/_close
  67. ----------------------------------
  68. // CONSOLE
  69. // TEST[skip:needs-licence]