简体   繁体   中英

Cassandra Copy KeySpace - How To?

We are migrating to Cassandra from legacy DB.

In legacy DB, whenever new project or analysis starts we clone existing DB and create a new one for the project/analysis.

We wanted to do same with Cassandra also. The Cassandra article suggests to copy the keyspaces as the best solution for this.

What is the best way to copy keyspace?

We also prefer copy keyspace is to avoid "unloading" from old keyspace and "loading" into new keyspace as we are in the process of wiki-ing the process and we are going to hit millions of records in the keyspaces in near future.

Currently, the steps we did are as follows:

  1. Create SNAPSHOT of the keyspace
  2. Create new KeySpace (${NEW_KEYSPACE}) and the tables
  3. Copy the SNAPSHOT/*.db files to corresponding tables folder in $CASSANDRA_HOME/data/data/${NEW_KEYSPACE}
  4. Repair the KeySpace
  5. Refresh the KeySpace and the tables

Let us know, is this the correct way or do we have better ways of doing it.

As Simon Fontana Oscarsson mentioned, the only change in the process steps is "refresh the keyspace" and then "repair".

So the overall steps we did are:

  1. Create SNAPSHOT of the keyspace
  2. Create new KeySpace (${NEW_KEYSPACE}) and the tables
  3. Copy the SNAPSHOT/*.db files to corresponding tables folder in $CASSANDRA_HOME/data/data/${NEW_KEYSPACE}
  4. Refresh the KeySpace and the tables
  5. Repair the KeySpace

Thank you all for the feedback.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM