关于flume的filechannel的一些配置与理解

checkpointDir~/.flume/file-channel/checkpointThe directory where checkpoint file will be stored  检查点的目录
useDualCheckpointsfalse

Backup the checkpoint. If this is set to true, backupCheckpointDir must be set

使用对checkpoint进行备份

backupCheckpointDir

The directory where the checkpoint is backed up to. This directory must not be the same as the data directories or the checkpoint directory

备用的检查点目录

dataDirs~/.flume/file-channel/data

Comma separated list of directories for storing log files. Using multiple directories on separate disks can improve file channel peformance

数据存储的文件夹

transactionCapacity10000

The maximum size of transaction supported by the channel

事务里最多存多少事件

checkpointInterval30000

Amount of time (in millis) between checkpoints

多少时间再次对内存里面的指向数据的指针保存到检查点

maxFileSize2146435071

Max size (in bytes) of a single log file

保存数据的log文件最大值多少

minimumRequiredSpace524288000

Minimum Required free space (in bytes). To avoid data corruption, File Channel stops accepting take/put requests when free space drops below this value

磁盘最小剩余空间

capacity1000000

Maximum capacity of the channel

这指的是checkpoint文件存放event指针对象的最大容量 = 内存队列的对象总数

 

file channel  使用了内存序列 来保存 Event  对应在 datas/  目录里面的数据(已经被source写入,还未被sink消费)位置的指针(一个FlumeEventPointer对象,保存了文件名 :log数字   和offset),checkpoint文件可以理解就是 内存队列的快照,为了保证内存队列的完整性,在内存队列序列化的磁盘的时候,需要锁定内存队列,此时channel不能提供服务,source不能写,sink不能读;由于checkpoint要频繁的读取,可以配置backupCheckpointDir进行备份;

 

从source 到 file channel 过程

一个包含多个events的事务成功提交,events会被持久化到 datas/文件夹里面    log 文件里面(有编号),指针对象会保存到内存序列里面。然后会定时在把内存队列里面指针对象给存到checkpint文件里面

其中checkpoint文件夹里面 除了 检查点文件,还有

   1、 checkpoint/inflightTakes存放的是事务take的缓存数据,每隔段时间就重建文件。

 2、checkpoint/inflightPuts存放的是事务对应的put缓存数据,每隔段时间就重建文件。

 

 

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值