1

I am using Cassandra 1.2 db on windows 7.

I want to take the back up of a keyspace.

I am doing as following:

C:\Workspace\apache-cassandra-1.2.4-bin\bin> nodetool -h localhost -p 7199 snaps
hot myDb
Starting NodeTool
Requested snapshot for: myDb
Snapshot directory: 1371534210892

C:\Workspace\apache-cassandra-1.2.4-bin\bin>

So it shows snapshot directory as 1371534210892 . What does it mean?

Where can I find the snapshot just created ?

Ryan Malhotra
  • 305
  • 2
  • 4
  • 13

2 Answers2

2

TL;DR;
Check C:\var\lib\cassandra\data\system\myDb\snapshots\1371534210892


Before I provide details its important that you know my environment so you can compare.

How I setup Cassandra
I downloaded the zip from Apache's website then I unzipped it to C:\apache-cassandra-1.2.5 and finally I added the CASSANDRA_HOME environment variable.

How I start / backup Cassandra
I start cassandra by running startup.bat in the bin folder:

C:\apache-cassandra-1.2.4\bin\cassandra.bat

I backup cassandra by running the same command that you did (I backed up system because it was a fresh cassandra install):

nodetool -h localhost snapshot system
# output:
Starting NodeTool
Requested snapshot for: system
Snapshot directory: 1371547087563

I then browsed to the following directory where I found the 1371547087563 folder:

C:\var\lib\cassandra\data\system\local\snapshots

The snapshot is also created for every other keyspace so with a clean install I could find it in:

C:\var\lib\cassandra\data\system\schema_columns\snapshots
C:\var\lib\cassandra\data\system\schema_columnfamilies\snapshots
C:\var\lib\cassandra\data\system\schema_keyspaces

So basically it backups up the 4 internal keyspaces (system, schema_columns, schema_columnfamilies, schema_keyspaces) and the keyspace that you provide on the end as a parameter to the nodetool command, but because I specified system as the param, the command created snapshots of the 4 internal keyspaces only.

In your case the fifth keyspace would be the one you are after.

Lyuben Todorov
  • 13,987
  • 5
  • 50
  • 69
0

find 1371534210892 folder inside cassandra/data/yourkeyspacename (equivalent to folder/var/lib/data/yourkeyspacename in LINUX) here each CF have 1371534210892 folder under snapshot directory which is latest one,

This base cassandra folder is the one which you generated during installation not the one having bin and all directories

Hardik Bhalani
  • 863
  • 2
  • 8
  • 24
  • Hi Hardik. I couldnt find any such folder. Moreover, I am using cassandra without installing anything ie directly using the files in bin folder. I dont know what do I need to install ? – Ryan Malhotra Jun 18 '13 at 06:28
  • somewhere in your C drive folder named cassandra is generated...simply search 1371534210892 folder...it must be found – Hardik Bhalani Jun 18 '13 at 06:30
  • No the only cassandra folder in my C dir is the one containing bin and all which I have manually put in. Also I have not installed datastax or anything. Is it required? – Ryan Malhotra Jun 18 '13 at 06:34
  • yes,it is. Do one thing..check your cassanra.yaml file,in that see property data_file_directories , and tell me which path is there.? Is it exist in your system..if not than create that directories manually – Hardik Bhalani Jun 18 '13 at 06:36
  • http://www.datastax.com/docs/0.7/getting_started/installing in this read this section for more information : Data and Log Directories – Hardik Bhalani Jun 18 '13 at 06:38
  • The data_file_directories path is /var/lib/cassandra/data – Ryan Malhotra Jun 18 '13 at 07:09
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/31917/discussion-between-hardik-bhalani-and-ryan-malhotra) – Hardik Bhalani Jun 18 '13 at 07:09
  • @HardikBhalani the link you provided is for 0.7, this is very outdated. Here is the [install guide](http://www.datastax.com/docs/1.2/install/index) for 1.2 – Lyuben Todorov Jun 18 '13 at 09:04
  • @Lyuben Todorov yes you are absolutly right...but its just to show that how to create Data and Log Directories ,thats same I think for all the versions... – Hardik Bhalani Jun 18 '13 at 09:10