flume实现kafka到文件测试用例
2024-08-24 11:07:00
kafka 到 file
at2.sources =st2
at2.channels = ct2
at2.sinks = kt2 # For each one of the sources, the type is defined
at2.sources.st2.type = org.apache.flume.source.kafka.KafkaSource
at2.sources.st2.kafka.bootstrap.servers = node0.***:9200,node1.***:9200,node2.***:9200
at2.sources.st2.kafka.topics = flume-test
at2.sources.st2.kafka.consumer.group.id = flume-to-file-test-group-id
# The channel can be defined as follows.
at2.sources.st2.channels = ct2
at2.sources.st2.kafka.batchSize = 100 # Each sink's type must be defined
at2.sinks.kt2.type = file_roll
at2.sinks.kt2.sink.directory = /mnt/home/admin/install/flume/examples/file-dir
at2.sinks.kt2.batchSize = 100
at2.sinks.kt2.sink.rollInterval = 300
#Specify the channel the sink should use
at2.sinks.kt2.channel = ct2 # Each channel's type is defined.
at2.channels.ct2.type = memory
at2.channels.ct2.capacity = 1000
at2.channels.ct2.transactionCapacity = 1000
# Other config values specific to each type of channel(sink or source)
at2.sources.st2.channels = ct2
at2.sinks.kt2.channel = ct2
在该文件所存的目录下,执行以下命令调起:
flume-ng agent -name at2 -conf-file test-kafka-to-file.properties
注:sink.rollInterval=300,表示每隔300秒分割成一个文件,默认为30秒,如果不想分割,可以写为0,数据全部追加在一个文件中。
最新文章
- LDR、STR指令
- Queue 的用法
- Androidmanifest之manifest标签详细介绍
- C#字符操作
- Linux环境的PHP执行
- 【转载】Linux下编辑生成.mo文件
- android窗口泄漏,isInEditMode解决可视化编辑器无法识别自定义控件的问题
- oracle 序列 详解
- Spring使用拦截器支持国际化(转)
- WinForm 加载自定义控件闪烁问题
- lintcode 中等题:unique Binary Search Tree 不同的二叉查找树
- RFC2889转发性能測试用例设计和自己主动化脚本实现
- [Swift]LeetCode346. 从数据流中移动平均值 $ Moving Average from Data Stream
- 第79节:Java中一些要点
- 03C++语言对C的增强——实用性、变量检测、struct类型、C++中所有变量和函数都必须有类型、bool类型、三目运算符
- css忽略某一层的存在:pointer-events:none
- C#如何判断程序调用的exe已结束
- js实现jquery的offset()
- js验证码有效时间倒计时
- ThinkPHP3.1.3 整合 UEditor百度编辑器 图片上传