Replacing a dead node in a single-token architecture cluster
Steps for replacing nodes in single-token architecture clusters, not vnodes.
|
Only add new nodes to the cluster.
A new node is a system in which DataStax Enterprise (DSE) has never started.
The node must have absolutely NO PREVIOUS DATA in the data directory, |
Where is the cassandra.yaml file?
The location of the cassandra.yaml file depends on the type of installation:
| Installation Type | Location |
|---|---|
Package installations + Installer-Services installations |
|
Tarball installations + Installer-No Services installations |
|
Procedure
-
Run
nodetool statusto verify that the node is dead (DN).
Verify that the node is dead -
Record the datacenter, address, and rack settings of the dead node to use later.
-
Record the existing
initial_tokensetting from the dead node’scassandra.yaml. -
Add the replacement node to the network and record its IP address.
-
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 the seed-provider property. -
If the cluster needs a new seed node to replace the dead node, add the new node’s IP address to the
- seedslist of the other nodes.Making every node a seed node is not recommended because of increased maintenance and reduced gossip performance. Gossip optimization is not critical, but it is recommended to use a small seed list (approximately three nodes per datacenter).
-
-
On an existing node, gather setting information for the new node from the
cassandra.yamlfile:-
cluster_name -
endpoint_snitch -
Other non-default settings: Use the
difftool to compare current settings with default settings.
-
-
Gather rack and datacenter information:
-
If the cluster uses the
PropertyFileSnitch, record the rack and data assignments listed in thecassandra-topology.propertiesfile, or copy the file to the new node. -
If the cluster uses the
GossipingPropertyFileSnitch,Ec2Snitch,Ec2MultiRegionSnitch, orGoogleCloudSnitch, record the rack and datacenter assignments in the dead node’scassandra-rackdc.propertiesfile.
-
-
Make sure that the new node meets all prerequisites and then install DSE on the new node, but do not start DSE.
Be sure to install the same version of DSE as is installed on the other nodes in the cluster. If not using the latest version, see Installing DataStax Enterprise 5.1.x patch releases.
-
If DSE automatically started on the node, stop and clear the data that was added automatically on startup.
-
Add values to the following properties in
cassandra.yamlfile from the information gathered earlier:-
auto_bootstrap: If this setting exists and is set tofalse, set it totrue. (This setting is not included in the defaultcassandra.yamlconfiguration file.) -
If the new node is a seed node, make sure it is not listed in its own
- seedslist.
-
-
Add the rack and datacenter configuration:
-
If the cluster uses the
GossipingPropertyFileSnitch,Ec2Snitch, andEc2MultiRegionSnitchorGoogleCloudSnitch:-
Add the dead node’s rack and datacenter assignments to the
cassandra-rackdc.propertiesfile on the replacement node.Do not remove the entry for the dead node’s IP address yet.
-
Delete the
cassandra-topology.propertiesfile.
-
-
If the cluster uses the
PropertyFileSnitch:-
Copy the
cassandra-topology.propertiesfile from an existing node, or add the settings to the local copy. -
Edit the file to add an entry with the new node’s IP address and the dead node’s rack and datacenter assignments.
-
-
-
Start the new node with the
replace_addressoption, passing in the IP address of the dead node.-
Package and Installer-Services installations:
-
Add the following option to
cassandra-env.shfile:JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=address_of_dead_node -
After the node bootstraps, remove the
replace-addressparameter fromcassandra-env.sh.
-
-
Tarball and Installer-No Services installations:
-
Start DataStax Enterprise from the
<installation_location>with this option:sudo bin/dse cassandra -Dcassandra.replace_address=address_of_dead_node -
Start DataStax Enterprise from the
<installation_location>with this option:sudo bin/dse cassandra -Dcassandra.replace_address=address_of_dead_node
-
-
-
Run nodetool status to verify that the new node has bootstrapped successfully.
Tarball and Installer No-Services path:
<installation_location>/resources/cassandra/bin -
In environments that use the
PropertyFileSnitch, wait at least 72 hours and then remove the old node’s IP address from thecassandra-topology.propertiesfile.This ensures that old node’s information is removed from gossip. If removed from the property file too soon, problems may result. Use
nodetool gossipinfoto check the gossip status. The node is still in gossip untilLEFTstatus disappears.The
cassandra-rackdc.propertiesfile does not contain IP information; therefore this step is not required when using other snitches, such asGossipingPropertyFileSnitch.