Search code examples
databasecassandrareplication

Disconnect nodes in Cassandra


I'm exploring Cassandra and its' replication system. For that I created 3 nodes locally and test different scenarios. I want to pause communication between nodes, write different values with the same key and then observe what they will decide.

So the question is: how to restrict nodes to exchange information in a local cluster?

I searched how to do that and failed to find any info on the topic other than to set timeouts and cluster throughput, but then I wouldn't be able to write to the nodes. Datacenters don't matter in this case.

Would be grateful for any help.


Solution

  • Welcome to the Cassandra community.

    The topics that you want to revise for those experiments are "replication factor" (how many copies are you going to keep), as well as consistency level. As there is always a trade-off between consistency and resiliency. Datastax has a lot of documentation regarding these topics.

    Regarding how to stop the communication between nodes, nodetool disablegossip will mark the node down and prevent sync operations between the nodes; note that you may also need to execute nodetool disablehandoff, as hand-off operations don't require gossip.