bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
#!/bin/bash -xe | |
# requires jq and 3 brokers to start | |
which jq || echo 'no jq found, bye!' && exit 1 | |
ZK_HOST=zkhost1:2181/kafka | |
# record all topics | |
/usr/local/kafka/bin/kafka-topics.sh --zookeeper $ZK_HOST --list > all_topics | |
# generate json for listing which topics to reassign |