Modifying the replication factor 

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

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

When you change the replication factor of a keyspace, you affect each node that the keyspaces replicates to (or no longer replicates to). Follow this procedure to prepare all affected nodes for this change.

Note: You cannot insert data into a table in a keyspace that uses NetworkTopologyStrategy unless you define the datacenter names in the snitch properties file or you use a single datacenter named datacenter1.

Procedure

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

    Or if using SimpleStrategy:

    ALTER KEYSPACE keyspace_name 
    WITH REPLICATION =  { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
  2. Run a full repair of the keyspace when adding datacenters. .
    nodetool repair --full keyspace_name