
{"id":8149,"date":"2019-07-17T16:34:27","date_gmt":"2019-07-17T16:34:27","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/apache-cassandra-backup-and-recovery\/"},"modified":"2026-11-03T19:29:27","modified_gmt":"2026-11-03T19:29:27","slug":"apache-cassandra-backup-and-recovery","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/en-gb\/blogs\/apache-cassandra-backup-and-recovery\/","title":{"rendered":"Apache Cassandra backup and recovery"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>Database backup and recovery is one of the crucial day-to-day activities that a&nbsp;database administrator (DBA) performs. A database backup is a copy of your&nbsp;data that can be used to recover the data in the event of data loss.This blog shows you how to backup Apache\u00a9 Cassandra\u00a9 databases and&nbsp;restore them after a failure.<\/p>\n<p>Though Apache Cassandra is decentralized, it can endure single and&nbsp;multi-node failures without losing any business data, as long as one of the&nbsp;nodes in the cluster contains data. However, as a best practice, you should&nbsp;configure a backup for the databases.<\/p>\n<p>In case of any failure, such as an entire cluster rebuild, data corruption,&nbsp;accidental data deletion, and so on, you can recover the data from the backup&nbsp;and continue business operations with minimal or no impact.<\/p>\n<p>More and more companies are using NoSQL databases, such as Cassandra, to&nbsp;successfully manage the large volume of business data, more popularly&nbsp;known as Big Data. Cassandra, widely used by many major organizations,&nbsp;ensures scalability, fault-tolerance, and consistency to support Big Data.<\/p>\n<p><strong>Cassandra database backup and restore<\/strong><\/p>\n<p>You can use the following utilities to take a snapshot of a Cassandra database<br \/>\nand restore it when required:<\/p>\n<p>&#8211; <em>nodetool<\/em>&nbsp;(To take the snapshot)<br \/>\n&#8211; <em>sstableloader<\/em>&nbsp;(To restore the snapshot backup)<\/p>\n<p>The following image illustrates moving from a cloud cluster to a Cassandra<br \/>\ncluster by using `<em>sstableloader<\/em>`:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26609-body-Picture1_15.png\" alt=\"cassandra pic 1\" \/><\/p>\n<p><a href=\"https:\/\/dzone.com\/articles\/using-casandras-sstable-bulk\"><em>Image source<\/em><\/a><\/p>\n<p><strong>Backup<\/strong><\/p>\n<p>The following example uses `nodetool` to take a snapshot of Cassandra database<br \/>\n<strong>keyspace(users)<\/strong>&nbsp;with a table called <strong>employee<\/strong>.<\/p>\n<p><strong>Source Cassandra cluster details:<\/strong><\/p>\n<p><em>&nbsp; &nbsp; $ nodetool -u cassandra -pw ******** -h localhost status<\/em><\/p>\n<p>&nbsp; &nbsp; Datacenter: us-central1<br \/>\n&nbsp; &nbsp; =======================<br \/>\n&nbsp; &nbsp; Status=Up\/Down<br \/>\n&nbsp; &nbsp; |\/ State=Normal\/Leaving\/Joining\/Moving<br \/>\n&nbsp; &nbsp; &#8212; &nbsp;Address &nbsp; &nbsp; Load &nbsp; &nbsp; &nbsp; Tokens &nbsp; &nbsp; &nbsp; Owns (effective) &nbsp;Host ID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rack<br \/>\n&nbsp; &nbsp; UN &nbsp;10.128.0.2 &nbsp;121.52 KiB &nbsp;256 &nbsp; &nbsp; &nbsp; &nbsp; 63.3% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5957997f-7471-4c21-bead-37a6604812e2 &nbsp;f<br \/>\n&nbsp; &nbsp; UN &nbsp;10.128.0.3 &nbsp;92.22 KiB &nbsp;256 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;68.0% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 87c2a663-a965-4675-b5ed-c4a46d77c796 &nbsp;f<br \/>\n&nbsp; &nbsp; UN &nbsp;10.128.0.4 &nbsp;225.3 KiB &nbsp;256 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;68.8% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8e12557f-be00-4387-bff3-ef51f431b9a0 &nbsp;f<\/p>\n<p>Use the following command to backup <strong>keyspace<\/strong>:<\/p>\n<p><em>&nbsp; &nbsp; $ nodetool -h localhost -u cassandra -pw ****** snapshot users -t &#8220;users-201904201800&#8221;<\/em><\/p>\n<p><em>&nbsp; &nbsp; Requested creating snapshot(s) for [users] with snapshot name [users-201904201800] and options {skipFlush=false}<br \/>\n&nbsp; &nbsp; Snapshot directory: users-201904201800<\/em><\/p>\n<p>This creates a backup snapshot as shown in the following example:<\/p>\n<p><em>&nbsp; &nbsp; \/bitnami\/cassandra\/data\/data\/users\/employee-c1319df0636211e9a0e3570eb7f8fd5f\/snapshots\/users-201904201800<br \/>\n&nbsp; &nbsp; $ ls -ltr<\/em><br \/>\n&nbsp; &nbsp; total 44<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 16 Apr 20 12:05 md-1-big-Filter.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 56 Apr 20 12:05 md-1-big-Summary.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 32 Apr 20 12:05 md-1-big-Index.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp;134 Apr 20 12:05 md-1-big-Data.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 10 Apr 20 12:05 md-1-big-Digest.crc32<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 43 Apr 20 12:05 md-1-big-CompressionInfo.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra 4683 Apr 20 12:05 md-1-big-Statistics.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 92 Apr 20 12:05 md-1-big-TOC.txt<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; 31 Apr 20 12:05 manifest.json<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp;865 Apr 20 12:05 schema.cql<\/p>\n<p>&nbsp; &nbsp; $ date<br \/>\n&nbsp; &nbsp; Sat Apr 20 12:08:21 UTC 2019<\/p>\n<p>Now, archive the <strong>\/snapshot<\/strong>&nbsp;backup directory files and move the tar&nbsp;file to the <strong>\/bitnami\/Cassandra\/data\/data\/backup<\/strong>&nbsp;directory.<\/p>\n<p>&nbsp;<em> &nbsp; $ tar -cvf users-201904201800.tar<br \/>\n&nbsp; &nbsp; manifest.json<br \/>\n&nbsp; &nbsp; md-1-big-CompressionInfo.db<br \/>\n&nbsp; &nbsp; md-1-big-Data.db<br \/>\n&nbsp; &nbsp; md-1-big-Digest.crc32<br \/>\n&nbsp; &nbsp; md-1-big-Filter.db<br \/>\n&nbsp; &nbsp; md-1-big-Index.db<br \/>\n&nbsp; &nbsp; md-1-big-Statistics.db<br \/>\n&nbsp; &nbsp; md-1-big-Summary.db<br \/>\n&nbsp; &nbsp; md-1-big-TOC.txt<br \/>\n&nbsp; &nbsp; schema.cql<\/em><\/p>\n<p><em>&nbsp; &nbsp; $ ls -ltr<\/em><br \/>\n&nbsp; &nbsp; total 64<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; &nbsp;16 Apr 20 12:05 md-1-big-Filter.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; &nbsp;56 Apr 20 12:05 md-1-big-Summary.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; &nbsp;32 Apr 20 12:05 md-1-big-Index.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; 134 Apr 20 12:05 md-1-big-Data.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; &nbsp;10 Apr 20 12:05 md-1-big-Digest.crc32<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; &nbsp;43 Apr 20 12:05 md-1-big-CompressionInfo.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp;4683 Apr 20 12:05 md-1-big-Statistics.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 2 cassandra cassandra &nbsp; &nbsp;92 Apr 20 12:05 md-1-big-TOC.txt<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;31 Apr 20 12:05 manifest.json<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; 865 Apr 20 12:05 schema.cql<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra 20480 Apr 20 12:22 users-201904201800.tar<\/p>\n<p><em>&nbsp; &nbsp; cp *.tar \/bitnami\/cassandra\/data\/data\/backup.<br \/>\n&nbsp; &nbsp; \/bitnami\/cassandra\/data\/data\/backup<\/em><\/p>\n<p><em>&nbsp; &nbsp; $ ls -ltr<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; &nbsp;1 cassandra cassandra 20480 Apr 20 12:23 users-201904201800.tar<\/em><\/p>\n<p>After copying the backup tar file to a non-default location, drop the <strong>employee<\/strong><br \/>\ntable.<\/p>\n<p><strong>NOTE<\/strong>:&nbsp;Cassandra&nbsp;distributes&nbsp;data&nbsp;based&nbsp;on&nbsp;the defined&nbsp;partition&nbsp;keys&nbsp;and&nbsp;replication actors&nbsp;across&nbsp;the&nbsp;cluster,&nbsp;so&nbsp;you&nbsp;must&nbsp;run&nbsp;this&nbsp;backup&nbsp;command&nbsp;from&nbsp;all&nbsp;your&nbsp;nodes. This&nbsp;example&nbsp;uses&nbsp;the Linux\u00a9 shell&nbsp;script&nbsp;in&nbsp;crontab,&nbsp;which&nbsp;backs up&nbsp;all&nbsp;nodes&nbsp;at&nbsp;once.<\/p>\n<p><em>&nbsp; &nbsp; $ cqlsh -u cassandra -p *******<\/em><\/p>\n<p>&nbsp;<em> &nbsp; Connected to Test_Cassandra at 127.0.0.1:9042.<br \/>\n&nbsp; &nbsp; [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]<br \/>\n&nbsp; &nbsp; Use HELP for help.<\/em><\/p>\n<p><em>&nbsp; &nbsp; cassandra@cqlsh&gt; use users;<br \/>\n&nbsp; &nbsp; cassandra@cqlsh:users&gt; select * from employee;<\/em><\/p>\n<p>&nbsp; &nbsp; &nbsp;emp_id | employee_address | employee_name<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;8796 | &nbsp; &nbsp; &nbsp; &nbsp;Singapore | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Joy<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;5647 | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; London | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Mike<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;3452 | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Canada | &nbsp; &nbsp; &nbsp; &nbsp; Nancy<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;6453 | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;China | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;John<\/p>\n<p>&nbsp; &nbsp; (4 rows)<\/p>\n<p>&nbsp; &nbsp;<em> cassandra@cqlsh:users&gt; drop table employee;<br \/>\n&nbsp; &nbsp; cassandra@cqlsh:users&gt; select * from employee;<br \/>\n&nbsp; &nbsp; InvalidRequest: Error from server: code=2200 [Invalid query] message=&#8221;unconfigured table employee&#8221;<\/em><\/p>\n<p><strong>Restore<\/strong><\/p>\n<p>To restore the <strong>employee<\/strong>&nbsp;table from the <strong>keyspace (users)<\/strong>&nbsp;snapshot backup,,&nbsp;you must use the <em>sstableloader<\/em>&nbsp;utility. The <em>sstableloader<\/em>&nbsp;utility not only&nbsp;copies the set of sstables to each node but also transfers the appropriate&nbsp;part of the data to every node based on the replication strategy defined for&nbsp;a cluster. Note that it is not necessary to have an empty table to restore the<br \/>\ndata.<\/p>\n<p>Use the following steps to restore the tar file into <strong>backup\/users<\/strong>:<\/p>\n<p><em>&nbsp; &nbsp; $ pwd<br \/>\n&nbsp; &nbsp; \/bitnami\/cassandra\/data\/data\/backup\/users<br \/>\n&nbsp; &nbsp; $ ls -ltr<br \/>\n&nbsp; &nbsp; total 20<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra 20480 Apr 20 12:23 users-201904201800.tar<br \/>\n&nbsp; &nbsp; $ tar -xvf *.tar<br \/>\n&nbsp; &nbsp; manifest.json<br \/>\n&nbsp; &nbsp; md-1-big-CompressionInfo.db<br \/>\n&nbsp; &nbsp; md-1-big-Data.db<br \/>\n&nbsp; &nbsp; md-1-big-Digest.crc32<br \/>\n&nbsp; &nbsp; md-1-big-Filter.db<br \/>\n&nbsp; &nbsp; md-1-big-Index.db<br \/>\n&nbsp; &nbsp; md-1-big-Statistics.db<br \/>\n&nbsp; &nbsp; md-1-big-Summary.db<br \/>\n&nbsp; &nbsp; md-1-big-TOC.txt<br \/>\n&nbsp; &nbsp; schema.cql<\/em><\/p>\n<p>Create a soft link for the user directory with the name of the table that you<br \/>\nare going to restore.<\/p>\n<p><em>&nbsp; &nbsp; $ ln -s \/bitnami\/cassandra\/data\/data\/backup\/users employee<br \/>\n&nbsp; &nbsp; $ ls -ltr<br \/>\n&nbsp; &nbsp; total 64<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; 865 Apr 20 12:05 schema.cql<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;92 Apr 20 12:05 md-1-big-TOC.txt<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;56 Apr 20 12:05 md-1-big-Summary.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp;4683 Apr 20 12:05 md-1-big-Statistics.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;32 Apr 20 12:05 md-1-big-Index.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;16 Apr 20 12:05 md-1-big-Filter.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;10 Apr 20 12:05 md-1-big-Digest.crc32<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; 134 Apr 20 12:05 md-1-big-Data.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;43 Apr 20 12:05 md-1-big-CompressionInfo.db<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra &nbsp; &nbsp;31 Apr 20 12:05 manifest.json<br \/>\n&nbsp; &nbsp; -rw-r&#8211;r&#8211; 1 cassandra cassandra 20480 Apr 20 12:23 users-201904201800.tar<br \/>\n&nbsp; &nbsp; lrwxrwxrwx 1 cassandra cassandra &nbsp; &nbsp;41 Apr 20 15:56 employee -&gt; \/bitnami\/cassandra\/data\/data\/backup\/users<\/em><\/p>\n<p>Create the table structure by using the <strong>.cql<\/strong>&nbsp;file that was generated by the&nbsp;snapshot backup.<\/p>\n<p>When you execute the backup for **keyspace**, it generates a file called&nbsp;<strong>schema.cql<\/strong>&nbsp;that contains the data definition language (DDL) of&nbsp;the objects that reside in <strong>keyspace<\/strong>.<\/p>\n<p>Use <strong>schema.cql<\/strong>&nbsp;to create an employee object, which got dropped by mistake.<\/p>\n<p><em>&nbsp; &nbsp; $ cqlsh -u cassandra -p ******** -f schema.cql<\/em><\/p>\n<p>&nbsp; &nbsp; Warnings:<br \/>\n&nbsp; &nbsp;<em> dclocal_read_repair_chance table option has been deprecated and will be removed in version 4.0<\/em><\/p>\n<p><em>&nbsp; &nbsp; dclocal_read_repair_chance table option has been deprecated and will be removed in version 4.0<\/em><br \/>\n<em>&nbsp; &nbsp; $ cqlsh -u cassandra -p ******* -f schema.cql<\/em><\/p>\n<p>Restore data from the snapshot by using <em>sstableloader<\/em>, which reads every&nbsp;<strong>sstables<\/strong>&nbsp;from the backup and streams the data into the cluster. It then&nbsp;transfers the relevant part of data to each node based on the replication strategy&nbsp;defined in the cluster.<\/p>\n<p>&nbsp; &nbsp; Syntax: <em>sstableloader -u &lt;username&gt; -pw passwrod -d &lt;hostname&gt; &lt;employee table softlink name with location&gt;<\/em><\/p>\n<p><strong>Use the following command to restore the data:<\/strong><\/p>\n<p><em>&nbsp; $ &nbsp;sstableloader -u cassandra -pw &nbsp;******** -d cassandra-cluster-1-node-0 \/bitnami\/cassandra\/data\/data\/backup\/users\/employee<br \/>\n&nbsp; &nbsp; Established connection to initial hosts<br \/>\n&nbsp; &nbsp; Opening sstables and calculating sections to stream<br \/>\n&nbsp; &nbsp; Streaming relevant part of \/bitnami\/cassandra\/data\/data\/backup\/users\/md-1-big-Data.db &nbsp;to [\/10.128.0.2, \/10.128.0.3, \/10.128.0.4]<br \/>\n&nbsp; &nbsp; progress: [\/10.128.0.2]0:0\/1 0 &nbsp;% [\/10.128.0.3]0:0\/1 0 &nbsp;% [\/10.128.0.4]0:1\/1 100% total: 33% 0.032KiB\/s (avg: 0.032KiB\/s)<br \/>\n&nbsp; &nbsp; progress: [\/10.128.0.2]0:0\/1 0 &nbsp;% [\/10.128.0.3]0:0\/1 0 &nbsp;% [\/10.128.0.4]0:1\/1 100% total: 33% 0.000KiB\/s (avg: 0.031KiB\/s)<br \/>\n&nbsp; &nbsp; progress: [\/10.128.0.2]0:0\/1 0 &nbsp;% [\/10.128.0.3]0:1\/1 100% [\/10.128.0.4]0:1\/1 100% total: 66% 0.113KiB\/s (avg: 0.050KiB\/s)<br \/>\n&nbsp; &nbsp; progress: [\/10.128.0.2]0:1\/1 100% [\/10.128.0.3]0:1\/1 100% [\/10.128.0.4]0:1\/1 100% total: 100% 85.129KiB\/s (avg: 0.074KiB\/s)<br \/>\n&nbsp; &nbsp; progress: [\/10.128.0.2]0:1\/1 100% [\/10.128.0.3]0:1\/1 100% [\/10.128.0.4]0:1\/1 100% total: 100% 0.000KiB\/s (avg: 0.073KiB\/s)<br \/>\n&nbsp; &nbsp; progress: [\/10.128.0.2]0:1\/1 100% [\/10.128.0.3]0:1\/1 100% [\/10.128.0.4]0:1\/1 100% total: 100% 0.000KiB\/s (avg: 0.073KiB\/s)<\/em><\/p>\n<p>&nbsp; &nbsp; Summary statistics:<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;Connections per host &nbsp; &nbsp;: 1<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;Total files transferred : 3<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;Total bytes transferred : 0.393KiB<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;Total duration &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: 5346 ms<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;Average transfer rate &nbsp; : 0.073KiB\/s<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;Peak transfer rate &nbsp; &nbsp; &nbsp;: 0.074KiB\/s<\/p>\n<p>Repeat these steps for every node to retrieve the data from their <em>sstables.<\/em><\/p>\n<p>Repair the data by using <em>`nodetool repair<\/em>`, which compares all replicas of the&nbsp;data stored on the node on which the command runs and updates each replica to&nbsp;the newest version.<\/p>\n<p><em>&nbsp; &nbsp; $ nodetool repair -u Cassandra -pw ********<\/em><\/p>\n<p><em>&nbsp; &nbsp; [2019-04-21 07:59:14,701] Starting repair command #1 (5b123ad0-640b-11e9-a0e3-570eb7f8fd5f), repairing keyspace users with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], # of ranges: 768, pull repair: false)<br \/>\n&nbsp; &nbsp; [2019-04-21 07:59:16,450] Repair completed successfully<br \/>\n&nbsp; &nbsp; [2019-04-21 07:59:16,451] Repair command #1 finished in 1 second<br \/>\n&nbsp; &nbsp; [2019-04-21 07:59:16,460] Replication factor is 1. No repair is needed for keyspace &#8216;system_auth&#8217;<br \/>\n&nbsp; &nbsp; [2019-04-21 07:59:16,474] Starting repair command #2 (5c22e780-640b-11e9-a0e3-570eb7f8fd5f), repairing keyspace system_traces with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], # of ranges: 513, pull repair: false)<br \/>\n&nbsp; &nbsp; finished (progress: 1%)<br \/>\n&nbsp; &nbsp; [2019-04-21 07:59:17,653] Repair completed successfully<br \/>\n&nbsp; &nbsp; [2019-04-21 07:59:17,653] Repair command #2 finished in 1 second<\/em><\/p>\n<p>Validate data into the <strong>employee<\/strong>&nbsp;table, which we dropped. The previous command&nbsp;restored the data from the backup you took previously. Now you need to validate&nbsp;the data to see if it was restored properly.<\/p>\n<p><em>&nbsp; &nbsp; $ cqlsh -u cassandra -p ********<\/em><\/p>\n<p><em>&nbsp;Connected to Test_Cassandra at 127.0.0.1:9042.<br \/>\n&nbsp; &nbsp; [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]<br \/>\n&nbsp; &nbsp; Use HELP for help.<\/em><\/p>\n<p><em>&nbsp; &nbsp; cassandra@cqlsh&gt; use users;<\/em><\/p>\n<p><em>&nbsp; &nbsp; cassandra@cqlsh:users&gt; select * from employee;<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp;emp_id | employee_address | employee_name<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;8796 | &nbsp; &nbsp; &nbsp; &nbsp;Singapore | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Joy<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;5647 | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; London | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Mike<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;3452 | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Canada | &nbsp; &nbsp; &nbsp; &nbsp; Nancy<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;6453 | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;China | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;John<\/em><\/p>\n<p><em>&nbsp; &nbsp; (4 rows)<\/em><br \/>\n&nbsp;<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>In this post, you learned how to backup and restore a table into a Cassandra&nbsp;database. However, if you need to restore a full keyspace\/database, use the&nbsp;preceding steps without the table restore part. You must recreate the&nbsp;<strong>keyspace<\/strong>&nbsp;and load data by using `<em>sstableloader<\/em>`.<\/p>\n<p>The number of nodes in the source and target databases cluster doesn\u2019t matter&nbsp;with `<em>sstableloader<\/em>` because it reads each <strong>sstables<\/strong>&nbsp;from the backup.&nbsp;Then, it streams the data into the cluster while placing the data according to&nbsp;the defined replication strategy in the cluster.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Cassandra backup and recovery<\/p>\n","protected":false},"author":2,"featured_media":8151,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26609","content_type":"blog","created_by":"10130","authored_on":"2024-02-13T17:34:26+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Rackspace Technology Staff","seo_description":"Backup and recover Apache Cassandra databases. Mitigate data loss risks and ensure smooth business operations.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26609-insights_image-database-technical-blog-2-insights.jpg","field_partners":"","rxt_platforms":"Big Data, Relational Databases","product":"","publisheddate":"2019-07-17T16:34:27","rxt_solutions":"Cloud, Data, Databases, Next-Gen Data Platforms","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Apache Cassandra: Backup and Recovery Strategies | Rackspace Technology","field_topics":"","field_slug":"apache-casandra-backup-and-recovery","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-8149","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/comments?post=8149"}],"version-history":[{"count":3,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8149\/revisions"}],"predecessor-version":[{"id":9914,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8149\/revisions\/9914"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media\/8151"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media?parent=8149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/categories?post=8149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/tags?post=8149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}