Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a decommissioned node in cassandra?

Tags:

cassandra

I just did nodetool decommission and it removed the node and I am trying to add it back in so I just started cassandra(decomissioned node) again but it doesnt seem to join the cluster?

like image 674
user1870400 Avatar asked Oct 21 '25 13:10

user1870400


1 Answers

The other nodes will remember that the host ID you decommissioned should no longer be part of the cluster and will refuse to talk to it.

So if you want that machine to rejoin the cluster, you have to make it look like a new empty node so that the remaining nodes will let it rejoin. The easiest way to do that is to clear out all the data on the decommissioned node so that it will generate a new host ID for itself. Then it should be able to rejoin.

To clear out the old data, do this:

Stop Cassandra on the node, then:

rm -r <the commitlog_directory specified in cassandra.yaml>
rm -r <the data_file_directories specified in cassandra.yaml>
rm <the contents of the saved_caches_directory specified in cassandra.yaml>
rm <old logfiles in /var/log/cassandra/>

Then restart the Cassandra service

like image 163
Jim Meyer Avatar answered Oct 24 '25 19:10

Jim Meyer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!