flume file channel 异常解决

1. 错误提示

  

2016-04-21 05:40:51,393 (SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:160)] Unable to deliver event. Exception follows.
java.lang.IllegalStateException: Channel closed [channel=channel1]. Due to java.io.EOFException: null
        at org.apache.flume.channel.file.FileChannel.createTransaction(FileChannel.java:329)
        at org.apache.flume.channel.BasicChannelSemantics.getTransaction(BasicChannelSemantics.java:122)
        at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:376)
        at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
        at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
        at java.io.RandomAccessFile.readInt(RandomAccessFile.java:827)
        at java.io.RandomAccessFile.readLong(RandomAccessFile.java:860)
        at org.apache.flume.channel.file.EventQueueBackingStoreFactory.get(EventQueueBackingStoreFactory.java:79)
        at org.apache.flume.channel.file.Log.replay(Log.java:417)
        at org.apache.flume.channel.file.FileChannel.start(FileChannel.java:279)
        at org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:251)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        ... 1 more
2016-04-21 05:40:51,972 (pool-4-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source source1: { spoolDir: /home/hadoop_admin/movielog }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
java.lang.IllegalStateException: Channel closed [channel=channel1]. Due to java.io.EOFException: null
        at org.apache.flume.channel.file.FileChannel.createTransaction(FileChannel.java:329)
        at org.apache.flume.channel.BasicChannelSemantics.getTransaction(BasicChannelSemantics.java:122)
        at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:181)
        at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:235)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
        at java.io.RandomAccessFile.readInt(RandomAccessFile.java:827)
        at java.io.RandomAccessFile.readLong(RandomAccessFile.java:860)
        at org.apache.flume.channel.file.EventQueueBackingStoreFactory.get(EventQueueBackingStoreFactory.java:79)
        at org.apache.flume.channel.file.Log.replay(Log.java:417)
        at org.apache.flume.channel.file.FileChannel.start(FileChannel.java:279)
        at org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:251)
        ... 7 more

 配置文件:

  

agent1.sources = source1
agent1.channels = channel1
agent1.sinks = sink1

# Each channel‘s type is defined.
agent1.channels.channel1.type = file
agent1.channels.channel1.checkpointDir = /home/hadoop_admin/flumeTemp/fchannel/spool/checkpoint
agent1.channels.channel1.dataDirs = /home/hadoop_admin/flumeTemp/fchannel/spool/data
agent1.channels.channel1.capacity = 200000000
agent1.channels.channel1.keep-alive = 30
agent1.channels.channel1.write-timeout = 30
agent1.channels.channel1.checkpoint-timeout = 600

# For each one of the sources, the type is defined
agent1.sources.source1.type = spooldir
agent1.sources.source1.inputCharset = GBK
agent1.sources.source1.spoolDir =/home/hadoop_admin/movielog
agent1.sources.source1.fileHeader = true
agent1.sources.source1.deletePolicy = immediate
agent1.sources.source1.batchSize = 1000
agent1.sources.source1.channels = channel1

# Each sink‘s type must be defined
agent1.sinks.sink1.type = hdfs
agent1.sinks.sink1.channel = channel1
agent1.sinks.sink1.hdfs.path = hdfs://master:9000/flumeTest
agent1.sinks.sink1.hdfs.filePrefix = master-
agent1.sinks.sink1.hdfs.writeFormat = Text
agent1.sinks.sink1.hdfs.fileType = DataStream
agent1.sinks.sink1.hdfs.rollInterval = 0
agent1.sinks.sink1.hdfs.idleTimeout = 0
agent1.sinks.sink1.hdfs.rollCount = 0
agent1.sinks.sink1.hdfs.rollSize = 102400
agent1.sinks.sink1.hdfs.batchSize = 1000
agent1.sinks.sink1.hdfs.callTimeout = 30000

2. 解决方法

  链接: http://serverfault.com/questions/690588/flume-error-log-while-using-filechannel

  只要把配置文件中的关于channel配置checkpointDir和dataDir目录清空就可以

时间: 2024-10-17 03:06:37

flume file channel 异常解决的相关文章

[bigdata] flume file channel CPU消耗比 memory channel高的原因

https://www.quora.com/Why-does-flume-take-more-resource-CPU-when-file-channel-is-used-compared-to-when-memory-channel-is-used In case of File channel , the CPU would be used for the following Serializing/Deserializing Events from/to file channel . In

flume 报File Channel transaction capacity cannot be greater than the capacity of the channel capacity错误

今天在部署flume集群时,在启动collector服务器没报错,启动agent服务器报错: File Channel transaction capacity cannot be greater than the capacity of the  channel capacity 查了下相关解决办法,将配置文件中的 agent.channels.memoryChannel.capacity = 1000调整为 agent.channels.memoryChannel.capacity = 10

安装Flume的时候出现File Channel transaction capacity cannot be greater than the capacity of the channel capacity -解决方案 摘自网络

部署flume集群时,在启动collector服务器没报错,启动agent服务器报错: File Channel transaction capacity cannot be greater than the capacity of the channel capacity 查了下相关解决办法,将配置文件中的 agent.channels.memoryChannel.capacity = 1000调整为 agent.channels.memoryChannel.capacity = 10000

实时事件统计项目:优化flume:用file channel代替mem channel

背景:利用kafka+flume+morphline+solr做实时统计. solr从12月23号开始一直没有数据.查看日志发现,因为有一个同事加了一条格式错误的埋点数据,导致大量error. 据推断,是因为使用mem channel占满,消息来不及处理,导致新来的数据都丢失了. 修改flume使用file channel: kafka2solr.sources = source_from_kafka kafka2solr.channels = file_channel kafka2solr.s

Spring 配置异常解决办法之Referenced file contains errors

Spring 配置异常解决办法之Referenced file contains errors (http://www.sp Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd). For more information, right click on the message in the Problems View and select "Show

SVN操作异常解决日志

1 svn locked某个目录-无法进行更新 产生这种情况大多是因为上次svn命令执行失败且被锁定了.如果cleanup没有效果的话只好手动删除锁定文件. 在命令提示符下cd 到svn项目出现问题的文件所在目录下,然后执行如下命令 del lock /q/s 就把锁删掉了.如图所示: 2.svn remains in conflict错误解决 情形:当有人在对某文件进行修改,假设为A文件,并提交至svn服务器,如果此时你正在修改A页面,并对其进行更新.会出现一些残余文件信息.如果在未删除这些文

Flume 内存channel的数据持久化

flume-ng 1.5 新增一个Spillable memory channel :http://www.tuicool.com/articles/i2mUfqb 虽然可以在sink阻塞时候,把event存入file channel,且file channel在flume崩溃再启动时能恢复数据,但是对于在mem channel中得数据还是没法恢复

文件上传时报Recv failure: Connection reset by peer异常解决

以前上传文件时报这个异常没这么在意,这次网络不好时总是报这个异常,导致文件上传失败,故特意说明一下,报个异常的原因还是很多的,今日只针对我当前遇上的问题进行记录一下. 背景:平时网络好的时候,我开启线程的上传和下载都没问题,网络慢的时候就出来这个异常 Recv failure: Connection reset by peer . 异常的原因有两点:1.网络非常慢时易导致该异常:2.线程多次重复请求网络服务造成的异常,因为上次启用的线程还没断开,所以该服务一直存在,导致再次进行上传请求时异常.

hadoop 出现FATAL conf.Configuration: error parsing conf file,异常

FATAL conf.Configuration: error parsing conf file: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. 14/07/12 23:51:40 ERROR namenode.NameNode: java.lang.RuntimeException: com.sun.org.