栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

删除kafka指定topic下数据

删除kafka指定topic下数据

设置指定topic下 数据过期时间:

./bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name MARC_INSTANCE_SYNC --alter --add-config retention.ms=1000
Warning: --zookeeper is deprecated and will be removed in a future version of Kafka.
Use --bootstrap-server instead to specify a broker to connect to.
Completed updating config for entity: topic 'MARC_INSTANCE_SYNC'.

确认设置是否成功:
 ./bin/kafka-configs.sh --zookeeper localhost:2181 --describe --entity-type topics --entity-name MARC_INSTANCE_SYNC
Warning: --zookeeper is deprecated and will be removed in a future version of Kafka.
Use --bootstrap-server instead to specify a broker to connect to.
Configs for topic 'MARC_INSTANCE_SYNC' are retention.ms=1000

删除上面设置:
./bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name MARC_INSTANCE_SYNC --alter --delete-config retention.ms
Warning: --zookeeper is deprecated and will be removed in a future version of Kafka.
Use --bootstrap-server instead to specify a broker to connect to.
Completed updating config for entity: topic 'MARC_INSTANCE_SYNC'.

确认删除是否成功:
 ./bin/kafka-configs.sh --zookeeper localhost:2181 --describe --entity-type topics --entity-name MARC_INSTANCE_SYNC  Warning: --zookeeper is deprecated and will be removed in a future version of Kafka.
Use --bootstrap-server instead to specify a broker to connect to.
Configs for topic 'MARC_INSTANCE_SYNC' are 
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/650569.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号