这是一个关于池子的故事。有一个池子,它一头进水,另一头出水,进水口可以配置各种管子,出水口也可以配置各种管子,可以有多个进水口、多个出水口。水术语称为Event,进水口术语称为Source、出水口术语成为Sink、池子术语成为Channel,Source+Channel+Sink,术语称为Agent。如果有需要,还可以把多个Agent连起来。
 
channel 
channel 是flume的中间数据缓存管道,有点类似kafka的机制,因此个组件的性能很重要。
我在项目中主要采用的是menmory channel,原因是数据量大,要求极大的数据吞吐量和速度,但是有一点不好的是
如果一旦flume进程down掉,是没有“续点传输”的机制的,filechannel 和它正好相反。 
 
关键参数讲解:

  1. (1)   capacity  :   存储在channel中的events的最大数量
  2. (2)   transactionCapacity : 每次数据由channel到sink传输的最大events的数量
  3. (3)   byteCapacity  :该channel的内存大小,单位是 byte 。

"PollableSourceRunner-SQLSource-sourceOne" java.lang.OutOfMemoryError:

 
       通过排查问题后得出造成此类问题的原因是,项目的一个模块在批量导入数据,程序需要New一个很大的对象,GC发现内存不够后,对内存进行回收,但是发现回收后的内存还不能满足大对象的需要。应此造成了内存溢出。
flume-env.sh

  1. export JAVA_OPTS="-Xms100m -Xmx2000m -Dcom.sun.management.jmxremote"

Caused by: org.apache.flume.ChannelException: Cannot commit transaction.
Byte capacity allocated to store event body 640000.0reached. Please increase heap space/byte capacity allocated to the channel as the sinks may not be keeping up with the sources


  1. 2017-07-19 10:56:04,366 (PollableSourceRunner-SQLSource-sourceOne) [ERROR - org.apache.flume.source.PollableSourceRunner$PollingRunner.run(PollableSourceRunner.java:156)] Unhandled exception, logging and sleeping for 5000ms
  2. org.apache.flume.ChannelException: Unable to put batch on required channel: org.apache.flume.channel.MemoryChannel{name: channelOne}
  3. at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:200)
  4. at org.keedio.flume.source.SQLSource$ChannelWriter.flush(SQLSource.java:168)
  5. at java.io.PrintWriter.flush(PrintWriter.java:320)
  6. at com.opencsv.CSVWriter.flush(CSVWriter.java:320)
  7. at org.keedio.flume.source.SQLSource.process(SQLSource.java:94)
  8. at org.apache.flume.source.PollableSourceRunner$PollingRunner.run(PollableSourceRunner.java:139)
  9. at java.lang.Thread.run(Thread.java:745)
  10. Caused by: org.apache.flume.ChannelException: Cannot commit transaction. Byte capacity allocated to store event body 640000.0reached. Please increase heap space/byte capacity allocated to the channel as the sinks may not be keeping up with the sources
  11. at org.apache.flume.channel.MemoryChannel$MemoryTransaction.doCommit(MemoryChannel.java:123)
  12. at org.apache.flume.channel.BasicTransactionSemantics.commit(BasicTransactionSemantics.java:151)
  13. at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:192)
  14. ... 6 more

在sink中,channel的transactionCapacity参数不能小于sink的batchsize。

最新文章

  1. windows中,端口查看&关闭进程及Kill使用
  2. AngularJS 后台交互
  3. js显示隐藏
  4. CentOS 7 程序自启动的问题
  5. [译]学习IPython进行交互式计算和数据可视化(二)
  6. Egret白鹭H5小游戏开发入门(一)
  7. MVC中的时间js格式化
  8. Access导出csv 内容添加双引号 vba
  9. Java中Set集合的使用
  10. 论java虚拟类和接口的区别
  11. 8 Types Of Friends You Need To Have in Your Life
  12. Oracle 表的连接方式(1)-----Nested loop join和 Sort merge join
  13. 【转】win7如何设置共享目录,并且访问不需要输入用户名和密码。
  14. 我用过的Linux命令--修改主机名
  15. Java开发工具IntelliJ IDEA使用教程:创建新的Andriod项目
  16. android cookie持久化
  17. 如何保证MongoDB的安全性?
  18. RF基础(一) RF内建函数库BuiltIn
  19. Unity中物体碰撞后去掉相互之间的反弹力
  20. 在jmeter测试中模拟不同的带宽环境

热门文章

  1. itchat和wordcloud对微信好友的签名进行画像
  2. Redux和react-redux的学习总结
  3. mysql以zip安装,解决the service already exists
  4. Mac使用Shell(终端)SSH连接远程服务器
  5. Python—列表操作
  6. 如何把已有SQLSERVER数据库更名而且附加到数据库中?
  7. asp.net core mvc HTTP Error 502.5 - Process Failure
  8. Centos7部署kubernetes测试k8s应用(九)
  9. Windows10 VS2017 C++使用crypto++库加密解密(AES)
  10. cocos2dx为Sprite添加触摸事件监听器