2016-06-10 7 views
0

followinf flume 구성이 있습니다. 스풀 디렉토리의 flume을 사용하여 hdfs에 9GB 크기의 파일을 전송하려고합니다. 다음과 같은 flume 구성이 있습니다.Flume 구성이 작동하지 않음 예외 표시

#initialize agent's source, channel and sink 
wagent.sources = wavetronix 
wagent.channels = memoryChannel2 
wagent.sinks = flumeHDFS 

# Setting the source to spool directory where the file exists 
wagent.sources.wavetronix.type = spooldir 
wagent.sources.wavetronix.spoolDir = /johir/WAVETRONIX/output/Yesterday 
wagent.sources.wavetronix.fileHeader = false 
wagent.sources.wavetronix.basenameHeader = true 
#agent.sources.wavetronix.fileSuffix = .COMPLETED 

# Setting the channel to memory 
wagent.channels.memoryChannel2.type = memory 
# Max number of events stored in the memory channel 
wagent.channels.memoryChannel2.capacity = 50000 
agent.channels.memoryChannel2.batchSize = 1000 
wagent.channels.memoryChannel2.transactioncapacity = 1000 

# Setting the sink to HDFS 
wagent.sinks.flumeHDFS.type = hdfs 
#agent.sinks.flumeHDFS.useLocalTimeStamp = true 
wagent.sinks.flumeHDFS.hdfs.path =/user/root/WAVETRONIXFLUME/%Y-%m-%d/ 
wagent.sinks.flumeHDFS.hdfs.useLocalTimeStamp = true 
wagent.sinks.flumeHDFS.hdfs.filePrefix= %{basename} 
wagent.sinks.flumeHDFS.hdfs.fileType = DataStream 

# Write format can be text or writable 
wagent.sinks.flumeHDFS.hdfs.writeFormat = Text 

# use a single csv file at a time 
wagent.sinks.flumeHDFS.hdfs.maxOpenFiles = 1 

wagent.sinks.flumeHDFS.hdfs.rollCount=0 
wagent.sinks.flumeHDFS.hdfs.rollInterval=0 
wagent.sinks.flumeHDFS.hdfs.rollSize = 6400000 
wagent.sinks.flumeHDFS.hdfs.batchSize =1000 

# never rollover based on the number of events 
wagent.sinks.flumeHDFS.hdfs.rollCount = 0 

# rollover file based on max time of 1 min 
#agent.sinks.flumeHDFS.hdfs.rollInterval = 0 
# agent.sinks.flumeHDFS.hdfs.idleTimeout = 600 

# Connect source and sink with channel 
wagent.sources.wavetronix.channels = memoryChannel2 
wagent.sinks.flumeHDFS.channel = memoryChannel2 

하지만 다음 예외가 발생합니다.

Exception in thread "SinkRunner-PollingRunner-DefaultSinkProcessor" java.lang.OutOfMemoryError: Java heap space at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1043) at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1535) at java.lang.ClassLoader.getClassLoadingLock(ClassLoader.java:463) at java.lang.ClassLoader.loadClass(ClassLoader.java:404) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.apache.log4j.spi.LoggingEvent.(LoggingEvent.java:165) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.log(Category.java:856) at org.slf4j.impl.Log4jLoggerAdapter.warn(Log4jLoggerAdapter.java:479) at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:461) 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)

누구든지이 문제를 해결할 수 있습니까?

답변

0

파일 ${FLUME_HOME}/conf/flume-env.sh를 수정하십시오, 다음, 다음 코드를 추가합니다

export JAVA_OPTS="-Xms1000m -Xmx12000m -Dcom.sun.management.jmxremote"

당신은 "의 -Xmx"와 "XMS를"옵션을 조정할 수 있습니다.