Nodetool Repair As the name suggests is repair, this is a very important operation in Nodetool. When we have modified or deleted the data, or periodically perform repair operations to maintain the consistency of each node. Basic format
Nodetool [(-H [(-PW password |--password password)]
[(-PWF Passwordfilepath |--password-file passwordfilepath)]
[(-u username |--username username)]Repair
[(-DC specific_dc |--in-dc specific_dc) ...]
[(-dcpar |--dc-parallel)] [(-et End_token |--end-token end_token)]
[(-full |--full)]
[(-hosts specific_host |--in-hosts specific_host) ...]
[(-j job_threads |--job-threads job_threads)]
[(-local |--in-local-dc)] [(-PR |--partitioner-range)]
[(-seq |--sequential)]
[(-st Start_token |--start-token start_token)] [(-tr |--trace)]
[--] [Keyspace Tables ...]
Note Here is that these parameters are in order, some only in repair, some only in the repair, the elder brother began to pay no attention to these orders, took a lot of detours.
Options
Hort |
Long |
Description |
-H |
--host |
Hostname or IP address. |
-P |
--port |
Port number. |
-pwf |
--password-file |
Password file path. |
-pw |
--password |
Password. |
-U |
--username |
Remote JMX Agent username. |
-DC SPECIFIC_DC |
--IN-DC SPECIFIC_DC |
Repair to nodes in the named Datacenter (SPECIFIC_DC). |
-dcpar |
--dc-parallel |
Repair datacenters in parallel, one node per datacenter at a time. |
-et End_token |
--end-tokenend_token |
Token UUID. Repair a range of nodes starting with the first token (see-st) and ending with this token (End_token). Use-hosts to specify neighbor nodes. |
-full |
--full |
Do a full repair. |
-H HOST_NAME |
--host host_name |
Node host name or IP address. |
-hosts Specific_host |
--in-hostsspecific_host |
Repair specific hosts. |
-j job_threads |
--job-threadsjob_threads |
Number of threads (job_threads) to run repair jobs. Usually the number of tables to repair concurrently. Be aware that increasing this setting puts more load on repairing nodes. (Default:1, Maximum:4) |
-local |
--in-local-dc |
Use to only repair nodes in the same datacenter. |
-pr |
--partitioner-range |
Run a repair the partition ranges that is primary on a replica. |
-seq Start_token |
--sequentialstart_token |
Run a sequential repair. |
-st Start_token |
--start-tokenstart_token |
Specify the token (Start_token) at which the repair range starts. |
-tr |
--trace |
Trace the repair. Traces is logged tosystem_traces.events. |
Keyspace |
Name of Keyspace. |
Tables |
One or more table names, separated by a space. |
-- |
Separates an option from the argument that could is mistaken for a option. |
Example:
In the current node, order to fix all the keyspaces
./nodetool Repair-seq
Fix the current data Center (data_center), which can only be used in the current datacenter.
./nodetool REPAIR-DC DC1
If you want to fix the data for a certain ring (with less time compared to all fixes), use-st (i.e., Start_token)-et (that is, End_token), which must be the same node and have a size order. View the ring command with
Repair Ring
./nodetool repair-st 7521963415957825786-et 8097903535872843286
Fix only the range of master data that falls on that node
./nodetool REPAIR-PR
Original address: http://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsRepair.html reference article: http://zhaoyanblog.com/ Archives/649.html