标签:BD Flume sinks hdfs sources k1 a4 r1
什么是Flume
- 采集日志,存在HDFS上
- 分布式、高可用、高可靠的海量日志采集、聚合和传输系统
- 支持在日志系统中定制各类数据发送方,用于收集数据
- 支持对数据进行简单处理,写到数据接收方
组件
- source
- channel
- sink
实例
- 配置文件
1 #bin/flume-ng agent -n a4 -f myagent/a4.conf -c conf -Dflume.root.logger=INFO,console 2 #定义agent名, source、channel、sink的名称 3 a4.sources = r1 4 a4.channels = c1 5 a4.sinks = k1 6 7 #具体定义source 8 a4.sources.r1.type = spooldir 9 a4.sources.r1.spoolDir = /root/training/logs 10 11 #具体定义channel 12 a4.channels.c1.type = memory 13 a4.channels.c1.capacity = 10000 14 a4.channels.c1.transactionCapacity = 100 15 16 #定义拦截器,为消息添加时间戳 17 a4.sources.r1.interceptors = i1 18 a4.sources.r1.interceptors.i1.type = org.apache.flume.interceptor.TimestampInterceptor$Builder 19 20 21 #具体定义sink 22 a4.sinks.k1.type = hdfs 23 a4.sinks.k1.hdfs.path = hdfs://192.168.56.111:9000/flume/%Y%m%d 24 a4.sinks.k1.hdfs.filePrefix = events- 25 a4.sinks.k1.hdfs.fileType = DataStream 26 27 #不按照条数生成文件 28 a4.sinks.k1.hdfs.rollCount = 0 29 #HDFS上的文件达到128M时生成一个文件 30 a4.sinks.k1.hdfs.rollSize = 134217728 31 #HDFS上的文件达到60秒生成一个文件 32 a4.sinks.k1.hdfs.rollInterval = 60 33 34 #组装source、channel、sink 35 a4.sources.r1.channels = c1 36 a4.sinks.k1.channel = c1View Code
标签:BD,Flume,sinks,hdfs,sources,k1,a4,r1 来源: https://www.cnblogs.com/cxc1357/p/12709784.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。