0
点赞
收藏
分享

微信扫一扫

|NO.Z.00011|——————————|BigDataEnd|——|Hadoop&PB级数仓.V03|——|PB数仓.v03|会员活跃度分析|hdfs sink|

一、日志采集配置:hdfs sink配置

### --- 日志采集配置:hdfs sink配置

a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = /user/data/logs/start/%Y-%m-%d/
a1.sinks.k1.hdfs.filePrefix = startlog.
a1.sinks.k1.hdfs.fileType = DataStream
~~~     # 配置文件滚动方式(文件大小32M)

a1.sinks.k1.hdfs.rollSize = 33554432
a1.sinks.k1.hdfs.rollCount = 0
a1.sinks.k1.hdfs.rollInterval = 0
a1.sinks.k1.hdfs.idleTimeout = 0
a1.sinks.k1.hdfs.minBlockReplicas = 1
~~~     # 向hdfs上刷新的event的个数
a1.sinks.k1.hdfs.batchSize = 100

~~~ # 使用本地时间
a1.sinks.k1.hdfs.useLocalTimeStamp = true
### --- HDFS Sink 都会采用滚动生成文件的方式,滚动生成文件的策略有:

~~~ 基于时间。hdfs.rollInterval 30秒
~~~ 基于文件大小。hdfs.rollSize 1024字节
~~~ 基于event数量。hdfs.rollCount 10个event
~~~ 基于文件空闲时间。hdfs.idleTimeout 0
~~~ 0,禁用
~~~ minBlockReplicas。默认值与 hdfs 副本数一致。
~~~ 设为1是为了让 Flume 感知不到hdfs的块复制,
~~~ 此时其他的滚动方式配置(时间间隔、文件大小、events数量)才不会受影响

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart

                                                                                                                                                   ——W.S.Landor


举报

相关推荐

0 条评论