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
Hadoop|
Apache Pig|
Apache Kafka|
Apache Storm|
Impala|
Zookeeper|
SAS|
TensorFlow|
人工智能基础|
Apache Kylin|
Openstack|
Flink|
MapReduce|
大数据|
云计算|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....