0

I am new to cassandra, but i want to resotore cassandra back up.

While restoring cassandra does not load data which is not yet commited to mem table and available in the Commitlog. as i know it has benchmark based on that it will commit the data in data base but while restoration it shoul load all the logs and data.

please help

i copy all the cassandra data files in to my new cassandra installation folder. and try to restore restore the backup.

befor that i have create new cassandra server, created Keyspace and tables on new server.

then i copyied all data files in the respected tables folder.

then restarted the cassandra. and run cassandra nodetool refresh commmand.

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
montu
  • 1
  • Welcome to Stack Overflow! A friendly reminder that this site is for getting help with coding, algorithm, or programming language problems so I voted to have your post moved to [DBA Stack Exchange](https://dba.stackexchange.com/questions/ask?tags=cassandra). For future reference, you should post DB admin/ops questions on https://dba.stackexchange.com/questions/ask?tags=cassandra. Cheers! – Erick Ramirez Jul 17 '23 at 23:47

1 Answers1

1

You cannot just copy the commit logs from one node to another, even if it is on the same server with a fresh installation because it is technically a different node (a new host ID is allocated on new installations).

In Cassandra, you cannot simply copy files from one node to another to restore the data. You need to take a snapshot of the data which is the equivalent of a cold backup in traditional RDBMS but doesn't require downtime.

If you're interested, I've explained the procedure in https://dba.stackexchange.com/questions/316520/.

Since you're new to Cassandra, I would recommend watching this short video on the basics of Cassandra backups and how snapshots work. If you want to learn more about Cassandra, we have several courses at DataStax Academy and they're all FREE. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • You may be right but my original server was crash and i have backup of data folder, when i can see when i load the data file does not hold the information of the last one week data befor snapshot was taken, as i understood cassandra hold the data in commitlog and on some interval it will commit in actual tables. so what is the procedure to retrive the data of last 1 week – montu Jul 18 '23 at 05:57
  • Commitlogs will not just replay like that. You'll have to use something like commitlog archiving to restore those files: https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/configuration/configLogArchive.html You can see if you can get the commitlogs to playback with something like: restore_command=/bin/cp -f %from %to restore_directories=/cassandra_path/archived_commit restore_point_in_time=2017:07:25 12:40:00 precision=MILLISECONDS Never done it though, so not sure that will work. – stevenlacerda Jul 18 '23 at 14:04