Reputation: 21
As per the datastrax documentation (Latest version) for nodetool repair
All nodetool repair command options are optional. When optional command arguments are not specified, the defaults are:
But as per to online course on https://academy.datastax.com , in that they mentioned as we need to run nodetool repair command individually on each node.
Below is the link of video : Go To 3:44
I am getting confused weather "nodetool repair" command repairs all nodes in a cluster or repair only single node on which command is executed ?
Upvotes: 2
Views: 1124
Reputation: 163
Lets say we have a three node cluster, replication factor 2, and replication strategy is SimpleStrategy. Node1 will have Node1's data as well as Node2's replica. Node2 will have Node2's data as well as Node3's replica. Node3 will have Node3's data as well as Node1's replica.
Now if you run nodetool repair on Node1. Since the default is full repair. The following data is repaired:
1) Node1's data in Node1
2) Node1's replica in Node3
3) Node2's replica in Node1
4) Node2's data in Node2
In this case Node3's data or replica is not repaired. So nodetool repair should be run on Node3 for entire cluster to be repaired.
In the video from 3:44 he talks about --partitioner-range which means only primary partition is repaired. So in the above cluster if you run nodetool repair --partitioner-range on Node1 then
1) Node1's data in Node1
2) Node1's replica in Node3
In this case nodetool repair --partitioner-range should be run on all then nodes.
Upvotes: 1
Reputation: 46
The nodetool repair command can be run on a particular node or on all nodes in a cluster if a node is not specified irrespective of Data Center.
http://cassandra.apache.org/doc/latest/operating/repair.html
https://docs.datastax.com/en/archived/cassandra/2.2/cassandra/operations/opsRepairNodesWhen.html
Upvotes: -1