我刚开始使用加缪。我打算每小时运行一次。我们每小时收到大约80000000条消息(平均大小约为4KB)。
如何设置以下属性:
# max historical time that will be pulled from each partition based on event timestamp
kafka.max.pull.hrs=1
# events with a timestamp older than this will be discarded.
kafka.max.historical.days=3
我无法清楚地弄清楚这些配置。我应该将1天和1小时的房产作为2天? camus如何提取数据?我经常看到以下错误:
ERROR kafka.CamusJob: Offset range from kafka metadata is outside the previously persisted offset
Please check whether kafka cluster configuration is correct. You can also specify config parameter: kafka.move.to.earliest.offset to start processing from earliest kafka metadata offset.
如何正确设置配置以每小时运行一次并避免该错误?
答案 0 :(得分:1)
" kafka元数据的偏移范围超出了先前持久的偏移量。"
表示您的提取速度不如kafka的修剪速度快。
kafka的修剪由log.retention.hours定义。
第一个选项:通过更改" log.retention.hours "来延长保留时间
第二个选项:以更高的频率运行它。
第3个选项:设置你的工作 kafka.move.to.earliest.offset = true 。 此属性将强制camus从kafka中当前存在的最早偏移开始消耗。但这可能会导致数据丢失,因为我们没有考虑到我们无法获取的已修剪数据。