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 status
to 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_token
setting 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.yaml
file for each node, remove the IP address of the dead node from the- seeds
list 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
- seeds
list 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.yaml
file:-
cluster_name
-
endpoint_snitch
-
Other non-default settings: Use the
diff
tool 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.properties
file, 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.properties
file.
-
-
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.yaml
file 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.yaml
configuration file.) -
If the new node is a seed node, make sure it is not listed in its own
- seeds
list.
-
-
Add the rack and datacenter configuration:
-
If the cluster uses the
GossipingPropertyFileSnitch
,Ec2Snitch
, andEc2MultiRegionSnitch
orGoogleCloudSnitch
:-
Add the dead node’s rack and datacenter assignments to the
cassandra-rackdc.properties
file on the replacement node.Do not remove the entry for the dead node’s IP address yet.
-
Delete the
cassandra-topology.properties
file.
-
-
If the cluster uses the
PropertyFileSnitch
:-
Copy the
cassandra-topology.properties
file 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_address
option, passing in the IP address of the dead node.-
Package and Installer-Services installations:
-
Add the following option to
cassandra-env.sh
file:JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=address_of_dead_node
-
After the node bootstraps, remove the
replace-address
parameter 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.properties
file.This ensures that old node’s information is removed from gossip. If removed from the property file too soon, problems may result. Use
nodetool gossipinfo
to check the gossip status. The node is still in gossip untilLEFT
status disappears.The
cassandra-rackdc.properties
file does not contain IP information; therefore this step is not required when using other snitches, such asGossipingPropertyFileSnitch
.