agent.sources = r1 agent.sinks = k1 agent.channels = c1 agent.sources.r1.type = spooldir agent.sources.r1.spoolDir = /Users/lihu/Desktop/crawla/ agent.sources.r1.fileHeader = true agent.sources.r1.channels = c1 agent.sinks.k1.type = logger agent.sinks.k1.channel = c1 agent.channels.c1.type = memory agent.channels.c1.capacity = 1000 agent.channels.c1.transactionCapacity = 100
lihudeMacBook-Pro:flume SunAndLi$ bin/flume-ng agent -c conf -f conf/spooldir --name agent -Dflume.root.logger=INFO,console
lihudeMacBook-Pro:~ SunAndLi$ echo "iy3" > /Users/lihu/Desktop/crawla/spool_text.log
2017-03-22 16:28:56,816 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.LoggerSink.process(LoggerSink.java:95)] Event: { headers:{file=/Users/lihu/Desktop/crawla/spool_text.log} body: 69 79 33 iy3 } 2017-03-22 16:28:56,817 (pool-3-thread-1) [INFO - org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:324)] Last read took us just up to a file boundary. Rolling to the next file, if there is one. 2017-03-22 16:28:56,817 (pool-3-thread-1) [INFO - org.apache.flume.client.avro.ReliableSpoolingFileEventReader.rollCurrentFile(ReliableSpoolingFileEventReader.java:433)] Preparing to move file /Users/lihu/Desktop/crawla/spool_text.log to /Users/lihu/Desktop/crawla/spool_text.log.COMPLETED
如果报错类似于 Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue process
换一个文件夹