【问题标题】:Flume-ng hdfs sink .tmp file refresh rate control proprtyFlume-ng hdfs sink .tmp 文件刷新率控制属性
【发布时间】:2015-05-26 21:43:03
【问题描述】:
我正在尝试每 5 分钟使用其他事件刷新 .tmp 文件,我的源速度很慢,需要 30 分钟才能在我的 hdfs 接收器中获取 128MB 文件。
flume hdfs sink 中是否有任何属性可以在文件滚动到 HDFS 之前控制 .tmp 文件的刷新率。
我需要这个来使用 .tmp 文件中的配置单元表查看 HDFS 中的数据。
目前我正在使用 hive 表查看 .tmp 文件中的数据,但由于卷大小为 128MB,因此 .tmp 文件很长时间没有刷新。
【问题讨论】:
标签:
cloudera
flume
hortonworks-data-platform
flume-ng
flume-twitter
【解决方案1】:
考虑减少通道的容量和 transactionCapacity 设置:
capacity 100 The maximum number of events stored in the channel
transactionCapacity 100 The maximum number of events the channel will take from a source or give to a sink per transaction
这些设置负责控制有多少事件在被刷新到您的接收器之前被假脱机。例如,如果您将其降低到 10,则每 10 个事件将刷新到您的 tmp 文件。
您需要更改 hdfs 接收器中的 batchSize 的第二个值:
hdfs.batchSize 100 number of events written to file before it is flushed to HDFS
如果您有一个非常慢的源并且您希望更频繁地查看事件,那么默认值 100 可能会太高。