Instantly share code, notes, and snippets.

Embed
What would you like to do?
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