3

Currently running a 3 node cluster with replication factor 3 on the keyspaces. Need to add more nodes to the cluster as the size of each node is approaching 2TB. Can I add just 1 more node to the cluster and have a 4 node cluster or does the cluster always need to have odd number of nodes? Using a consistency level of ONE currently for both read and write.

2 Answers 2

8

You can have as many nodes in the cluster as you want, particularly if you are not using the racks feature in Cassandra (all nodes are in the same logical C* rack).

If you are using C* racks, our recommendation is to have an equal number of nodes in each rack so the load distribution is balanced across the racks in each DC.

For example, if your app keyspaces have a replication factor of 3 and you have 3 racks then the number of nodes in the DC should be in multiples of the replication factor -- 3, 6, 9, 12 and so on. This would allow you to configure the same number of nodes in each rack.

This isn't a hard requirement but is best practice so nodes have an equal amount of load and data on them. Cheers!

4
  • 1
    Totally agree. You'll get the best data distribution by going with a number of nodes that are a factor of your RF.
    – Aaron
    Commented Jul 21, 2021 at 13:51
  • Thanks for your responses Commented Jul 21, 2021 at 19:28
  • So I could have any number of cassandra nodes if I am using a single rack with replication factor of 3? Commented Nov 6, 2023 at 11:55
  • 1
    Yes, @Cppcrusaders. 👍 Commented Jan 23 at 6:20
4

You can have even number of nodes in a Cassandra cluster. So you can add another node to the cluster. If you are using vnodes, then it will be easier, otherwise a lot of work needs to be done to balance the cluster. One more thing, reading and writing with consistency level ONE decreases the consistency. If it suits your usecase then it is fine but general recommendation is to use QUORUM on the production system.

3
  • 2
    The argument I'd counter with here, is that Cassandra is an AP eventually-consistent database, and utilizing lower consistency works with that intended design. I actually recommend dev teams start with (LOCAL) ONE, and go to (LOCAL) QUORUM only if they notice consistency issues.
    – Aaron
    Commented Jul 21, 2021 at 13:54
  • Sure noted Aaron. Thanks for updating. Commented Jul 21, 2021 at 14:02
  • Thanks for your responses Manish and Aaron Commented Jul 21, 2021 at 19:25

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.