2015-11-05 41 views
0

我刚刚开始与加缪。我计划每隔一小时运行一次camus工作。我们每小时收到80000000条消息(平均大小约为4KB)。为加缪工作设置frequecy

如何设置以下属性:

# 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. 

如何正确设置配置以每小时运行一次并避免该错误?

回答

1

“从卡夫卡元数据是外部的先前偏移持久化了偏移范围”。

表示你的抓取是不是快如卡夫卡的修剪。

卡夫卡的修剪由log.retention.hours定义。

第一种选择:通过改变“log.retention.hours

第二选项来增加滞留时间:以更高的频率运行它。

第三选项:设置在您的camus作业kafka.move.to.earliest.offset = true。 该属性将强制camus开始消耗当前存在于kafka中的最早的偏移量。但是这可能会导致数据丢失,因为我们没有考虑到我们无法获取的修剪数据。