nodetool rebuild

Rebuilds data by streaming from other nodes.

Rebuilds data by streaming from other nodes.

Synopsis

install_location/bin/nodetool options rebuild 
    [ -ks | --keyspace keyspace_name [ , keyspace_name ] . . . ] 
    [ -mode rebuild_mode]    
    [ -ts | --tokens specific_tokens ]
    [-- source-dc-name ]
Table 1. Options
Short Long Description
-m --mode Rebuild mode.
-h --host Hostname or IP address.
-p --port Port number.
-pwf --password-file Password file path.
-pw --password Password.
-ks --keyspace Rebuild specific keyspace.
-- Separates an option from an argument that could be mistaken for a option.
source-dc-name Name of datacenter from which to select sources for streaming. By default, choose any datacenter.

Parameters

-ks, --keyspace keyspace_name, ...
Comma-separated list of one or more keyspaces. List only the keyspaces to include in the rebuild.
Warning: Do not include any keyspaces that are local to the datacenter, or any keyspaces created with the replication class, SimpleStrategy, such as system and system_schema.
rebuild_mode
  • normal - conventional behavior. Streams only ranges that are not locally available. Default.
  • refetch - resets locally available ranges. Streams all ranges but leaves current data untouched.
  • reset - resets locally available ranges. Removes all locally present data (like a TRUNCATE). Streams all ranges.
  • reset-no-snapshot - resets locally available ranges. Removes all locally present data (like a TRUNCATE). Streams all ranges. Prevents a snapshot if auto_snapshot is enabled in cassandra.yaml.
specific_tokens
One or more tokens, and/or one or more ranges of tokens. The token_spec can be:
  • One specific token.
  • A comma-delimited list of single tokens.
  • A range of tokens, specified as ( start_token, end_token).
  • A comma-delimited list of token ranges — for example, ( start_token1, end_token1) , ( start_token2, end_token2, . . .
  • A comma-delimited list of mixed single tokens and token ranges — for example, token1, ( start_token2, end_token2) , ( start_token3, end_token3) , token4, . . .
--
Separates an option and argument that could be mistaken for a option.
source-dc-name
The name of the datacenter that the DataStax Distribution of Apache Cassandra™ (DDAC) uses as the source for streaming. Cassandra rebuilds from any datacenter. If the statement does not specify one, Cassandra chooses at random.

Description

This command operates on multiple nodes in a cluster. Like nodetool bootstrap, rebuild only streams data from a single source replica when rebuilding a token range. Use this command to add a new datacenter to an existing cluster.

If rebuild fails because some token ranges cannot be retrieved, you can rebuild selectively by using the -ts or --token option to specify a list of tokens, or one or more token ranges.

Note: If rebuild is interrupted before completion, you can restart it by re-entering the command. The process resumes from the point at which it was interrupted.