Created
May 6, 2014 23:54
-
-
Save mshuler/3e7620be907c18403ecd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# stop manually started cassandra service, remove dtest cruft, | |
# and wipe data and logs | |
# | |
# set user or leave commented out for current user from env | |
#USER=cassandra | |
# kill all CassandraDaemons | |
while pgrep -f CassandraDaemon; do | |
pkill -f CassandraDaemon | |
echo "..SIGTERM sent" | |
sleep 2 | |
done | |
echo "no CassandraDaemon.." | |
# remove remnant dtest temporary dirs | |
find /tmp/ -maxdepth 1 -user $USER -type d -name dtest-* -exec rm -r {} \; | |
# set up fresh /var/{lib,log}/cassandra dirs | |
sudo rm -r /var/lib/cassandra /var/log/cassandra | |
sudo mkdir /var/lib/cassandra /var/log/cassandra | |
sudo chown $USER /var/lib/cassandra /var/log/cassandra | |
echo "this house is clean.." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment