nodetool rebuild 

Rebuilds data by streaming from other nodes.

Rebuilds data by streaming from other nodes.

Synopsis 

$ nodetool options rebuild 
[ -ks | --keyspace keyspace_name [ , keyspace_name ] . . . ] 
[ -ts | --tokens token_spec ]
[ -- source-dc-name ]
DataStax Enterprise 5.0 Installer No-Services and tarball installations:
installation_location/resources/cassandra/bin
Options
Short Long Description
-h --host Hostname or IP address.
-p --port Port number.
-pwf --password-file Password file path.
-pw --password Password.
-ks specific_keyspace --keyspace specific_keyspace Rebuild specific keyspace.
source-dc-name Name of datacenter from which to select sources for streaming. By default, choose any datacenter.
-- Separates an option from an argument that could be mistaken for a option.

Parameters 

keyspace_name (Cassandra 3.6 and later)

The name of the keyspace to rebuild. The rebuild command works with a single keyspace or a comma-delimited list of keyspaces.

token_spec (Cassandra 3.6 and later)
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 Cassandra 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.