nodetool compact
Forces a major compaction on one or more tables:
-
If you do not specify a keyspace or table, a major compaction is run on all keyspaces and tables.
-
If you specify only a keyspace, a major compaction is run on all tables in that keyspace.
-
If you specify one or more tables, a major compaction is run on only those tables.
Major compactions behave differently depending which compaction strategy is used for the affected tables.
|
A major compaction incurs considerably more disk I/O than minor compactions. |
Synopsis
nodetool [options] compact [(-et <end_token> | --end-token <end_token>)]
[(-s | --split-output)] [(-st <start_token> | --start-token <start_token>)] [--] [<keyspace> [<tables>...]]
[--user-defined] <relative_path_to_SSTable file>...
Tarball and Installer No-Services path:
<installation_location>/resources/cassandra/bin
Common options
These options apply to all nodetool commands.
| Short | Long | Description |
|---|---|---|
|
|
Hostname or IP address. |
|
|
Remote JMX agent port number. |
|
|
Password. |
|
|
Password file path. |
|
|
Remote JMX agent user name. |
|
Separates an option from an argument that could be mistaken for an option. |
|
Compact options
The following options are specific to the compact command:
| Short | Long | Description | ||
|---|---|---|---|---|
|
|
Specify a token at which the compaction range ends.
Requires start token ( |
||
|
|
Specify a token at which the compaction range starts.
Requires end token ( |
||
|
|
Instead of creating a single large file, split output when using SizeTieredCompactionStrategy (STCS) into files that are progressively smaller percentages of the total size, such as 50 percent, then 25 percent, then 12.5 percent.
|
||
keyspace [tables] |
Run compaction on an entire keyspace or specified tables; use a space to separate table names. |
|||
|
Run compaction on one or more SSTables. Specify the relative paths and file names. |