Hi Dojo,
Following up on a recent issue where we could not log in to some nodes in a Cassandra cluster because the keyspace system_auth had its replication factor set to 1.
- Is it a general rule that the replication factor for system_auth has to be equal to the number of nodes to allow logging in to any node?
- If we expand our cluster, do we need to change the replication factor each time?
Thanks!
The Cassandra docs provide a pretty good answer to this.
The replication factor does not need to be equal to the number of nodes. it just needs to guarantee availability. Replication factor of 3-5 per DataCenter is recommended once your cluster goes past that number of nodes.
However if your cluster is <=3 then I would recommend to set the RF equal to the number of nodes.
Keeping the RF equal to the number of nodes is not catastrophic, but it will cause some overhead to keep everything in sync.
I found this StackExchange post:
https://stackoverflow.com/questions/25891353/replication-factor-to-use-for-system-auth
where a user says in 2014:
“Setting the replication factor of system_auth to the number of nodes in the cluster should be ok”;
and in 2018:
“Due to issues that can happen with larger clusters which fluctuate in size, we now treat system_auth like we do any other keyspace. That is, we set system_auth’s RF to 3 in each DC”.