Database Reference
In-Depth Information
The replication factor
Occasionally, there are instances when we come across situations where we make changes
to the replication factor. For example, I started with a smaller cluster so I kept my replica-
tion factor as 2. Later, I scaled out from 4 nodes to 8 nodes, and thus to make my entire
setup more fail-safe, I increased my replication factor to 4. In such situations, the following
steps are to be followed:
1. The following is the command to update the replication factor and/or change the
strategy. Execute these commands on the Cassandra CLI:
ALTER KEYSPACEmy_keyspace WITH REPLICATION = { 'class'
: 'SimpleStrategy', 'replication_factor' : 4 };
2. Once the command has been updated, you have to execute the nodetool repair
on each of the nodes one by one (in succession) so that all the keys are correctly
replicated as per the new replication values:
sudo -bE ./nodetool -h 10.3.12.29 repair
my_keyspacemycf -pr
6
mydomain@my-cass3:/home/ubuntu$ sudo -E /usr/local/
cassandra/apache-cassandra-1.1.6/bin/nodetool -h
10.3.21.29 compactionstats
pending tasks: 1
compaction type keyspace column family bytes
compacted bytes total progress
Validation my_keyspacemycf 1826902206
761009279707 0.24%
Active compaction remaining time : n/a
mydomain@my-cass3:/home/ubuntu$
The following compactionstats command is used to track the progress of the node-
tool repair command.
Search WWH ::




Custom Search