This documentation corresponds to an earlier product version. Make sure this document corresponds to your version.

Latest OpsCenter documentation | Earlier OpsCenter documentation

Removing all traces of Cassandra or DSE packages

After a failed attempt to provision a node or a cluster, you must remove all traces of Cassandra or DSE packages from the affected nodes.

Procedure

  1. Log into each node.
  2. Run the following BASH script on each node using sudo.
    # Stop services
    /etc/init.d/cassandra stop
    /etc/init.d/dse stop
    /etc/init.d/opscenter-agent stop
    
    # Remove packages
    PACKAGES=(dsc dsc1.1 dsc12 cassandra apache-cassandra1 dsc-demos \
    dse dse-libhadoop-native dse-libhadoop dse-libcassandra dse-hive dse-libhive dse-pig \
    dse-libpig dse-demos dse-libsqoop dse-libtomcat dse-liblog4j dse-libsolr dse-libmahout dse-full)
    DEB_PACKAGES=(python-cql python-thrift-basic)
    RPM_PACKAGES=(python26-cql python26-thrift)
    if [ `which dpkg` ]; then
    PLIST=(${PACKAGES[@]} ${DEB_PACKAGES[@]})
    dpkg -P ${PLIST[*]}
    rm -rf /etc/apt/sources.list.d/datastax.list
    else
    PLIST=(${PACKAGES[@]} ${RPM_PACKAGES[@]})
    yum -y remove ${PLIST[*]}
    rm -rf  /etc/yum.repos.d/datastax.repo
    fi
    
    # Cleanup log and configuration files
    rm -rf /var/lib/cassandra/* /var/log/{cassandra,hadoop,hive,pig}/* /etc/{cassandra,dse}/* \
    /usr/share/{dse,dse-demos} /etc/default/{dse,cassandra}
    
    • copy, paste, and run the script from the command line
    • save the script to a local file and copy to each node to run from the command line