简体   繁体   中英

Restore Cassandra backup to new node

I have a 4 node Cassandra cluster in Dev environment on AWS EC2, for some reason, all of the nodes terminated, so I have brought up new EC2 instances with new IP address and machine name.

My question is can I restore the snapshot backup to the new nodes which have the new IP address? Does Cassandra require to have the same machine name and IP address to properly restore the backup? In other words, can I restore the backup to a node that has different IP and machine name?

Alex is partly right, in that the cluster sizes (number of nodes) need to match. The other part with this, is that a backup/snapshot is only good on a node which has matching token ranges from the original node that it was taken on.

If RF < number of nodes, then each backup will not contain all of the data. As such, you need to make sure that the correct backups end up on the correct nodes. If you copy/restore data to a node which is not responsible for it (from a token range perspective), it will not be accessible.

If you wanted to be sure, you could copy all data to every node, restore, and then run a nodetool cleanup afterward. That will work, assuming that each node's disk has enough space for it.

If you didn't lost EBS volumes with data, then just mount them to the new machines - you need to have the same number of the nodes. In this case, you'll get the working cluster in the previous state, because Cassandra nodes are identified by UUID created when node is joining cluster, so after that you can change IP addresses, machine names, etc. without problems.

If you lost the disks with data, then you can restore backup to new machines, but it will be longer. The method of restoring backup depends on how you did the backup & how the new nodes are setup. But sstableloader should work in all situations. And you don't need to have the same IPs as before.

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