kafka操作

http://blog.sina.com.cn/s/blog_628cc2b70102wdsb.html  异常

https://jingyan.baidu.com/article/eb9f7b6d367679869364e8d4.html  kafka管理

while read line
do
echo $line
kafka-configs.sh –zookeeper localhost:2181 –alter –entity-name $line –entity-type topics –add-config retention.ms=1000
kafka-configs.sh –zookeeper localhost:2181 –alter –entity-name $line –entity-type topics -add-config cleanup.policy=delete
kafka-topics.sh –delete –zookeeper localhost:2181 –topic $line
done < /opt/tmp.topics
kafka-run-class.sh kafka.tools.GetOffsetShell –broker-list localhost:9092 –topic qycloud-18.qycloud.nanjinganyuankeji_workflow     查看数量

kafka-topics.sh –list –zookeeper localhost:2181    查看topics

kafka-topics.sh –describe –zookeeper localhost:2181 –topic $line        查看topic详情

kafka-run-class.sh kafka.tools.ConsumerOffsetChecker  –group $group    查看偏移量

删除kafka的topics

参考:

http://www.bubuko.com/infodetail-2859810.html

https://blog.csdn.net/russle/article/details/82881297

https://blog.csdn.net/dianyueneo/article/details/37527087

https://blog.csdn.net/little_fxc/article/details/98494263

<code>

kafka-topics.sh –delete –zookeeper localhost:2181 –topic `kafka-topics.sh –list –zookeeper localhost:2181`
while read line
do
echo $line
kafka-configs.sh –zookeeper localhost:2181 –alter –entity-name $line –entity-type topics –add-config retention.ms=1000
kafka-config.sh –zookeeper localhost:2181 –alter –entity-name $line –entity-type topics -add-config cleanup.policy=delete
kafka-topics.sh –delete –zookeeper localhost:2181 –topic $line
done < /opt/tmp.topics2

</code>