1
votes

I need to export Cassandra schema and data to a file in order to quickly setup identical cluster when needed.

Identical likely means the same topology, same number of nodes and replication factor.

In case of NetworkTopologyStrategy simple file backup/sstable snapshot is not helpful cause peer IPs are recorded with other data. After restore on another node it tries to reach source cluster seeds.

I was surprised there is almost no ready solution for such task.

Suppose i have to use DESC SCHEMA; then parse output for all the tables, backup them with COPY keyspace.table TO /backup/keyspace.table.csv; and later use sstableloader to restore on other node.

Any better solutions?

1
Actually cause ruby-cassandra-driver doesn't support DESC and COPY I decided to make shellouts to cqlsh. the instruction from answer below looks too complex for my case. - Igor A

1 Answers

0
votes

You can use the solution you've specified.

Or you can use snapshots option (looks easier for me). Here's a docs describing how to copy snapshots between clusters:

http://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_snapshot_restore_new_cluster.html