Last active
January 1, 2017 22:10
-
-
Save iandow/2dc07bde132669706467e8ee45507561 to your computer and use it in GitHub Desktop.
This file contains 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
while true; do | |
tail -n 40 /opt/kafka_2.11-0.10.0.1/logs/server.log | grep ZkTimeout; | |
if [ $? -eq 0 ]; then | |
sudo service kafka stop | |
ssh kafkanodeb sudo service kafka stop | |
ssh kafkanodec sudo service kafka stop | |
sudo rm -rf /tmp/kafka-logs | |
ssh kafkanodeb sudo rm -rf /tmp/kafka-logs | |
ssh kafkanodec sudo rm -rf /tmp/kafka-logs | |
sudo rm -rf /tmp/zookeeper/version-2 | |
ssh kafkanodeb sudo rm -rf /tmp/zookeeper/version-2 | |
ssh kafkanodec sudo rm -rf /tmp/zookeeper/version-2 | |
ssh kafkanodeb sudo service kafka start | |
ssh kafkanodec sudo service kafka start | |
sudo service kafka start | |
ssh kafkanodeb sudo service kafka status | |
ssh kafkanodec sudo service kafka status | |
sudo service kafka status | |
fi; | |
sleep 60; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment