水槽hdfs水槽的滚动设置

时间:2018-06-11 06:23:20

标签: hdfs flume sink

以下是我在flume.conf中的设置:

agent.sources = srcpv
agent.channels = chlpv
agent.sinks = hdfsSink
agent.sources.srcpv.type = exec
agent.sources.srcpv.command = tail -F /var/log/collector/web/pv.log
agent.sources.srcpv.channels = chlpv
agent.channels.chlpv.type = memory
agent.channels.chlpv.capacity = 1000000
agent.channels.chlpv.transactionCapacity = 100
agent.sinks.hdfsSink.type = hdfs
agent.sinks.hdfsSink.channel = chlpv
agent.sinks.hdfsSink.hdfs.path = hdfs://hadoop01:8020/flume/web/pv/
agent.sinks.hdfsSink.hdfs.filePrefix = pv-
agent.sinks.hdfsSink.hdfs.rollSize = 1024
agent.sinks.hdfsSink.hdfs.rollInterval= 30
agent.sinks.hdfsSink.hdfs.rollCount = 10

我希望文件可以按特定大小或间隔滚动,但滚动设置(rollSize,rollInterval,rollCount)不能生效,不会生成hdfs文件。几分钟后我收到了这个错误:

[SinkRunner-PollingRunner-DefaultSinkProcessor] ERROR org.apache.flume.sink.hdfs.HDFSEventSink - process failed java.lang.OutOfMemoryError: GC overhead limit exceeded

任何人都可以帮忙指出适当的HDFS接收器设置吗?

1 个答案:

答案 0 :(得分:0)

运行水槽时似乎Java内存不足。

您可以尝试在flume-env.sh文件中添加以下行:

export JAVA_OPTS="-Xms100m -Xmx2g -Dcom.sun.management.jmxremote"

根据系统配置增加值Xmx。

希望这会有所帮助:)