Flume : java.io.IOException: 不是数据文件
Flume : java.io.IOException: Not a data file
今晚我们的磁盘 space 已满,今天我在 Flume 日志中收到此错误:
22 Feb 2017 10:24:56,180 ERROR [pool-6-thread-1] (org.apache.flume.client.avro.ReliableSpoolingFileEventReader.openFile:504) - Exception opening file: /.../flume_spool/data.../data_2017-02-21_17-15-00_8189
java.io.IOException: Not a data file.
at org.apache.avro.file.DataFileStream.initialize(DataFileStream.java:102)
at org.apache.avro.file.DataFileReader.<init>(DataFileReader.java:97)
at org.apache.avro.file.DataFileWriter.appendTo(DataFileWriter.java:160)
at org.apache.avro.file.DataFileWriter.appendTo(DataFileWriter.java:149)
at org.apache.flume.serialization.DurablePositionTracker.<init>(DurablePositionTracker.java:141)
at org.apache.flume.serialization.DurablePositionTracker.getInstance(DurablePositionTracker.java:76)
at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.openFile(ReliableSpoolingFileEventReader.java:478)
at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.getNextFile(ReliableSpoolingFileEventReader.java:459)
at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:229)
at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:227)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Flume 版本:1.5.2
java.io.IOException: Not a data file
异常是由于存在用于处理的保存元数据的临时目录。
此目录由 flume.conf 中 spooldir 源定义中的 trackerDir 指令控制(默认为 spooldir 中的 .flumespool)。
我们最终得到了空的元数据文件,这些文件没有 avro(我们正在使用 avro 接收器)期望看到的 2 个字节。实际数据文件实际上没有任何问题,只有元数据文件有问题。
因此,解决方案是删除 .flumespool,问题自行解决(当然是在从磁盘释放一些 space 之后。)
- 进入您的假脱机文件夹:
/.../flume_spool/data...
- 命令:
find . -type f -empty
- 我猜你会发现这个:
.flumespool/.flumespool-main.meta
- 然后
rm .flumespool/.flumespool-main.meta
今晚我们的磁盘 space 已满,今天我在 Flume 日志中收到此错误:
22 Feb 2017 10:24:56,180 ERROR [pool-6-thread-1] (org.apache.flume.client.avro.ReliableSpoolingFileEventReader.openFile:504) - Exception opening file: /.../flume_spool/data.../data_2017-02-21_17-15-00_8189
java.io.IOException: Not a data file.
at org.apache.avro.file.DataFileStream.initialize(DataFileStream.java:102)
at org.apache.avro.file.DataFileReader.<init>(DataFileReader.java:97)
at org.apache.avro.file.DataFileWriter.appendTo(DataFileWriter.java:160)
at org.apache.avro.file.DataFileWriter.appendTo(DataFileWriter.java:149)
at org.apache.flume.serialization.DurablePositionTracker.<init>(DurablePositionTracker.java:141)
at org.apache.flume.serialization.DurablePositionTracker.getInstance(DurablePositionTracker.java:76)
at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.openFile(ReliableSpoolingFileEventReader.java:478)
at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.getNextFile(ReliableSpoolingFileEventReader.java:459)
at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:229)
at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:227)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Flume 版本:1.5.2
java.io.IOException: Not a data file
异常是由于存在用于处理的保存元数据的临时目录。
此目录由 flume.conf 中 spooldir 源定义中的 trackerDir 指令控制(默认为 spooldir 中的 .flumespool)。
我们最终得到了空的元数据文件,这些文件没有 avro(我们正在使用 avro 接收器)期望看到的 2 个字节。实际数据文件实际上没有任何问题,只有元数据文件有问题。
因此,解决方案是删除 .flumespool,问题自行解决(当然是在从磁盘释放一些 space 之后。)
- 进入您的假脱机文件夹:
/.../flume_spool/data...
- 命令:
find . -type f -empty
- 我猜你会发现这个:
.flumespool/.flumespool-main.meta
- 然后
rm .flumespool/.flumespool-main.meta