Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export data from Cassandra cluster and import in another

Tags:

cassandra

I want to export all data from a keyspace in a cassandra cluster and import it into another cluster, that has the same schema but the keyspace is differently named.

I've looked into the sstable2json /json2sstable utility. However, I don't want to go to each node and deal with each individual sstable.

like image 798
Irfan Avatar asked Oct 04 '11 15:10

Irfan


2 Answers

Simpler: take a snapshot on each node, then use the bulk loader to stream them into the new cluster.

like image 53
jbellis Avatar answered Nov 08 '22 19:11

jbellis


If you don't want to export the data node by node, then you probably need to use the normal Thrift client interface to systematically read chunks of data from the source cluster and write them to the destination, working through all columnfamilies and their rows. This may be relatively slow though.

like image 41
DNA Avatar answered Nov 08 '22 19:11

DNA