Uninstalling Apache Cassandra

Steps for uninstalling Apache Cassandra by install type.

This topic provides information on completely removing Apache Cassandra from your machine.
Note: If you want to keep the installation or if you don't remove the installation immediately, see Preventing the node from re-joining the cluster.

Select the uninstall method for your type of installation.

Uninstalling Debian- and RHEL-based packages

Use this method when you have installed Apache Cassandra using APT or Yum.

  1. Stop the Cassandra services:
    sudo service cassandra stop
  2. Make sure all services are stopped:
    ps auwx | grep cassandra
  3. If services are still running, use the PID to kill the service:
    sudo kill cassandra_pid
  4. Remove the library and log directories:
    sudo rm -r /var/lib/cassandra
    sudo rm -r /var/log/cassandra
  5. Remove the installation directories:
    RHEL-based packages:
    sudo yum remove "cassandra-*"

    Debian-based packages:

    sudo apt-get purge "cassandra-*"

Uninstalling the binary tarball

Use this method when you have installed Cassandra using the binary tarball.

  1. Stop the node:
    ps auwx | grep cassandra
  2. sudo  kill <pid>
  3. Stop the DataStax Agent if installed:
    sudo kill datastax_agent_pid
  4. Remove the installation directory.

Preventing the node from re-joining the cluster

The following steps will prevent the node from re-joining the cluster if someone inadvertently starts Cassandra again.

  1. Stop Cassandra using one of the above methods.
  2. In the cassandra.yaml:
    1. Change the cluster_name to DECOMMISSIONED.
    2. Set the - seeds list to 127.0.0.1.
    3. Restart the node.