nodetool scrub
Creates a snapshot and then rebuilds SSTables on a node.
If possible use nodetool upgradesstables instead of scrub.
Scrub automatically discards broken data and removes any tombstoned rows that have exceeded gc_grace period of the table.
If partition key values do not match the column data type, the partition is considered corrupt and the process automatically stops.
|
When using LCS, resets all SSTables back to Level 0 and requires recompaction of all SSTables. |
Synopsis
nodetool [<connection_options>] scrub [(-j <jobs> | --jobs <jobs>)] \
[(-n | --no-validate)][(-ns | --no-snapshot)] \
[ --reinsert-overflowed-ttl ] \
[(-s | --skip-corrupted)] \
[--] [<keyspace> <tables>...]
Connection options
Connection options specify how to connect and authenticate for all nodetool commands:
| Short | Long | Description |
|---|---|---|
|
|
Hostname or IP address. |
|
|
Port number. |
|
|
Password file path. |
|
|
Password. |
|
|
Username. |
-- |
Separates command parameters from a list of options. |
|
|
Examples:
Scrub a single table on a keyspace
nodetool scrub cycling cyclist_id
Scrub an entire keyspace while skipping corrupted partitions
nodetool scrub -s cycling
Scrub parameters
Use the following parameters with the scrub command:
-j|--jobs jobs-
Number of SSTables to simultaneously scrub. Zero (0) uses all available compaction threads.
Default: 2.
-n|--no-validate-
Suppresses validation of columns.
Default: Validate all columns.
-ns --no-snapshot-
Suppresses creation of snapshot.
Default: Create a snapshot before rebuilding SSTables.
--reinsert-overflowed-ttl-
Rewrites SSTables containing rows with overflowed expiration time with the maximum expiration date of
2038-01-19T03:14:06+00:00using the original timestamp + 1 (ms). -s | --skip-corrupted-
Forces scrub to skip corrupt partitions and continue. Corrupt partitions have a column value that does not match the column data type. Logs skipped partitions in the
system.log.Default: Stop scrubbing if a corrupted partition is detected.
Skipping corrupted partitions on tables with counter columns results in under-counting.
keyspace_name table_name […]-
Identifies the keyspace and targets specific tables using a space separated list.
Default: Include all keyspaces and tables on the node when no arguments are specified.