Skip to content

Instantly share code, notes, and snippets.

@iandow
Last active January 1, 2017 22:10
Show Gist options
  • Save iandow/2dc07bde132669706467e8ee45507561 to your computer and use it in GitHub Desktop.
Save iandow/2dc07bde132669706467e8ee45507561 to your computer and use it in GitHub Desktop.
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