Reputation: 11
I am new to cassandra and would like some help on restoring snapshots from 3 node Cassandra cluster to a new 6 node cluster. We have few keyspaces and would like to copy data from dev to production.
Thanks in advance.
Upvotes: 1
Views: 1639
Reputation: 611
The easiest way is to use the sstableloader tool that is bundled with Cassandra. You can find it in %installdir%/bin/sstableloader
.
You will first need to re-create the schema on your new cluster:
cqlsh -e 'DESC KEYSPACE mykeyspace;' > mykeyspace.cql
cqlsh -f mykeyspace.cql
. ALTER KEYSPACE mykeyspace WITH REPLICATION = ...;
)Once that's done, you can start bulk-loading the SSTables from your keyspace snapshots into the new cluster:
sstableloader --nodes 10.0.0.1,10.0.0.2 -f /etc/cassandra/cassandra.yaml /path/to/mykeyspace/snapshot/
Note that this might take a while if you have a lot of data to load. You should also run a full repair on the new cluster afterwards to ensure that the replicas are properly distributed.
Upvotes: 5