flume taildir 启动异常LifecycleSupervisor$MonitorRunnable.run
1、異常關鍵信息:
LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:251)] Unable to start PollableSourceRunner: { source:Taildir source: { positionFile: /poros/tyxTest/taildir_position.json
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2
?2、異常全部信息:
[ERROR - org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:251)] Unable to start PollableSourceRunner: { source:Taildir source: { positionFile: /poros/tyxTest/taildir_position.json, skipToEnd: true, byteOffsetHeader: false, idleTimeout: 120000, writePosInterval: 3000 } counterGroup:{ name:null counters:{} } } - Exception follows.
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2
?? ?at com.google.gson.stream.JsonReader.expect(JsonReader.java:339)
?? ?at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:306)
?? ?at org.apache.flume.source.taildir.ReliableTaildirEventReader.loadPositionFile(ReliableTaildirEventReader.java:111)
?? ?at org.apache.flume.source.taildir.ReliableTaildirEventReader.<init>(ReliableTaildirEventReader.java:96)
?? ?at org.apache.flume.source.taildir.ReliableTaildirEventReader.<init>(ReliableTaildirEventReader.java:49)
?? ?at org.apache.flume.source.taildir.ReliableTaildirEventReader$Builder.build(ReliableTaildirEventReader.java:355)
?? ?at org.apache.flume.source.taildir.TaildirSource.start(TaildirSource.java:105)
?? ?at org.apache.flume.source.PollableSourceRunner.start(PollableSourceRunner.java:71)
?? ?at org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:249)
?? ?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.access$301(ScheduledThreadPoolExecutor.java:180)
?? ?at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
?? ?at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
?? ?at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
?? ?at java.lang.Thread.run(Thread.java:748)
?3、解決方案(最簡單):
刪掉配置文件的
?? ?a1.sources.r1.positionFile = /home/hadoop/taildir_position.json
4、原因:?
上述配置的作用是記錄采集文件的讀取索引和大小的,是需要flume自動生成和修改的,遇到上面的錯,多數是自己創建了此文件,沒有細看官網說明(me)
?? ?~/.flume/taildir_position.json?? ?File in JSON format to record the inode, the absolute path and the last position of each tailing file.
總結
以上是生活随笔為你收集整理的flume taildir 启动异常LifecycleSupervisor$MonitorRunnable.run的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java获取当前工作目录
- 下一篇: redhat6、redhat7、cent