I'm having a hard time restoring snapshot on Apache Cassandra (version 3.0.9). As far as I can say, I'm following the procedure described on datastax blog, along with several other ones (for instance : http://datascale.io/cloning-cassandra-clusters-fast-way/). Yet I may be missing something, and everytime I make a restore, data is missing.
Setup : 6 nodes cluster (1 DC, 3 racks with 2 nodes each) with a replication factor set to 3. Machines are hosted on AWS.
Backup procedure (on each node) :
nodetool snapshot mykeyspace
cqlsh -e 'DESCRIBE KEYSPACE mykeyspace' > /tmp/mykeyspace.cql
nodetool ring | grep "$(ifconfig | awk '/inet /{print $2}' | head -1)" | awk '{print $NF ","}' | xargs > /tmp/tokens
I get the files generated by the nodetool snapshot command and backup them along with tokens and cql on S3.
Restore procedure (for each node unless it's specified) :
(after having created new VMs)
- Download snapshots, tokens and keyspace
- Stop service cassandra
- Delete
/var/lib/cassandra/commitlog/*
and/var/lib/cassandra/system/
- Insert tokens into
cassandra.yaml
- Start service cassandra
- Restore mykeyspace from
mykeyspace.cql
on one node only - Wait for replication and stop service cassandra
- Delete
.db
files in folder/var/lib/cassandra/data/mykeyspace/
- For each table copy snapshots files (
.db
,.crc32
,.txt
) into/var/lib/cassandra/data/mykeyspace/$table/
- Restart service cassandra
- Run
nodetool repair mykeyspace -full
, one node at a time
Result :
There are always missing rows, approximately the same quantity for each table but never the same ones. I tried to "mix up" a bit the procedure, like restoring keyspace before tokens, running nodetool refresh
before repair, but I meet the same issue everytime.
Since I'm not far from having a "good" restore, I think that I'm missing something pretty obvious. Analyzing logs didn't really help, as they don't show any error/failure messages.
Any help would be welcomed :) I can of course give more information if needed.
edit : no one ? I updated the question with cassandra version (3.0.9), which I forgot in the first place. I tried again to restore, but no luck. I don't have any more idea really :(