From 1db301183651b29a4b1a7a2b2359b4180c6b43a7 Mon Sep 17 00:00:00 2001 From: fibersel <0583463@gmail.com> Date: Sat, 7 Aug 2021 23:26:06 +0300 Subject: [PATCH 1/5] add ttl for snapshots --- src/doc/4.1/_sources/operating/backups.rst.txt | 9 ++++++++- src/doc/4.1/operating/backups.html | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/doc/4.1/_sources/operating/backups.rst.txt b/src/doc/4.1/_sources/operating/backups.rst.txt index 01cb6c588..095f4c75c 100644 --- a/src/doc/4.1/_sources/operating/backups.rst.txt +++ b/src/doc/4.1/_sources/operating/backups.rst.txt @@ -378,7 +378,14 @@ 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 - + +HER ++++ +PROSTO KEK + +:: + [ec2-user@ip-10-0-2-238 ~]$ meow + Listing Snapshots *************************** To list snapshots use the ``nodetool listsnapshots`` command. All the snapshots that we created in the preceding examples get listed: diff --git a/src/doc/4.1/operating/backups.html b/src/doc/4.1/operating/backups.html index eea911971..327ed43c6 100644 --- a/src/doc/4.1/operating/backups.html +++ b/src/doc/4.1/operating/backups.html @@ -513,6 +513,19 @@
One can provide ttl for created snapshot using --ttl option.TTL can be set in minutes (m), seconds (s), hours (h) and other TimeUnits.
+As an example, create snapshots for all tables in catalogkeyspace and cqlkeyspace keyspaces and set 3 minutes ttl.
+
[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
+One can provide ttl for created snapshot using --ttl option.TTL can be set in minutes (m), seconds (s), hours (h) and other TimeUnits.
-As an example, create snapshots for all tables in catalogkeyspace and cqlkeyspace keyspaces and set 3 minutes ttl.
-
[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
-To list snapshots use the nodetool listsnapshots command. All the snapshots that we created in the preceding examples get listed:
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. +
+The snapshots directories may be listed with find –name snapshots command: