index.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[snapshot-lifecycle-management]]
  4. == Manage the snapshot lifecycle
  5. You can set up snapshot lifecycle policies to automate the timing, frequency, and retention of snapshots.
  6. Snapshot policies can apply to multiple indices.
  7. The snapshot lifecycle management (SLM) <<snapshot-lifecycle-management-api, CRUD APIs>> provide
  8. the building blocks for the snapshot policy features that are part of the Management application in {kib}.
  9. The Snapshot and Restore UI makes it easy to set up policies, register snapshot repositories,
  10. view and manage snapshots, and restore indices.
  11. You can stop and restart SLM to temporarily pause automatic backups while performing
  12. upgrades or other maintenance.
  13. To disable SLM entirely, set `xpack.slm.enabled` to `false` in `elasticsearch.yml`.
  14. [float]
  15. [[slm-and-security]]
  16. === Security and SLM
  17. Two built-in cluster privileges control access to the SLM actions when
  18. {es} {security-features} are enabled:
  19. `manage_slm`:: Allows a user to perform all SLM actions, including creating and updating policies
  20. and starting and stopping SLM.
  21. `read_slm`:: Allows a user to perform all read-only SLM actions,
  22. such as getting policies and checking the SLM status.
  23. `cluster:admin/snapshot/*`:: Allows a user to take and delete snapshots of any
  24. index, whether or not they have access to that index.
  25. For example, the following request configures an `slm-admin` role that grants the privileges
  26. necessary for administering SLM.
  27. [source,console]
  28. -----------------------------------
  29. POST /_security/role/slm-admin
  30. {
  31. "cluster": ["manage_slm", "cluster:admin/snapshot/*"],
  32. "indices": [
  33. {
  34. "names": [".slm-history-*"],
  35. "privileges": ["all"]
  36. }
  37. ]
  38. }
  39. -----------------------------------
  40. // TEST[skip:security is not enabled here]
  41. Or, for a read-only role that can retrieve policies (but not update, execute, or
  42. delete them), as well as only view the history index:
  43. [source,console]
  44. -----------------------------------
  45. POST /_security/role/slm-read-only
  46. {
  47. "cluster": ["read_slm"],
  48. "indices": [
  49. {
  50. "names": [".slm-history-*"],
  51. "privileges": ["read"]
  52. }
  53. ]
  54. }
  55. -----------------------------------
  56. // TEST[skip:security is not enabled here]
  57. include::getting-started-slm.asciidoc[]
  58. include::slm-retention.asciidoc[]