Skip to content

Instantly share code, notes, and snippets.

@kimh
Created December 11, 2015 01:35
Show Gist options
  • Save kimh/e7211dde406794998278 to your computer and use it in GitHub Desktop.
Save kimh/e7211dde406794998278 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "describe cluster;" > /tmp/dc
for i in {1..5}; do
echo Attempt $i
if cassandra-cli -f /tmp/dc 2>&1 | grep "Cluster Information"; then
exit 0
else
sudo service cassandra stop; sudo service cassandra start
sleep 10
fi
done
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment