kafka topic删除失败

kafka-topics --list --zookeeper node1:2181,node2:2181,node4:2181
kafka-topics --delete --zookeeper node1:2181,node2:2181,node4:2181 --topic ods_uinfo_topic

发现被标记为marked for deletion
登录cdh的cm的web,发现delete.topic.enable是为true的
zookeeper-client 登录到zk

ls /brokers/topics
rmr /brokers/topics/topic名

执行后
使用上述命令

查看kafka的消费是否生效
kafka-consumer-groups --bootstrap-server node1:9092,node2:9092,node4:9092 --describe --group ods_uinfo_group

20/04/30 11:18:11 INFO utils.AppInfoParser: Kafka version : 2.1.0-kafka-4.0.0
20/04/30 11:18:11 INFO utils.AppInfoParser: Kafka commitId : unknown
Error: Executing consumer group command failed due to org.apache.kafka.common.errors.CoordinatorNotAvailableException: The coordinator is not available.
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.CoordinatorNotAvailableException: The coordinator is not available.
        at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
        at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
        at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89)
        at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:262)
        at kafka.admin.ConsumerGroupCommand$ConsumerGroupService.collectGroupOffsets(ConsumerGroupCommand.scala:332)
        at kafka.admin.ConsumerGroupCommand$ConsumerGroupService.describeGroup(ConsumerGroupCommand.scala:252)
        at kafka.admin.ConsumerGroupCommand$.main(ConsumerGroupCommand.scala:60)
        at kafka.admin.ConsumerGroupCommand.main(ConsumerGroupCommand.scala)
Caused by: org.apache.kafka.common.errors.CoordinatorNotAvailableException: The coordinator is not available.

需要将kafak重启一下

再次执行

[root@node2 ods_assets_accessin_flume]# kafka-consumer-groups --bootstrap-server node1:9092,node2:9092,node4:9092 --describe --group  ods_uinfo_group
20/04/30 11:24:14 INFO utils.AppInfoParser: Kafka version : 2.1.0-kafka-4.0.0
20/04/30 11:24:14 INFO utils.AppInfoParser: Kafka commitId : unknown
20/04/30 11:24:14 INFO clients.Metadata: Cluster ID: 5zHt85JrSG6x3h5LskwfwQ

TOPIC                     PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                     HOST            CLIENT-ID
ods_uinfo_topic 0          -               6               -               consumer-1-eebe4c4b-98af-404b-906f-7a0ff3142633 /192.168.5.5    consumer-1

你可能感兴趣的:(大数据)