diff --git a/src/doc/4.1/_sources/operating/backups.rst.txt b/src/doc/4.1/_sources/operating/backups.rst.txt index 01cb6c5882..31d9552886 100644 --- a/src/doc/4.1/_sources/operating/backups.rst.txt +++ b/src/doc/4.1/_sources/operating/backups.rst.txt @@ -258,6 +258,9 @@ In this section including sub-sections we shall demonstrate creating snapshots. -t , --tag The name of the snapshot + --ttl + Set ttl of snapshot + -u , --username Remote jmx agent username @@ -378,7 +381,7 @@ To take snapshots of multiple tables that are in different keyspaces the command Requested creating snapshot(s) for [catalogkeyspace.journal,cqlkeyspace.t] with snapshot name [multi-ks] and options {skipFlush=false} Snapshot directory: multi-ks - + Listing Snapshots *************************** To list snapshots use the ``nodetool listsnapshots`` command. All the snapshots that we created in the preceding examples get listed: @@ -400,6 +403,42 @@ To list snapshots use the ``nodetool listsnapshots`` command. All the snapshots Total TrueDiskSpaceUsed: 44.02 KiB +Expiring snapshots +++++++++++++++++++++++++++++++++++ +It's possible to set a time-to-live (TTL) for created snapshot using the ``--ttl`` option, causing the snapshot to be automatically cleaned up when the TTL expires. TTL can be specified in minutes (m), seconds (s), hours (h) and days (d). + +The example below shows the creation of a snapshot for all tables in the ``catalogkeyspace`` and ``cqlkeyspace`` keyspaces with a TTL of 3 minutes: + +:: + + [ec2-user@ip-10-0-2-238 ~]$ nodetool snapshot + --tag catalog-cql-ks --ttl 3m catalogkeyspace cqlkeyspace + Requested creating snapshot(s) for [catalogkeyspace, cqlkeyspace] with snapshot + name [catalog-cql-ks] and options {skipFlush=false, ttl=3m} + Snapshot directory: catalog-cql-ks + +now let's display information about snapshots: + +:: + [ec2-user@ip-10-0-2-238 ~]$ nodetool listsnapshots + Snapshot Details: + Snapshot name Keyspace name Column family name True size Size on disk Creation time Expiration time + catalog-cql-ks catalogkeyspace magazine 4,94 KiB 5,9 KiB 2021-08-23T20:52:01.344Z 2021-08-23T20:55:01.344Z + catalog-cql-ks catalogkeyspace journal 4,94 KiB 5,9 KiB 2021-08-23T20:52:01.368Z 2021-08-23T20:55:01.368Z + catalog-cql-ks cqlkeyspace t 0 bytes 951 bytes 2021-08-23T20:52:01.370Z 2021-08-23T20:55:01.370Z + catalog-cql-ks cqlkeyspace t2 0 bytes 952 bytes 2021-08-23T20:52:01.373Z 2021-08-23T20:55:01.373Z + + Total TrueDiskSpaceUsed: 9,87 KiB + +We see creation and expiration time.Let's wait couple of minutes and try again: + +:: + [ec2-user@ip-10-0-2-238 ~]$ nodetool listsnapshots + Snapshot Details: + There are no snapshots + +Finally, these snapshots have expired. + Finding Snapshots Directories ****************************** The ``snapshots`` directories may be listed with ``find –name snapshots`` command: diff --git a/src/doc/4.1/operating/backups.html b/src/doc/4.1/operating/backups.html index eea911971d..68707c398a 100644 --- a/src/doc/4.1/operating/backups.html +++ b/src/doc/4.1/operating/backups.html @@ -412,6 +412,9 @@

Snapshots -

Listing Snapshots

To list snapshots use the nodetool listsnapshots command. All the snapshots that we created in the preceding examples get listed:

@@ -534,6 +536,43 @@

Listing Snapshots +

Expiring snapshots

+

It's possible to set a time-to-live (TTL) for created snapshot using the --ttl option, causing the snapshot to be automatically cleaned up when the TTL expires. TTL can be specified in minutes (m), seconds (s), hours (h) and days (d). The example below shows the creation of a snapshot for all tables in the catalogkeyspace and cqlkeyspace keyspaces with a TTL of 3 minutes: +

+
[ec2-user@ip-10-0-2-238 ~]$ nodetool snapshot
+--tag catalog-cql-ks --ttl 3m  catalogkeyspace cqlkeyspace
+Requested creating snapshot(s) for [catalogkeyspace, cqlkeyspace] with snapshot
+name [catalog-cql-ks] and options {skipFlush=false, ttl=3m}
+Snapshot directory: catalog-cql-ks
+
+
+

+

now let's display information about snapshots: +

+
[ec2-user@ip-10-0-2-238 ~]$ nodetool listsnapshots
+Snapshot Details:
+Snapshot name  Keyspace name   Column family name True size Size on disk Creation time            Expiration time
+catalog-cql-ks catalogkeyspace magazine           4,94 KiB  5,9 KiB      2021-08-23T20:52:01.344Z 2021-08-23T20:55:01.344Z
+catalog-cql-ks catalogkeyspace journal            4,94 KiB  5,9 KiB      2021-08-23T20:52:01.368Z 2021-08-23T20:55:01.368Z
+catalog-cql-ks cqlkeyspace     t                  0 bytes   951 bytes    2021-08-23T20:52:01.370Z 2021-08-23T20:55:01.370Z
+catalog-cql-ks cqlkeyspace     t2                 0 bytes   952 bytes    2021-08-23T20:52:01.373Z 2021-08-23T20:55:01.373Z
+
+Total TrueDiskSpaceUsed: 9,87 KiB
+
+
+

+We see creation and expiration time.Let's wait couple of minutes and try again: +

+
[ec2-user@ip-10-0-2-238 ~]$ nodetool listsnapshots
+Snapshot Details:
+There are no snapshots
+
+
+

+Finally, these snapshots have expired. +

+

Finding Snapshots Directories

The snapshots directories may be listed with find –name snapshots command: