-
-
Save jeffersfp/0d6382043059b17b447a6846f6fb5452 to your computer and use it in GitHub Desktop.
Script to delete all kafka topics on a given cluster
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/bash | |
TOPICS=$(kafka-topics --zookeeper [ZK_IP]:2181/kafka --list ) | |
for T in $TOPICS | |
do | |
if [ "$T" != "__consumer_offsets" ]; then | |
kafka-topics --zookeeper [ZK_IP]:2181/kafka --delete --topic $T | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment