Subscribe to Posts by Email

Subscriber Count

    699

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Cassandra for Oracle DBA’s Part 17: Backup & Recovery

Backup in Cassandra maintain at node level , so any backup that taken in the one node does not contain other nodes data, so you must take backup of each node, cassandra maintains backups as snapshots means an entire sstables at disk level copied to a different folder with snapshot id as like below.

root@wash-i-16ca26c8-prod ~/.ccm/repository/4.5.2/resources/cassandra/bin $ ccm node1 nodetool snapshot PortfolioDemo

Requested creating snapshot for: PortfolioDemo

Snapshot directory: 1468236726789

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node2/data0/PortfolioDemo/Portfolios/snapshots $ ls -ltr

total 0

root@wash-i-16ca

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios/snapshots/1468236726789 $ ls -ltr

total 1072

-rw-r--r-- 2 root root  13456 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Filter.db

-rw-r--r-- 2 root root 220000 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Index.db

-rw-r--r-- 2 root root 576097 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Data.db

-rw-r--r-- 2 root root    243 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-CompressionInfo.db

-rw-r--r-- 2 root root   4406 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Statistics.db

-rw-r--r-- 2 root root     79 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-TOC.txt

-rw-r--r-- 2 root root   1652 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Summary.db

-rw-r--r-- 2 root root   3696 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Filter.db

-rw-r--r-- 2 root root  64548 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Index.db

-rw-r--r-- 2 root root 169778 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Data.db

-rw-r--r-- 2 root root     99 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-CompressionInfo.db

-rw-r--r-- 2 root root   4390 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Statistics.db

-rw-r--r-- 2 root root     79 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-TOC.txt

-rw-r--r-- 2 root root    532 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Summary.db

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios/snapshots/1468236726789 $

 

Size of Snapshot for One SS Table

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios/snapshots $ du -sh *

1.1M    1468236726789

Size of Data for One SS Table

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios $ du -h

1.1M    .

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios/snapshots $ ls -ltr

total 4

drwxr-xr-x 2 root root 4096 Jul 11 21:32 1468236726789

 

Deleting Snapshots

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios $ ccm node1 nodetool clearsnapshot PortfolioDemo

Requested clearing snapshot for: PortfolioDemo

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios $

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios $ ls -ltr

total 1072

-rw-r--r-- 1 root root  13456 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Filter.db

-rw-r--r-- 1 root root 220000 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Index.db

-rw-r--r-- 1 root root 576097 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Data.db

-rw-r--r-- 1 root root    243 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-CompressionInfo.db

-rw-r--r-- 1 root root   4406 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Statistics.db

-rw-r--r-- 1 root root     79 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-TOC.txt

-rw-r--r-- 1 root root   1652 Jul 11 12:02 PortfolioDemo-Portfolios-jb-5-Summary.db

-rw-r--r-- 1 root root   3696 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Filter.db

-rw-r--r-- 1 root root  64548 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Index.db

-rw-r--r-- 1 root root 169778 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Data.db

-rw-r--r-- 1 root root     99 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-CompressionInfo.db

-rw-r--r-- 1 root root   4390 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Statistics.db

-rw-r--r-- 1 root root     79 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-TOC.txt

-rw-r--r-- 1 root root    532 Jul 11 19:58 PortfolioDemo-Portfolios-jb-6-Summary.db

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios $

root@wash-i-16ca26c8-prod ~/.ccm/geek_cluster/node1/data0/PortfolioDemo/Portfolios $ ccm node1 nodetool clearsnapshot PortfolioDemo -t 1468236726789

 

Enabling Incremental Snapshots

root@wash-i-16ca26c8-prod ~/.ccm/repository/4.5.2/resources/cassandra/conf $ grep increment cassandra.yaml

incremental_backups: false

Change it to true.

-Thanks

Geek DBA

 

Comments are closed.