Cassandra 3.6:如何从Gossip信息中移除已退役节点261.4.55.161
Hey there! Since you’ve already successfully decommissioned node 261.4.55.161 and confirmed nodetool status cp only shows your active node, let’s walk through how to fully clear the decommissioned node from Cassandra’s Gossip metadata. Gossip might hang onto stale node info temporarily, but we can force a cleanup with these straightforward steps:
Step 1: Confirm the stale node is still in Gossip
First, check if the decommissioned node’s data is still present in Gossip on your active node. Run this command:
nodetool gossipinfo | grep 261.4.55.161
If you see any output referencing the IP, that’s the stale data we need to remove.
Step 2: Manually clear Gossip state files
Cassandra stores cached Gossip data locally. To wipe this stale info:
- Shut down Cassandra cleanly on your active node. Use the appropriate command for your system:
# For systemd-based systems sudo systemctl stop cassandra # Or for init.d systems sudo service cassandra stop - Delete the cached Gossip files
Navigate to Cassandra’s saved caches directory (default path is/var/lib/cassandra/saved_caches), then remove the cache files for the system keyspace that hold Gossip data:
Note: Only delete these two files—don’t touch other cache files in this directory.cd /var/lib/cassandra/saved_caches rm system.peers_cache.db system.local_cache.db - Restart Cassandra
Bring the service back up to rebuild the Gossip cache with fresh data:# For systemd systems sudo systemctl start cassandra # Or for init.d systems sudo service cassandra start
Step 3: Verify the removal
Once your active node is fully up, re-run the Gossip info check to confirm the stale node is gone:
nodetool gossipinfo | grep 261.4.55.161
If there’s no output, the decommissioned node has been successfully removed from Gossip.
A quick side note: By default, Cassandra will automatically expire stale Gossip entries after a timeout (controlled by gossip_timeout_in_ms in cassandra.yaml, default is 30 seconds). But if you need immediate cleanup, the steps above are the reliable way to make it happen right away.
内容的提问来源于stack exchange,提问作者Ganesh

