user9420624
user9420624

Reputation: 11

Restore snapshots from 3 node Cassandra cluster to a new 6 node cluster

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

Answers (1)

Justin Cameron
Justin Cameron

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:

  1. dump the schema for the keyspace you want to transfer from your original cluster using cqlsh -e 'DESC KEYSPACE mykeyspace;' > mykeyspace.cql
  2. load it into your new cluster using cqlsh -f mykeyspace.cql.
  3. (optional) If you new cluster will have a different replication configuration you'll need to modify it manually after loading the schema. (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

Related Questions