2

I'm in the midst of replacing a kubernetes stack (to more specific: moving it from a locally hosted cluster to an AKS cluster in Azure), and as a result have to re-create all of my services, including a Cassandra service. All of the data that is contained in the existing Cassandra has to be copied into a new one. However, I'm having a great deal of trouble finding a way to actually do this. With SQL databases it's trivial; with postgres for example you can just use pg_dump on the old database and just echo out the file into the new db.

However there seems to be no equivalent method for Cassandra and googling hasn't really given me a solution. It seems COPY FROM and COPY TO would require manually copying every single table which is ridiculous. Also should be noted that if possible, I really want a solution that does not require directly accessing the docker containers (ie. some solution that I can run from a remote box that has a connection to both cassandra's), because getting direct container level access in AKS can be a huge PITA.

1 Answer 1

3

This is how I did by moving data from one VM to another in azure. Didn't test this in kubernates.

Ex:- Below is process to migration 4 node old cluster to 4 node new cluster.

OLD CLUSTER (node A) => NEW CLUSTER (node A), OLD CLUSTER (node B) => NEW CLUSTER (node B), OLD CLUSTER (node C) => NEW CLUSTER (node C), OLD CLUSTER (node D) => NEW CLUSTER (node D),

  1. On old cluster, enable incremental backups on each node.
  2. On old cluster, take snapshots on each node.
  3. On old cluster, take backup of schema.
  4. On old cluster, take backup of tokens (tokens of each node).
  5. Push snapshots and incrementals to azure blob (az copy).
  6. On new cluster, import schema.
  7. On new cluster, import tokens (like OLD CLUSTER (node A) => NEW CLUSTER (node A)).
  8. On new cluster, import snapshots (like OLD CLUSTER (node A) => NEW CLUSTER (node A)). Copy files direct to table folder.
  9. On new cluster, import incrementals. Copy files direct to table folder.
  10. On new cluster, do rolling restart of nodes.

Cassandra version should be same on old and new cluster. You can automate this using scripts.

1
  • whew, that's a lot.. really think mysql/postgresql really has cassandra beat hard on this one. Thanks, it worked Commented May 2, 2019 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.