When Dataminer creates new keyspaces in Cassandra it does set the RF for each datacenter to 3. Ie something like this:
CREATE KEYSPACE sldmsdb_state_changes WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter-A': '3', 'datacenter-B': '3'} AND durable_writes = true;
How can I change this default behavior?
Hi Jan-Terje,
You can also check the current replication factors with:
SELECT keyspace_name, replication
FROM system_schema.keyspaces;
A replication factor can then be changed using the ALTER KEYSPACE command, for example:
ALTER KEYSPACE SLDMADB
WITH replication = {
'class': 'NetworkTopologyStrategy',
'datacenter-A': 3,
'datacenter-B': 3
};
After making this change, please do not forget to run nodetool repair to ensure that replicas are properly populated. Also, be careful to set the replication factors appropriately based on the number of nodes and data centers.
Hope this helps!