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,数据全部追加在一个文件中。

最新文章

  1. LDR、STR指令
  2. Queue 的用法
  3. Androidmanifest之manifest标签详细介绍
  4. C#字符操作
  5. Linux环境的PHP执行
  6. 【转载】Linux下编辑生成.mo文件
  7. android窗口泄漏,isInEditMode解决可视化编辑器无法识别自定义控件的问题
  8. oracle 序列 详解
  9. Spring使用拦截器支持国际化(转)
  10. WinForm 加载自定义控件闪烁问题
  11. lintcode 中等题:unique Binary Search Tree 不同的二叉查找树
  12. RFC2889转发性能測试用例设计和自己主动化脚本实现
  13. [Swift]LeetCode346. 从数据流中移动平均值 $ Moving Average from Data Stream
  14. 第79节:Java中一些要点
  15. 03C++语言对C的增强——实用性、变量检测、struct类型、C++中所有变量和函数都必须有类型、bool类型、三目运算符
  16. css忽略某一层的存在:pointer-events:none
  17. C#如何判断程序调用的exe已结束
  18. js实现jquery的offset()
  19. js验证码有效时间倒计时
  20. ThinkPHP3.1.3 整合 UEditor百度编辑器 图片上传

热门文章

  1. centos更换网易的源
  2. div 遮罩问题
  3. js 中innerHTML,innerText,outerHTML,outerText的区别
  4. jenkins 忘记用户名和密码
  5. 13. Roman to Integer ★
  6. python机器可读数据-json
  7. Visitor 模式心得
  8. Java与C/C++有什么区别?
  9. cocos-lua3.17 Lua tablrView工具类
  10. js /Date(1550273700000)/ 格式转换