Replace a dead node
The procedure for replacing a dead node is generally the same for clusters using vnodes or a single-token architecture. There are a few extra steps required for specific architectures and when replacing dead seed nodes. These extra steps are indicated where necessary.
|
When replacing or adding nodes, only use new nodes.
A new node is a system where DSE has never started.
The node must have absolutely no previous data in the Data loss or corruption can occur if you use a recycled node, such as a node moved from another cluster, because the existing data on the recycled node is merged into the cluster. |
Verify the node’s status
Run nodetool status to check the condition of the node that you want to replace.
This command returns a two-letter code describing the status and state of each node in the cluster.
For example, UN means a node is in Up status and Normal state.
To replace a node, the following conditions must be true:
-
The output of
nodetool statusshows the node inDown(D) status andNormal(N) state. The node you want to replace must not report a transitional state likeJoining(J) orLeaving(L). -
DSE isn’t running on the node. Specifically, the DSE Java process must be stopped or the host itself must be offline.
|
A node in |
The output of nodetool status depends on your cluster architecture, your version of DSE, and the node where you run the command.
Nodes can report their own condition differently than the condition seen by other nodes in the cluster.
Review the following information for your version of DSE to understand what to expect when a node is in Down status.
To assist with migrations and upgrades, the following scenarios span patch releases of DSE 5.1, 6.0, 6.7, 6.8, and 6.9.
| DSE versions | Identifying nodes in Down (D) status |
|---|---|
6.9.0 and later 6.8.26 and later 5.1.33 and later |
A
If a node is |
6.8 to 6.8.25 6.7.8 and later 6.0.12 and later 5.1.18 to 5.1.32 |
A node in Run
|
6.7.0 to 6.7.7 6.0.0 to 6.0.11 5.1.0 to 5.1.17 |
A
The |
Replace the dead node
-
Get the following information from the dead node:
-
IP address.
-
Datacenter and rack information:
-
If the cluster uses the PropertyFileSnitch: Get the dead node’s rack and datacenter assignments from the
cassandra-topology.propertiesfile. -
If the cluster uses the GossipingPropertyFileSnitch, Ec2Snitch, Ec2MultiRegionSnitch, or GoogleCloudSnitch: Get the rack and datacenter assignments from the dead node’s
cassandra-rackdc.propertiesfile.
-
-
Single-token architecture only (not vnodes):
initial_tokenvalue fromcassandra.yaml.
-
-
Add the replacement node to the network and record its IP address.
Make sure the replacement node meets the hardware and system requirements for your workloads.
-
Install DSE on the new node but don’t start DSE.
You must install the same DSE version (major, minor, and patch) on all nodes in a cluster.
-
If DSE starts automatically on the node, stop DSE and then clear the data that was added automatically on startup.
The node must be clear of data before joining the cluster as a replacement node.
-
If the dead node was a seed node, change the cluster’s seed node configuration on each node:
-
In the
cassandra.yamlfile for each node, remove the IP address of the dead node from the- seedslist in theseed-providerproperty. -
If a replacement seed node is needed, add the new node’s IP address to the
- seedslist of the other nodes. -
Run
nodetool reloadseedsto force the node to read the changes to the- seedslist in thecassandra.yamlfile.
Don’t make every node a seed node because it increases maintenance and reduces gossip performance. Gossip optimization isn’t critical, but DataStax recommends a small seed list with two or three seed nodes per datacenter.
-
-
From a healthy node’s
cassandra.yamlfile, get thecluster_name,endpoint_snitch, and any other non-default values that you need to configure the new node.Use the
diffcommand to compare configuration files for healthy nodes with the default configuration files. -
Configure the new node’s
cassandra.yamlfile using the values that you gathered earlier.In particular, make sure the following settings are configured correctly:
-
auto_bootstrap: If set tofalsefor other nodes in the cluster, set it totrueon the replacement node. This option isn’t explicitly set in the defaultcassandra.yamlconfiguration file, and it defaults totrue. -
initial_token: Only required for single-token architectures. -
- seedslistIf the new node is a seed node, make sure it is not listed in its own
- seedslist.
-
-
Add the rack and datacenter configuration to the snitch configuration files on all nodes in the cluster:
Only add the new node to the snitch configuration files. Do not remove the original entry for the dead node yet.
-
If the cluster uses the GossipingPropertyFileSnitch, Ec2Snitch, Ec2MultiRegionSnitch, or GoogleCloudSnitch: Add the dead node’s rack and datacenter assignments to the
cassandra-rackdc.propertiesfile on the replacement node. -
If the cluster uses the PropertyFileSnitch:
-
Copy the
cassandra-topology.propertiesfile from an existing node to the replacement node. -
In each node’s
cassandra-topology.propertiesfile, add an entry with the new node’s IP address and the dead node’s rack and datacenter assignments. -
Delete the
cassandra-topology.propertiesfile from the dead node.
-
-
-
Start DSE on the replacement node with the following start up options in addition to any other startup options that you typically used for the dead node, such as advanced workload types:
-
-Dcassandra.replace_address_first_boot: The IP address of the dead node. -
-Ddse.consistent_replace: The consistency level to use when replacing the node. Allowed values areONE,QUORUM(default), orLOCAL_QUORUM. Typically, this should match the consistency level of read requests.ONErequires the least system resources but the replacement node might stream data from an inconsistent replica, rather than comparing data from a quorum of replicas. Until you run repair, reads against the replacement node might return stale data.
For additional control over the data streamed to the replacement node or streaming performance, you can set
consistent_replace.parallelism,consistent_replace.retries, andconsistent_replace.whitelist. For more information, see Apache Cassandra system properties.- Package installations
-
Add the options to the
jvm-server.optionsfile, and then start the node:JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address_first_boot=ADDRESS_OF_DEAD_NODE" JVM_OPTS="$JVM_OPTS -Ddse.consistent_replace=QUORUM" - Tarball installations
-
Start the node with the replacement options:
sudo INSTALL_DIRECTORY/bin/dse cassandra \ -Dcassandra.replace_address_first_boot=ADDRESS_OF_DEAD_NODE \ -Ddse.consistent_replace=QUORUM
-
-
Run
nodetool statusto verify that the new node has bootstrapped successfully. -
For package installations, remove
replace_address_first_bootand anyconsistent_replaceoptions fromjvm-server.options. -
If using the PropertyFileSnitch, wait at least 72 hours, and then remove the dead node’s IP address from the
cassandra-topology.propertiesfile on all nodes in the cluster.This ensures that dead node’s information is removed from gossip. If removed from the property file too soon, problems can occur. Use
nodetool gossipinfoto check the gossip status. The node is still in gossip untilLEFTstatus disappears.This step isn’t required when using other snitches because the
cassandra-rackdc.propertiesfile doesn’t contain IP addresses.