Switching snitches
Steps for switching snitches.
Because snitches determine how Cassandra distributes replicas, the procedure to switch snitches depends on whether or not the topology of the cluster will change:
- If data has not been inserted into the cluster, there is no change in the network topology. This means that you only need to set the snitch; no other steps are necessary.
- If data has been inserted into the cluster, it's possible that the topology has changed and you will need to perform additional steps.
- If data has been inserted into the cluster that must be kept, change the snitch without changing the topology. Then add a new datacenter with new nodes and racks as desired. Finally, remove nodes from the old datacenters and racks. Simply altering the snitch and replication to move some nodes to a new datacenter will result in data being replicated incorrectly.
A change in topology means that there is a change in the datacenters and/or racks where the nodes are placed. Topology changes may occur when the replicas are placed in different places by the new snitch. Specifically, the replication strategy places the replicas based on the information provided by the new snitch. The following examples demonstrate the differences:
No topology change
Change from: five nodes using the RackInferringSnitch in a single datacenter
To: five nodes in one datacenter and 1 rack using a network snitch such as the GossipingPropertyFileSnitch
- Topology changes
-
Change from: 5 nodes using the RackInferringSnitch in a single datacenter
To: 5 nodes in 2 datacenters using the PropertyFileSnitch (add a datacenter).Note: If "splitting" one datacenter into two, create a new datacenter with new nodes. Alter the keyspace replication settings for the keyspace that originally existed to reflect that two datacenters now exist. Once data is replicated to the new datacenter, remove the number of nodes from the original datacenter that have "moved" to the new datacenter. -
Change From: 5 nodes using the PropertyFileSnitch in a single datacenter
To: 5 nodes in 1 datacenter and 2 racks using the RackInferringSnitch (add rack information).
-
Procedure
Steps for switching snitches: