2015-11-05 19 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中的最早的偏移量。但是這可能會導致數據丟失,因爲我們沒有考慮到我們無法獲取的修剪數據。