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 @@

Taking Snapshot of Multiple Tables from Different Keyspaces +

Providing TTL for created snapshot

+

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
+
+
+

Listing Snapshots

From dbb543498241b194ae355a3efd097f821a634ffe Mon Sep 17 00:00:00 2001 From: fibersel <0583463@gmail.com> Date: Sat, 7 Aug 2021 23:30:26 +0300 Subject: [PATCH 2/5] fix rst --- src/doc/4.1/_sources/operating/backups.rst.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/doc/4.1/_sources/operating/backups.rst.txt b/src/doc/4.1/_sources/operating/backups.rst.txt index 095f4c75c..dc330609e 100644 --- a/src/doc/4.1/_sources/operating/backups.rst.txt +++ b/src/doc/4.1/_sources/operating/backups.rst.txt @@ -379,9 +379,17 @@ To take snapshots of multiple tables that are in different keyspaces the command name [multi-ks] and options {skipFlush=false} Snapshot directory: multi-ks -HER -+++ -PROSTO KEK +Providing TTL for created snapshot +++++++++++++++++++++++++++++++++++ +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 :: [ec2-user@ip-10-0-2-238 ~]$ meow From dd3bb3c6c60a3ea15c6e573ff669c0e18aec6d4c Mon Sep 17 00:00:00 2001 From: fibersel <0583463@gmail.com> Date: Sat, 7 Aug 2021 23:31:11 +0300 Subject: [PATCH 3/5] remove old --- src/doc/4.1/_sources/operating/backups.rst.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/doc/4.1/_sources/operating/backups.rst.txt b/src/doc/4.1/_sources/operating/backups.rst.txt index dc330609e..855c5fc7d 100644 --- a/src/doc/4.1/_sources/operating/backups.rst.txt +++ b/src/doc/4.1/_sources/operating/backups.rst.txt @@ -391,9 +391,6 @@ One can provide ttl for created snapshot using ``--ttl`` option.TTL can be set i name [catalog-cql-ks] and options {skipFlush=false, ttl=3m} Snapshot directory: catalog-cql-ks -:: - [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: From f6218078907b549ae26bde89e8097437fea6a75c Mon Sep 17 00:00:00 2001 From: fibersel <0583463@gmail.com> Date: Sun, 8 Aug 2021 21:30:01 +0300 Subject: [PATCH 4/5] add ttl to command options --- src/doc/4.1/_sources/operating/backups.rst.txt | 3 +++ src/doc/4.1/operating/backups.html | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/doc/4.1/_sources/operating/backups.rst.txt b/src/doc/4.1/_sources/operating/backups.rst.txt index 855c5fc7d..fca1ed616 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 diff --git a/src/doc/4.1/operating/backups.html b/src/doc/4.1/operating/backups.html index 327ed43c6..3254fa8d1 100644 --- a/src/doc/4.1/operating/backups.html +++ b/src/doc/4.1/operating/backups.html @@ -412,6 +412,9 @@

Snapshots

-
-

Providing TTL for created snapshot

-

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
-
-
-
-

Listing Snapshots

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

@@ -550,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: