Cassandra Backup&restore
Cassandra Backup&restore
STEP 1: Launch the Cassandra shell, create a keyspace, table, and insert the
data.
Step 5: Create a Data backup using snapshot command and check this directory;
now backup files are available.
nodetool snapshot insta
Step 6: Check the snapshots, using this command.
nodetool listsnapshots
Step 9: Change schema directory, else you will get permission error.
cp schema_insta.cql /tmp/
Step 10: Get backup form the source file, using command.
source ‘/tmp/schema_insta.cql’;
describe keyspace;
use insta:
describe table;
Step 11: Now check this directory, two folders are available, one folder is
previous backup folder, another one is new keyspace folder this folder is empty
folder.
cp /var/lib/cassandra/data/insta/stock-
6b8ec1b0070911eba29abf08e5a68515/snapshots/1601902597924/*.*
/var/lib/cassandra/data/insta/stock-79df8ae0070b11eba29abf08e5a68515/
Step 13: Check the directory, files will available there.
Step: 14: Now launch the cqlsh shell, then check the data., still data not updated
cqlsh
use insta;
select * from stock;