用户登录
用户注册

分享至

zookeeper log

  • 作者: 大漠孤狼赵某某
  • 来源: 51数据库
  • 2020-10-04
1. 删除logs下的相关记录;
2. 到zookeeper下的brokers/topics删除相关节点。

--------------不好用!!

先逻辑删除(./bin/kafka-run-class.sh kafka.admin.DeleteTopicCommand --topic dnsTopic --zookeeper 10.0.1.44:2181,10.0.1.45:2181,10.0.1.46:2181),后物理删除(删除log文件)。

--------------如果是删除这个topic的数据的话,可行的方法:
1. 到zookeeper删除这个topic相关的consumerGroup
2. 删除这个topic的log文件夹下的所有文件【index以及log文件,不要删除目录即可】



  我不生产答案,我只是当一回stackoverflow的搬运工。今天刚好在stackoverflow查kafka的一个问题,顺带看到的。 for finding the start offset to read in kafka 0.8 simple consumer example they say kafka includes two constants to help, kafka.api.offsetrequest.earliesttime() finds the beginning of the data in the logs and starts streaming from there, kafka.api.offsetrequest.latesttime() will only stream new messages. you can also find the example code there for managing the offset at your consumer end. public static long getlastoff
软件
前端设计
程序设计
Java相关