Delete, create, and verify the __consumer_offsets topic that comes with the Kafka installation

Delete Kafka's built-in Topic


In general, if you delete the __consumer_offsets topic that comes with Kafka, an error message will be displayed indicating that it cannot be deleted.

If you are stubborn, you directly find zookeeper and delete it. The list view does not have this topic, but this will cause consumers and offsets to be unable to be recorded.


Create the Topic that comes with Kafka


If you try to create directly without parameters, then after the creation is complete, the leader will display none, and the ISR will display empty.

The correct way to create it is:

kafka-topics --create --zookeeper xxxx:2181 --replication-factor 3 --partitions 50 --topic __consumer_offsets --config cleanup.policy=compact --config min.compaction.lag.ms=86400000

The retention period can be adjusted by yourself, and other parameters cannot be changed, otherwise it cannot be managed by Kafka.


Ways of identifying


  1. describe Check __consumer_offsets, whether there is a leader, ISR
  2. Just find a topic (such as topic_test, and create a new consumer
  3. Check the consumer group of topic_test, if it can be queried, it is a success.

Guess you like

Origin blog.csdn.net/qq_44491709/article/details/130439709