2020-02-04 19:45:18 -05:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[snapshot-lifecycle-management]]
|
|
|
|
== Manage the snapshot lifecycle
|
|
|
|
|
2020-04-17 15:04:17 -04:00
|
|
|
You can set up snapshot lifecycle policies to automate the timing, frequency, and retention of snapshots.
|
2020-07-13 09:26:51 -04:00
|
|
|
Snapshot policies can apply to multiple data streams and indices.
|
2020-02-04 19:45:18 -05:00
|
|
|
|
|
|
|
The snapshot lifecycle management (SLM) <<snapshot-lifecycle-management-api, CRUD APIs>> provide
|
2020-04-17 15:04:17 -04:00
|
|
|
the building blocks for the snapshot policy features that are part of the Management application in {kib}.
|
2020-07-13 09:26:51 -04:00
|
|
|
The Snapshot and Restore UI makes it easy to set up policies, register snapshot repositories,
|
|
|
|
view and manage snapshots, and restore data streams or indices.
|
2020-02-04 19:45:18 -05:00
|
|
|
|
|
|
|
You can stop and restart SLM to temporarily pause automatic backups while performing
|
|
|
|
upgrades or other maintenance.
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2020-02-04 19:45:18 -05:00
|
|
|
[[slm-and-security]]
|
|
|
|
=== Security and SLM
|
|
|
|
|
2020-04-17 15:04:17 -04:00
|
|
|
Two built-in cluster privileges control access to the SLM actions when
|
2020-02-04 19:45:18 -05:00
|
|
|
{es} {security-features} are enabled:
|
|
|
|
|
2020-04-17 15:04:17 -04:00
|
|
|
`manage_slm`:: Allows a user to perform all SLM actions, including creating and updating policies
|
|
|
|
and starting and stopping SLM.
|
2020-02-04 19:45:18 -05:00
|
|
|
|
2020-04-17 15:04:17 -04:00
|
|
|
`read_slm`:: Allows a user to perform all read-only SLM actions,
|
2020-02-04 19:45:18 -05:00
|
|
|
such as getting policies and checking the SLM status.
|
|
|
|
|
|
|
|
`cluster:admin/snapshot/*`:: Allows a user to take and delete snapshots of any
|
2020-04-17 15:04:17 -04:00
|
|
|
index, whether or not they have access to that index.
|
2020-02-04 19:45:18 -05:00
|
|
|
|
|
|
|
For example, the following request configures an `slm-admin` role that grants the privileges
|
|
|
|
necessary for administering SLM.
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
-----------------------------------
|
|
|
|
POST /_security/role/slm-admin
|
|
|
|
{
|
|
|
|
"cluster": ["manage_slm", "cluster:admin/snapshot/*"],
|
|
|
|
"indices": [
|
|
|
|
{
|
|
|
|
"names": [".slm-history-*"],
|
|
|
|
"privileges": ["all"]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
-----------------------------------
|
|
|
|
// TEST[skip:security is not enabled here]
|
|
|
|
|
|
|
|
Or, for a read-only role that can retrieve policies (but not update, execute, or
|
|
|
|
delete them), as well as only view the history index:
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
-----------------------------------
|
|
|
|
POST /_security/role/slm-read-only
|
|
|
|
{
|
|
|
|
"cluster": ["read_slm"],
|
|
|
|
"indices": [
|
|
|
|
{
|
|
|
|
"names": [".slm-history-*"],
|
|
|
|
"privileges": ["read"]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
-----------------------------------
|
|
|
|
// TEST[skip:security is not enabled here]
|
|
|
|
|
|
|
|
include::getting-started-slm.asciidoc[]
|
|
|
|
|
2020-04-17 15:04:17 -04:00
|
|
|
include::slm-retention.asciidoc[]
|