Updating the replication factor

Increasing the replication factor increases the total number of copies of keyspace data stored in a Cassandra cluster.

Increasing the replication factor increases the total number of copies of keyspace data stored in a Cassandra cluster. It is particularly important to increase the replication factor of the system_auth keyspace if you are using security features because if you use the default, 1, and the node with the lone replica goes down, you will not be able to log into the cluster because the system_auth keyspace was not replicated.

Procedure

  1. Update a keyspace in the cluster and change its replication strategy options.
    ALTER KEYSPACE system_auth WITH REPLICATION =
      {'class' : 'NetworkTopologyStrategy', 'dc1' : 3, 'dc2' : 2};

    Or, change the replication strategy from NetworkTopologyStrategy to SimpleStrategy:

    ALTER KEYSPACE eval_keyspace WITH REPLICATION =
      { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
  2. On each affected node, run nodetool repair.
  3. Wait until repair completes on a node, then move to the next node.